diff --git a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfiguration.cxx b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfiguration.cxx deleted file mode 100644 index f423c3c9cc9..00000000000 --- a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfiguration.cxx +++ /dev/null @@ -1,214 +0,0 @@ -// 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 AdvancedConfiguration.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "AdvancedConfiguration.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - - - -AdvancedConfiguration::AdvancedConfiguration() -{ -} - -AdvancedConfiguration::~AdvancedConfiguration() -{ -} - -AdvancedConfiguration::AdvancedConfiguration( - const AdvancedConfiguration& x) -{ - m_index = x.m_index; - m_message = x.m_message; - m_data = x.m_data; -} - -AdvancedConfiguration::AdvancedConfiguration( - AdvancedConfiguration&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); - m_data = std::move(x.m_data); -} - -AdvancedConfiguration& AdvancedConfiguration::operator =( - const AdvancedConfiguration& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - m_data = x.m_data; - return *this; -} - -AdvancedConfiguration& AdvancedConfiguration::operator =( - AdvancedConfiguration&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - m_data = std::move(x.m_data); - return *this; -} - -bool AdvancedConfiguration::operator ==( - const AdvancedConfiguration& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message && - m_data == x.m_data); -} - -bool AdvancedConfiguration::operator !=( - const AdvancedConfiguration& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void AdvancedConfiguration::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t AdvancedConfiguration::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& AdvancedConfiguration::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void AdvancedConfiguration::message( - const std::array& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void AdvancedConfiguration::message( - std::array&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::array& AdvancedConfiguration::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::array& AdvancedConfiguration::message() -{ - return m_message; -} - - -/*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ -void AdvancedConfiguration::data( - const std::vector& _data) -{ - m_data = _data; -} - -/*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ -void AdvancedConfiguration::data( - std::vector&& _data) -{ - m_data = std::move(_data); -} - -/*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ -const std::vector& AdvancedConfiguration::data() const -{ - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -std::vector& AdvancedConfiguration::data() -{ - return m_data; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "AdvancedConfigurationCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfiguration.h b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfiguration.hpp similarity index 67% rename from examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfiguration.h rename to examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfiguration.hpp index 207a02e1cd0..cf302de8bc8 100644 --- a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfiguration.h +++ b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfiguration.hpp @@ -13,32 +13,20 @@ // limitations under the License. /*! - * @file AdvancedConfiguration.h + * @file AdvancedConfiguration.hpp * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool fastddsgen. */ -#include -#include "AdvancedConfigurationv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_ADVANCEDCONFIGURATION_H_ -#define _FAST_DDS_GENERATED_ADVANCEDCONFIGURATION_H_ +#ifndef _FAST_DDS_GENERATED_ADVANCEDCONFIGURATION_HPP_ +#define _FAST_DDS_GENERATED_ADVANCEDCONFIGURATION_HPP_ #include -#include #include -#include -#include +#include #include -#include -#include -#include - - #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -64,19 +52,6 @@ #define ADVANCEDCONFIGURATION_DllAPI #endif // _WIN32 -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - - - /*! * @brief This class represents the structure AdvancedConfiguration defined by the user in the IDL file. * @ingroup AdvancedConfiguration @@ -88,73 +63,124 @@ class AdvancedConfiguration /*! * @brief Default constructor. */ - eProsima_user_DllExport AdvancedConfiguration(); + eProsima_user_DllExport AdvancedConfiguration() + { + } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~AdvancedConfiguration(); + eProsima_user_DllExport ~AdvancedConfiguration() + { + } /*! * @brief Copy constructor. * @param x Reference to the object AdvancedConfiguration that will be copied. */ eProsima_user_DllExport AdvancedConfiguration( - const AdvancedConfiguration& x); + const AdvancedConfiguration& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + m_data = x.m_data; + + } /*! * @brief Move constructor. * @param x Reference to the object AdvancedConfiguration that will be copied. */ eProsima_user_DllExport AdvancedConfiguration( - AdvancedConfiguration&& x) noexcept; + AdvancedConfiguration&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + m_data = std::move(x.m_data); + } /*! * @brief Copy assignment. * @param x Reference to the object AdvancedConfiguration that will be copied. */ eProsima_user_DllExport AdvancedConfiguration& operator =( - const AdvancedConfiguration& x); + const AdvancedConfiguration& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + m_data = x.m_data; + + return *this; + } /*! * @brief Move assignment. * @param x Reference to the object AdvancedConfiguration that will be copied. */ eProsima_user_DllExport AdvancedConfiguration& operator =( - AdvancedConfiguration&& x) noexcept; + AdvancedConfiguration&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + m_data = std::move(x.m_data); + return *this; + } /*! * @brief Comparison operator. * @param x AdvancedConfiguration object to compare. */ eProsima_user_DllExport bool operator ==( - const AdvancedConfiguration& x) const; + const AdvancedConfiguration& x) const + { + return (m_index == x.m_index && + m_message == x.m_message && + m_data == x.m_data); + } /*! * @brief Comparison operator. * @param x AdvancedConfiguration object to compare. */ eProsima_user_DllExport bool operator !=( - const AdvancedConfiguration& x) const; + const AdvancedConfiguration& x) const + { + return !(*this == x); + } /*! * @brief This function sets a value in member index * @param _index New value for member index */ eProsima_user_DllExport void index( - uint32_t _index); + uint32_t _index) + { + m_index = _index; + } /*! * @brief This function returns the value of member index * @return Value of member index */ - eProsima_user_DllExport uint32_t index() const; + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } /*! * @brief This function returns a reference to member index * @return Reference to member index */ - eProsima_user_DllExport uint32_t& index(); + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } /*! @@ -162,26 +188,38 @@ class AdvancedConfiguration * @param _message New value to be copied in member message */ eProsima_user_DllExport void message( - const std::array& _message); + const std::array& _message) + { + m_message = _message; + } /*! * @brief This function moves the value in member message * @param _message New value to be moved in member message */ eProsima_user_DllExport void message( - std::array&& _message); + std::array&& _message) + { + m_message = std::move(_message); + } /*! * @brief This function returns a constant reference to member message * @return Constant reference to member message */ - eProsima_user_DllExport const std::array& message() const; + eProsima_user_DllExport const std::array& message() const + { + return m_message; + } /*! * @brief This function returns a reference to member message * @return Reference to member message */ - eProsima_user_DllExport std::array& message(); + eProsima_user_DllExport std::array& message() + { + return m_message; + } /*! @@ -189,26 +227,40 @@ class AdvancedConfiguration * @param _data New value to be copied in member data */ eProsima_user_DllExport void data( - const std::vector& _data); + const std::vector& _data) + { + m_data = _data; + } /*! * @brief This function moves the value in member data * @param _data New value to be moved in member data */ eProsima_user_DllExport void data( - std::vector&& _data); + std::vector&& _data) + { + m_data = std::move(_data); + } /*! * @brief This function returns a constant reference to member data * @return Constant reference to member data */ - eProsima_user_DllExport const std::vector& data() const; + eProsima_user_DllExport const std::vector& data() const + { + return m_data; + } /*! * @brief This function returns a reference to member data * @return Reference to member data */ - eProsima_user_DllExport std::vector& data(); + eProsima_user_DllExport std::vector& data() + { + return m_data; + } + + private: @@ -218,8 +270,6 @@ class AdvancedConfiguration }; -#endif // _FAST_DDS_GENERATED_ADVANCEDCONFIGURATION_H_ - +#endif // _FAST_DDS_GENERATED_ADVANCEDCONFIGURATION_HPP_ -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationCdrAux.hpp b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationCdrAux.hpp index a99d903b31f..5eb6868b802 100644 --- a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationCdrAux.hpp +++ b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationCdrAux.hpp @@ -22,9 +22,9 @@ #ifndef _FAST_DDS_GENERATED_ADVANCEDCONFIGURATIONCDRAUX_HPP_ #define _FAST_DDS_GENERATED_ADVANCEDCONFIGURATIONCDRAUX_HPP_ -#include "AdvancedConfiguration.h" +#include "AdvancedConfiguration.hpp" -constexpr uint32_t AdvancedConfiguration_max_cdr_typesize {132UL}; +constexpr uint32_t AdvancedConfiguration_max_cdr_typesize {32UL}; constexpr uint32_t AdvancedConfiguration_max_key_cdr_typesize {0UL}; @@ -34,10 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const AdvancedConfiguration& data); diff --git a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationCdrAux.ipp b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationCdrAux.ipp index 61815b63fe3..58b1d9fab52 100644 --- a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationCdrAux.ipp +++ b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationCdrAux.ipp @@ -34,10 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationPubSubTypes.cxx b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationPubSubTypes.cxx index fc1cdd916e3..007acf0d5b9 100644 --- a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationPubSubTypes.cxx +++ b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationPubSubTypes.cxx @@ -19,20 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "AdvancedConfigurationPubSubTypes.h" +#include #include -#include "AdvancedConfigurationPubSubTypes.h" #include "AdvancedConfigurationCdrAux.hpp" +#include "AdvancedConfigurationTypeObjectSupport.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; - - - - AdvancedConfigurationPubSubType::AdvancedConfigurationPubSubType() { setName("AdvancedConfiguration"); @@ -221,3 +219,11 @@ bool AdvancedConfigurationPubSubType::getKey( return true; } +void AdvancedConfigurationPubSubType::register_type_object_representation() const +{ + register_AdvancedConfiguration_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "AdvancedConfigurationCdrAux.ipp" diff --git a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationPubSubTypes.h b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationPubSubTypes.h index 0db02f44359..1d09762eebe 100644 --- a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationPubSubTypes.h +++ b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationPubSubTypes.h @@ -29,7 +29,7 @@ #include #include -#include "AdvancedConfiguration.h" +#include "AdvancedConfiguration.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,10 +38,6 @@ #endif // GEN_API_VER - - - - /*! * @brief This class represents the TopicDataType of the type AdvancedConfiguration defined by the user in the IDL file. * @ingroup AdvancedConfiguration @@ -92,6 +88,9 @@ class AdvancedConfigurationPubSubType : public eprosima::fastdds::dds::TopicData eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationSubscriber.cpp b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationSubscriber.cpp index 8323c5b9874..2caa591eaa4 100644 --- a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationSubscriber.cpp +++ b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationSubscriber.cpp @@ -280,7 +280,7 @@ void HelloWorldSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - while ((reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) && !is_stopped()) + while ((reader->take_next_sample(&hello_, &info) == RETCODE_OK) && !is_stopped()) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationTypeObjectSupport.cxx b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationTypeObjectSupport.cxx new file mode 100644 index 00000000000..c19034579e1 --- /dev/null +++ b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationTypeObjectSupport.cxx @@ -0,0 +1,461 @@ +// 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 AdvancedConfigurationTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "AdvancedConfigurationTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "AdvancedConfiguration.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_AdvancedConfiguration_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_AdvancedConfiguration_type_identifier(); + + }); +} + +void register_AdvancedConfiguration_type_identifier() +{ + { + StructTypeFlag struct_flags_AdvancedConfiguration = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_AdvancedConfiguration; + TypeIdentifierPair type_ids_AdvancedConfiguration; + QualifiedTypeName type_name_AdvancedConfiguration = "AdvancedConfiguration"; + eprosima::fastcdr::optional type_ann_builtin_AdvancedConfiguration; + eprosima::fastcdr::optional ann_custom_AdvancedConfiguration; + CompleteTypeDetail detail_AdvancedConfiguration = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_AdvancedConfiguration, ann_custom_AdvancedConfiguration, type_name_AdvancedConfiguration.to_string()); + CompleteStructHeader header_AdvancedConfiguration; + header_AdvancedConfiguration = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_AdvancedConfiguration); + CompleteStructMemberSeq member_seq_AdvancedConfiguration; + { + return_code_AdvancedConfiguration = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_AdvancedConfiguration); + + if (return_code_AdvancedConfiguration != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1()._d() || TK_NONE == type_ids_AdvancedConfiguration.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_AdvancedConfiguration.type_identifier1()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_AdvancedConfiguration.type_identifier1()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_AdvancedConfiguration.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_AdvancedConfiguration.type_identifier2()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_AdvancedConfiguration.type_identifier2()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_AdvancedConfiguration.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_AdvancedConfiguration.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_AdvancedConfiguration); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_AdvancedConfiguration, member_index); + } + { + return_code_AdvancedConfiguration = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_char_20", type_ids_AdvancedConfiguration); + + if (return_code_AdvancedConfiguration != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_AdvancedConfiguration = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_char", type_ids_AdvancedConfiguration); + + if (return_code_AdvancedConfiguration != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_char_20 {nullptr}; + if (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1()._d() || TK_NONE == type_ids_AdvancedConfiguration.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_AdvancedConfiguration.type_identifier1()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_AdvancedConfiguration.type_identifier1()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_char_20 = new TypeIdentifier(type_ids_AdvancedConfiguration.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_AdvancedConfiguration.type_identifier2()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_AdvancedConfiguration.type_identifier2()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_char_20 = new TypeIdentifier(type_ids_AdvancedConfiguration.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_char_20 = EK_COMPLETE; + if (TK_NONE == type_ids_AdvancedConfiguration.type_identifier2()._d()) + { + equiv_kind_anonymous_array_char_20 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_char_20 = 0; + PlainCollectionHeader header_anonymous_array_char_20 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_char_20, element_flags_anonymous_array_char_20); + std::string type_id_kind_anonymous_array_char_20("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_char_20 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(20)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_char_20, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_char_20)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_char_20")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_20 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(20)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_char_20, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_char_20)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_char_20")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_20 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_AdvancedConfiguration = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_char_20", type_ids_AdvancedConfiguration); + if (return_code_AdvancedConfiguration != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_20: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1()._d() || TK_NONE == type_ids_AdvancedConfiguration.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_AdvancedConfiguration.type_identifier1()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_AdvancedConfiguration.type_identifier1()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_AdvancedConfiguration.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_AdvancedConfiguration.type_identifier2()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_AdvancedConfiguration.type_identifier2()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_AdvancedConfiguration.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_AdvancedConfiguration.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_AdvancedConfiguration); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_AdvancedConfiguration, member_message); + } + { + return_code_AdvancedConfiguration = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint8_t_unbounded", type_ids_AdvancedConfiguration); + + if (return_code_AdvancedConfiguration != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_AdvancedConfiguration = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_AdvancedConfiguration); + + if (return_code_AdvancedConfiguration != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_sequence_uint8_t_unbounded {nullptr}; + if (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1()._d() || TK_NONE == type_ids_AdvancedConfiguration.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_AdvancedConfiguration.type_identifier1()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_AdvancedConfiguration.type_identifier1()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint8_t_unbounded = new TypeIdentifier(type_ids_AdvancedConfiguration.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_AdvancedConfiguration.type_identifier2()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_AdvancedConfiguration.type_identifier2()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_sequence_uint8_t_unbounded = new TypeIdentifier(type_ids_AdvancedConfiguration.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Sequence element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_sequence_uint8_t_unbounded = EK_COMPLETE; + if (TK_NONE == type_ids_AdvancedConfiguration.type_identifier2()._d()) + { + equiv_kind_anonymous_sequence_uint8_t_unbounded = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_sequence_uint8_t_unbounded = 0; + PlainCollectionHeader header_anonymous_sequence_uint8_t_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_sequence_uint8_t_unbounded, element_flags_anonymous_sequence_uint8_t_unbounded); + std::string type_id_kind_anonymous_sequence_uint8_t_unbounded("TI_PLAIN_SEQUENCE_SMALL"); + if (type_id_kind_anonymous_sequence_uint8_t_unbounded == "TI_PLAIN_SEQUENCE_SMALL") + { + SBound bound = 0; + PlainSequenceSElemDefn seq_sdefn = TypeObjectUtils::build_plain_sequence_s_elem_defn(header_anonymous_sequence_uint8_t_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint8_t_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_sequence_type_identifier(seq_sdefn, "anonymous_sequence_uint8_t_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBound bound = 0; + PlainSequenceLElemDefn seq_ldefn = TypeObjectUtils::build_plain_sequence_l_elem_defn(header_anonymous_sequence_uint8_t_unbounded, bound, + eprosima::fastcdr::external(element_identifier_anonymous_sequence_uint8_t_unbounded)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_sequence_type_identifier(seq_ldefn, "anonymous_sequence_uint8_t_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + return_code_AdvancedConfiguration = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_sequence_uint8_t_unbounded", type_ids_AdvancedConfiguration); + if (return_code_AdvancedConfiguration != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_sequence_uint8_t_unbounded: Given Sequence TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_data = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_data; + MemberId member_id_data = 0x00000002; + if (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1()._d() || TK_NONE == type_ids_AdvancedConfiguration.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_AdvancedConfiguration.type_identifier1()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_AdvancedConfiguration.type_identifier1()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_AdvancedConfiguration.type_identifier1()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_AdvancedConfiguration.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_AdvancedConfiguration.type_identifier2()._d() && + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_AdvancedConfiguration.type_identifier2()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_AdvancedConfiguration.type_identifier2()._d() && + (EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_AdvancedConfiguration.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_AdvancedConfiguration.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure data member TypeIdentifier inconsistent."); + return; + } + MemberName name_data = "data"; + eprosima::fastcdr::optional member_ann_builtin_data; + ann_custom_AdvancedConfiguration.reset(); + CompleteMemberDetail detail_data = TypeObjectUtils::build_complete_member_detail(name_data, member_ann_builtin_data, ann_custom_AdvancedConfiguration); + CompleteStructMember member_data = TypeObjectUtils::build_complete_struct_member(common_data, detail_data); + TypeObjectUtils::add_complete_struct_member(member_seq_AdvancedConfiguration, member_data); + } + CompleteStructType struct_type_AdvancedConfiguration = TypeObjectUtils::build_complete_struct_type(struct_flags_AdvancedConfiguration, header_AdvancedConfiguration, member_seq_AdvancedConfiguration); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_AdvancedConfiguration, type_name_AdvancedConfiguration.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "AdvancedConfiguration already registered in TypeObjectRegistry for a different type."); + } + return_code_AdvancedConfiguration = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "AdvancedConfiguration", type_ids_AdvancedConfiguration); + if (return_code_AdvancedConfiguration != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "AdvancedConfiguration: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationTypeObjectSupport.hpp b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationTypeObjectSupport.hpp new file mode 100644 index 00000000000..c863db7608d --- /dev/null +++ b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// 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 AdvancedConfigurationTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_ADVANCEDCONFIGURATION_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_ADVANCEDCONFIGURATION_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_AdvancedConfiguration_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register AdvancedConfiguration related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_AdvancedConfiguration_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_ADVANCEDCONFIGURATION_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationv1.cxx b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationv1.cxx deleted file mode 100644 index 2e28c5a0822..00000000000 --- a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationv1.cxx +++ /dev/null @@ -1,361 +0,0 @@ -// 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 AdvancedConfiguration.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "AdvancedConfiguration.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define AdvancedConfiguration_max_cdr_typesize 132ULL; - - - - - - -AdvancedConfiguration::AdvancedConfiguration() -{ - // unsigned long m_index - m_index = 0; - // char m_message - memset(&m_message, 0, ((20)) * 1); - // sequence m_data - - -} - -AdvancedConfiguration::~AdvancedConfiguration() -{ -} - -AdvancedConfiguration::AdvancedConfiguration( - const AdvancedConfiguration& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - - m_data = x.m_data; - -} - -AdvancedConfiguration::AdvancedConfiguration( - AdvancedConfiguration&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - - m_data = std::move(x.m_data); - -} - -AdvancedConfiguration& AdvancedConfiguration::operator =( - const AdvancedConfiguration& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - - m_data = x.m_data; - - return *this; -} - -AdvancedConfiguration& AdvancedConfiguration::operator =( - AdvancedConfiguration&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - - m_data = std::move(x.m_data); - - return *this; -} - -bool AdvancedConfiguration::operator ==( - const AdvancedConfiguration& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message && - m_data == x.m_data); -} - -bool AdvancedConfiguration::operator !=( - const AdvancedConfiguration& x) const -{ - return !(*this == x); -} - -size_t AdvancedConfiguration::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return AdvancedConfiguration_max_cdr_typesize; -} - -size_t AdvancedConfiguration::getCdrSerializedSize( - const AdvancedConfiguration& 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 += (((20)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.data().size() > 0) - { - current_alignment += (data.data().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - - return current_alignment - initial_alignment; -} - - -void AdvancedConfiguration::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_message; - - - scdr << m_data; - - -} - -void AdvancedConfiguration::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_message; - - - - dcdr >> m_data; - - -} - - -bool AdvancedConfiguration::isKeyDefined() -{ - return false; -} - -void AdvancedConfiguration::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void AdvancedConfiguration::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t AdvancedConfiguration::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& AdvancedConfiguration::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void AdvancedConfiguration::message( - const std::array& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void AdvancedConfiguration::message( - std::array&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::array& AdvancedConfiguration::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::array& AdvancedConfiguration::message() -{ - return m_message; -} - - -/*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ -void AdvancedConfiguration::data( - const std::vector& _data) -{ - m_data = _data; -} - -/*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ -void AdvancedConfiguration::data( - std::vector&& _data) -{ - m_data = std::move(_data); -} - -/*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ -const std::vector& AdvancedConfiguration::data() const -{ - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -std::vector& AdvancedConfiguration::data() -{ - return m_data; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationv1.h b/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationv1.h deleted file mode 100644 index e035dba4d0e..00000000000 --- a/examples/cpp/dds/AdvancedConfigurationExample/AdvancedConfigurationv1.h +++ /dev/null @@ -1,274 +0,0 @@ -// 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 AdvancedConfiguration.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_ADVANCEDCONFIGURATION_H_ -#define _FAST_DDS_GENERATED_ADVANCEDCONFIGURATION_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(ADVANCEDCONFIGURATION_SOURCE) -#define ADVANCEDCONFIGURATION_DllAPI __declspec( dllexport ) -#else -#define ADVANCEDCONFIGURATION_DllAPI __declspec( dllimport ) -#endif // ADVANCEDCONFIGURATION_SOURCE -#else -#define ADVANCEDCONFIGURATION_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define ADVANCEDCONFIGURATION_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - - - -/*! - * @brief This class represents the structure AdvancedConfiguration defined by the user in the IDL file. - * @ingroup AdvancedConfiguration - */ -class AdvancedConfiguration -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport AdvancedConfiguration(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~AdvancedConfiguration(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object AdvancedConfiguration that will be copied. - */ - eProsima_user_DllExport AdvancedConfiguration( - const AdvancedConfiguration& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object AdvancedConfiguration that will be copied. - */ - eProsima_user_DllExport AdvancedConfiguration( - AdvancedConfiguration&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object AdvancedConfiguration that will be copied. - */ - eProsima_user_DllExport AdvancedConfiguration& operator =( - const AdvancedConfiguration& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object AdvancedConfiguration that will be copied. - */ - eProsima_user_DllExport AdvancedConfiguration& operator =( - AdvancedConfiguration&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x AdvancedConfiguration object to compare. - */ - eProsima_user_DllExport bool operator ==( - const AdvancedConfiguration& x) const; - - /*! - * @brief Comparison operator. - * @param x AdvancedConfiguration object to compare. - */ - eProsima_user_DllExport bool operator !=( - const AdvancedConfiguration& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - 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 - */ - eProsima_user_DllExport void message( - const std::array& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::array&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::array& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::array& message(); - - - /*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ - eProsima_user_DllExport void data( - const std::vector& _data); - - /*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ - eProsima_user_DllExport void data( - std::vector&& _data); - - /*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ - eProsima_user_DllExport const std::vector& data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport std::vector& 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 AdvancedConfiguration& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint32_t m_index; - std::array m_message; - std::vector m_data; - -}; - - -#endif // _FAST_DDS_GENERATED_ADVANCEDCONFIGURATION_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/BasicConfigurationExample/BasicConfigurationSubscriber.cpp b/examples/cpp/dds/BasicConfigurationExample/BasicConfigurationSubscriber.cpp index 4c0f1b9dcc5..5f22068cab3 100644 --- a/examples/cpp/dds/BasicConfigurationExample/BasicConfigurationSubscriber.cpp +++ b/examples/cpp/dds/BasicConfigurationExample/BasicConfigurationSubscriber.cpp @@ -252,7 +252,7 @@ void HelloWorldSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - while ((reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) && !is_stopped()) + while ((reader->take_next_sample(&hello_, &info) == RETCODE_OK) && !is_stopped()) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorld.cxx b/examples/cpp/dds/BasicConfigurationExample/HelloWorld.cxx deleted file mode 100644 index 0d9236d0cee..00000000000 --- a/examples/cpp/dds/BasicConfigurationExample/HelloWorld.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// 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 HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -HelloWorld::HelloWorld() -{ -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -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 - */ -void HelloWorld::message( - const std::array& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::array&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::array& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::array& HelloWorld::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "HelloWorldCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorld.h b/examples/cpp/dds/BasicConfigurationExample/HelloWorld.hpp similarity index 70% rename from examples/cpp/dds/BasicConfigurationExample/HelloWorld.h rename to examples/cpp/dds/BasicConfigurationExample/HelloWorld.hpp index aaf09e4bc57..138a79db54c 100644 --- a/examples/cpp/dds/BasicConfigurationExample/HelloWorld.h +++ b/examples/cpp/dds/BasicConfigurationExample/HelloWorld.hpp @@ -13,32 +13,18 @@ // limitations under the License. /*! - * @file HelloWorld.h + * @file HelloWorld.hpp * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool fastddsgen. */ -#include -#include "HelloWorldv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_HPP_ #include -#include #include -#include -#include -#include - -#include -#include -#include - - +#include #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -64,17 +50,6 @@ #define HELLOWORLD_DllAPI #endif // _WIN32 -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 @@ -86,73 +61,117 @@ class HelloWorld /*! * @brief Default constructor. */ - eProsima_user_DllExport HelloWorld(); + eProsima_user_DllExport HelloWorld() + { + } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~HelloWorld(); + eProsima_user_DllExport ~HelloWorld() + { + } /*! * @brief Copy constructor. * @param x Reference to the object HelloWorld that will be copied. */ eProsima_user_DllExport HelloWorld( - const HelloWorld& x); + const HelloWorld& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } /*! * @brief Move constructor. * @param x Reference to the object HelloWorld that will be copied. */ eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; + HelloWorld&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } /*! * @brief Copy assignment. * @param x Reference to the object HelloWorld that will be copied. */ eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); + const HelloWorld& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } /*! * @brief Move assignment. * @param x Reference to the object HelloWorld that will be copied. */ eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; + HelloWorld&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } /*! * @brief Comparison operator. * @param x HelloWorld object to compare. */ eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; + const HelloWorld& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } /*! * @brief Comparison operator. * @param x HelloWorld object to compare. */ eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; + const HelloWorld& x) const + { + return !(*this == x); + } /*! * @brief This function sets a value in member index * @param _index New value for member index */ eProsima_user_DllExport void index( - uint32_t _index); + uint32_t _index) + { + m_index = _index; + } /*! * @brief This function returns the value of member index * @return Value of member index */ - eProsima_user_DllExport uint32_t index() const; + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } /*! * @brief This function returns a reference to member index * @return Reference to member index */ - eProsima_user_DllExport uint32_t& index(); + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } /*! @@ -160,26 +179,40 @@ class HelloWorld * @param _message New value to be copied in member message */ eProsima_user_DllExport void message( - const std::array& _message); + const std::array& _message) + { + m_message = _message; + } /*! * @brief This function moves the value in member message * @param _message New value to be moved in member message */ eProsima_user_DllExport void message( - std::array&& _message); + std::array&& _message) + { + m_message = std::move(_message); + } /*! * @brief This function returns a constant reference to member message * @return Constant reference to member message */ - eProsima_user_DllExport const std::array& message() const; + eProsima_user_DllExport const std::array& message() const + { + return m_message; + } /*! * @brief This function returns a reference to member message * @return Reference to member message */ - eProsima_user_DllExport std::array& message(); + eProsima_user_DllExport std::array& message() + { + return m_message; + } + + private: @@ -188,8 +221,6 @@ class HelloWorld }; -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - +#endif // _FAST_DDS_GENERATED_HELLOWORLD_HPP_ -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorldCdrAux.hpp b/examples/cpp/dds/BasicConfigurationExample/HelloWorldCdrAux.hpp index 5c8468e7cb1..de0e84c6ecd 100644 --- a/examples/cpp/dds/BasicConfigurationExample/HelloWorldCdrAux.hpp +++ b/examples/cpp/dds/BasicConfigurationExample/HelloWorldCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ #define _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ -#include "HelloWorld.h" +#include "HelloWorld.hpp" constexpr uint32_t HelloWorld_max_cdr_typesize {28UL}; constexpr uint32_t HelloWorld_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloWorld& data); diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorldCdrAux.ipp b/examples/cpp/dds/BasicConfigurationExample/HelloWorldCdrAux.ipp index 42e91f3cc38..97df3fe9d9e 100644 --- a/examples/cpp/dds/BasicConfigurationExample/HelloWorldCdrAux.ipp +++ b/examples/cpp/dds/BasicConfigurationExample/HelloWorldCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorldPubSubTypes.cxx b/examples/cpp/dds/BasicConfigurationExample/HelloWorldPubSubTypes.cxx index 85cb477896e..db018e69782 100644 --- a/examples/cpp/dds/BasicConfigurationExample/HelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/BasicConfigurationExample/HelloWorldPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "HelloWorldPubSubTypes.h" +#include #include -#include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" +#include "HelloWorldTypeObjectSupport.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"); @@ -219,3 +219,11 @@ bool HelloWorldPubSubType::getKey( return true; } +void HelloWorldPubSubType::register_type_object_representation() const +{ + register_HelloWorld_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "HelloWorldCdrAux.ipp" diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorldPubSubTypes.h b/examples/cpp/dds/BasicConfigurationExample/HelloWorldPubSubTypes.h index 44dc2c8493d..52736f6dad8 100644 --- a/examples/cpp/dds/BasicConfigurationExample/HelloWorldPubSubTypes.h +++ b/examples/cpp/dds/BasicConfigurationExample/HelloWorldPubSubTypes.h @@ -29,7 +29,7 @@ #include #include -#include "HelloWorld.h" +#include "HelloWorld.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -90,6 +88,9 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorldTypeObjectSupport.cxx b/examples/cpp/dds/BasicConfigurationExample/HelloWorldTypeObjectSupport.cxx new file mode 100644 index 00000000000..8c30e9795fe --- /dev/null +++ b/examples/cpp/dds/BasicConfigurationExample/HelloWorldTypeObjectSupport.cxx @@ -0,0 +1,306 @@ +// 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 HelloWorldTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "HelloWorldTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "HelloWorld.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_HelloWorld_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_HelloWorld_type_identifier(); + + }); +} + +void register_HelloWorld_type_identifier() +{ + { + StructTypeFlag struct_flags_HelloWorld = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_HelloWorld; + TypeIdentifierPair type_ids_HelloWorld; + QualifiedTypeName type_name_HelloWorld = "HelloWorld"; + eprosima::fastcdr::optional type_ann_builtin_HelloWorld; + eprosima::fastcdr::optional ann_custom_HelloWorld; + CompleteTypeDetail detail_HelloWorld = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_HelloWorld, ann_custom_HelloWorld, type_name_HelloWorld.to_string()); + CompleteStructHeader header_HelloWorld; + header_HelloWorld = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_HelloWorld); + CompleteStructMemberSeq member_seq_HelloWorld; + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_HelloWorld); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_index); + } + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_char_20", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_char", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_char_20 {nullptr}; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_char_20 = new TypeIdentifier(type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_char_20 = new TypeIdentifier(type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_char_20 = EK_COMPLETE; + if (TK_NONE == type_ids_HelloWorld.type_identifier2()._d()) + { + equiv_kind_anonymous_array_char_20 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_char_20 = 0; + PlainCollectionHeader header_anonymous_array_char_20 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_char_20, element_flags_anonymous_array_char_20); + std::string type_id_kind_anonymous_array_char_20("TI_PLAIN_ARRAY_SMALL"); + if (type_id_kind_anonymous_array_char_20 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(20)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_char_20, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_char_20)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_char_20")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_20 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(20)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_char_20, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_char_20)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_char_20")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_20 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_char_20", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_20: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_HelloWorld); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_message); + } + CompleteStructType struct_type_HelloWorld = TypeObjectUtils::build_complete_struct_type(struct_flags_HelloWorld, header_HelloWorld, member_seq_HelloWorld); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_HelloWorld, type_name_HelloWorld.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld already registered in TypeObjectRegistry for a different type."); + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "HelloWorld", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorldTypeObjectSupport.hpp b/examples/cpp/dds/BasicConfigurationExample/HelloWorldTypeObjectSupport.hpp new file mode 100644 index 00000000000..8650fc061e0 --- /dev/null +++ b/examples/cpp/dds/BasicConfigurationExample/HelloWorldTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// 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 HelloWorldTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_HelloWorld_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register HelloWorld related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_HelloWorld_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorldv1.cxx b/examples/cpp/dds/BasicConfigurationExample/HelloWorldv1.cxx deleted file mode 100644 index 3b9a562b692..00000000000 --- a/examples/cpp/dds/BasicConfigurationExample/HelloWorldv1.cxx +++ /dev/null @@ -1,288 +0,0 @@ -// 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 HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define HelloWorld_max_cdr_typesize 28ULL; - - - - -HelloWorld::HelloWorld() -{ - // unsigned long m_index - m_index = 0; - // char m_message - memset(&m_message, 0, ((20)) * 1); - -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - 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 += (((20)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - - -void HelloWorld::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_message; - - -} - -void HelloWorld::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_message; - - -} - - -bool HelloWorld::isKeyDefined() -{ - return false; -} - -void HelloWorld::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -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 - */ -void HelloWorld::message( - const std::array& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::array&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::array& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::array& HelloWorld::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/BasicConfigurationExample/HelloWorldv1.h b/examples/cpp/dds/BasicConfigurationExample/HelloWorldv1.h deleted file mode 100644 index 3478b4e49a8..00000000000 --- a/examples/cpp/dds/BasicConfigurationExample/HelloWorldv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// 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 HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloWorld defined by the user in the IDL file. - * @ingroup HelloWorld - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - 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 - */ - eProsima_user_DllExport void message( - const std::array& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::array&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::array& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::array& 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 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; - std::array m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/CMakeLists.txt b/examples/cpp/dds/CMakeLists.txt index 421eb164dcb..0ade7a00048 100644 --- a/examples/cpp/dds/CMakeLists.txt +++ b/examples/cpp/dds/CMakeLists.txt @@ -39,7 +39,6 @@ add_subdirectory(SampleConfig_Controller) add_subdirectory(SampleConfig_Events) add_subdirectory(SampleConfig_Multimedia) add_subdirectory(StaticHelloWorldExample) -add_subdirectory(TypeLookupService) add_subdirectory(WriterLoansExample) add_subdirectory(ZeroCopyExample) diff --git a/examples/cpp/dds/Configurability/ConfigurabilitySubscriber.cpp b/examples/cpp/dds/Configurability/ConfigurabilitySubscriber.cpp index e00ad10e226..4094a972244 100644 --- a/examples/cpp/dds/Configurability/ConfigurabilitySubscriber.cpp +++ b/examples/cpp/dds/Configurability/ConfigurabilitySubscriber.cpp @@ -363,7 +363,7 @@ int main() } else if ( c == std::string("r")) { - while (EarlyReader->read_next_sample(&my_sample, &sample_info) == ReturnCode_t::RETCODE_OK) + while (EarlyReader->read_next_sample(&my_sample, &sample_info) == RETCODE_OK) { std::cout << "Sample Received! Index:" << std::to_string(my_sample.index()) << " Key:" << std::to_string(my_sample.key_value()) << std::endl; diff --git a/examples/cpp/dds/Configurability/sample.cxx b/examples/cpp/dds/Configurability/sample.cxx deleted file mode 100644 index 360d4a1b2b2..00000000000 --- a/examples/cpp/dds/Configurability/sample.cxx +++ /dev/null @@ -1,158 +0,0 @@ -// 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 sample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "sample.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -sample::sample() -{ -} - -sample::~sample() -{ -} - -sample::sample( - const sample& x) -{ - m_index = x.m_index; - m_key_value = x.m_key_value; -} - -sample::sample( - sample&& x) noexcept -{ - m_index = x.m_index; - m_key_value = x.m_key_value; -} - -sample& sample::operator =( - const sample& x) -{ - - m_index = x.m_index; - m_key_value = x.m_key_value; - return *this; -} - -sample& sample::operator =( - sample&& x) noexcept -{ - - m_index = x.m_index; - m_key_value = x.m_key_value; - return *this; -} - -bool sample::operator ==( - const sample& x) const -{ - return (m_index == x.m_index && - m_key_value == x.m_key_value); -} - -bool sample::operator !=( - const sample& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void sample::index( - uint8_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint8_t sample::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint8_t& sample::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ -void sample::key_value( - uint8_t _key_value) -{ - m_key_value = _key_value; -} - -/*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ -uint8_t sample::key_value() const -{ - return m_key_value; -} - -/*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ -uint8_t& sample::key_value() -{ - return m_key_value; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "sampleCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/Keys/sample.h b/examples/cpp/dds/Configurability/sample.hpp similarity index 69% rename from examples/cpp/dds/Keys/sample.h rename to examples/cpp/dds/Configurability/sample.hpp index c050c8527cc..3023a792269 100644 --- a/examples/cpp/dds/Keys/sample.h +++ b/examples/cpp/dds/Configurability/sample.hpp @@ -13,32 +13,17 @@ // limitations under the License. /*! - * @file sample.h + * @file sample.hpp * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool fastddsgen. */ -#include -#include "samplev1.h" +#ifndef _FAST_DDS_GENERATED_SAMPLE_HPP_ +#define _FAST_DDS_GENERATED_SAMPLE_HPP_ -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ -#define _FAST_DDS_GENERATED_SAMPLE_H_ - -#include -#include #include -#include -#include -#include - -#include -#include -#include - - +#include #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -64,17 +49,6 @@ #define SAMPLE_DllAPI #endif // _WIN32 -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - /*! * @brief This class represents the structure sample defined by the user in the IDL file. * @ingroup sample @@ -86,73 +60,117 @@ class sample /*! * @brief Default constructor. */ - eProsima_user_DllExport sample(); + eProsima_user_DllExport sample() + { + } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~sample(); + eProsima_user_DllExport ~sample() + { + } /*! * @brief Copy constructor. * @param x Reference to the object sample that will be copied. */ eProsima_user_DllExport sample( - const sample& x); + const sample& x) + { + m_index = x.m_index; + + m_key_value = x.m_key_value; + + } /*! * @brief Move constructor. * @param x Reference to the object sample that will be copied. */ eProsima_user_DllExport sample( - sample&& x) noexcept; + sample&& x) noexcept + { + m_index = x.m_index; + m_key_value = x.m_key_value; + } /*! * @brief Copy assignment. * @param x Reference to the object sample that will be copied. */ eProsima_user_DllExport sample& operator =( - const sample& x); + const sample& x) + { + + m_index = x.m_index; + + m_key_value = x.m_key_value; + + return *this; + } /*! * @brief Move assignment. * @param x Reference to the object sample that will be copied. */ eProsima_user_DllExport sample& operator =( - sample&& x) noexcept; + sample&& x) noexcept + { + + m_index = x.m_index; + m_key_value = x.m_key_value; + return *this; + } /*! * @brief Comparison operator. * @param x sample object to compare. */ eProsima_user_DllExport bool operator ==( - const sample& x) const; + const sample& x) const + { + return (m_index == x.m_index && + m_key_value == x.m_key_value); + } /*! * @brief Comparison operator. * @param x sample object to compare. */ eProsima_user_DllExport bool operator !=( - const sample& x) const; + const sample& x) const + { + return !(*this == x); + } /*! * @brief This function sets a value in member index * @param _index New value for member index */ eProsima_user_DllExport void index( - uint8_t _index); + uint8_t _index) + { + m_index = _index; + } /*! * @brief This function returns the value of member index * @return Value of member index */ - eProsima_user_DllExport uint8_t index() const; + eProsima_user_DllExport uint8_t index() const + { + return m_index; + } /*! * @brief This function returns a reference to member index * @return Reference to member index */ - eProsima_user_DllExport uint8_t& index(); + eProsima_user_DllExport uint8_t& index() + { + return m_index; + } /*! @@ -160,19 +178,30 @@ class sample * @param _key_value New value for member key_value */ eProsima_user_DllExport void key_value( - uint8_t _key_value); + uint8_t _key_value) + { + m_key_value = _key_value; + } /*! * @brief This function returns the value of member key_value * @return Value of member key_value */ - eProsima_user_DllExport uint8_t key_value() const; + eProsima_user_DllExport uint8_t key_value() const + { + return m_key_value; + } /*! * @brief This function returns a reference to member key_value * @return Reference to member key_value */ - eProsima_user_DllExport uint8_t& key_value(); + eProsima_user_DllExport uint8_t& key_value() + { + return m_key_value; + } + + private: @@ -181,8 +210,6 @@ class sample }; -#endif // _FAST_DDS_GENERATED_SAMPLE_H_ - +#endif // _FAST_DDS_GENERATED_SAMPLE_HPP_ -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/Configurability/sampleCdrAux.hpp b/examples/cpp/dds/Configurability/sampleCdrAux.hpp index 18ed5857add..b80dff31248 100644 --- a/examples/cpp/dds/Configurability/sampleCdrAux.hpp +++ b/examples/cpp/dds/Configurability/sampleCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ #define _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ -#include "sample.h" +#include "sample.hpp" constexpr uint32_t sample_max_cdr_typesize {6UL}; constexpr uint32_t sample_max_key_cdr_typesize {1UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const sample& data); diff --git a/examples/cpp/dds/Configurability/sampleCdrAux.ipp b/examples/cpp/dds/Configurability/sampleCdrAux.ipp index 11bc4709a6e..17a3d1025fc 100644 --- a/examples/cpp/dds/Configurability/sampleCdrAux.ipp +++ b/examples/cpp/dds/Configurability/sampleCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/Configurability/samplePubSubTypes.cxx b/examples/cpp/dds/Configurability/samplePubSubTypes.cxx index 9095d77083a..cae143a08ca 100644 --- a/examples/cpp/dds/Configurability/samplePubSubTypes.cxx +++ b/examples/cpp/dds/Configurability/samplePubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "samplePubSubTypes.h" +#include #include -#include "samplePubSubTypes.h" #include "sampleCdrAux.hpp" +#include "sampleTypeObjectSupport.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; - - samplePubSubType::samplePubSubType() { setName("sample"); @@ -219,3 +219,11 @@ bool samplePubSubType::getKey( return true; } +void samplePubSubType::register_type_object_representation() const +{ + register_sample_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "sampleCdrAux.ipp" diff --git a/examples/cpp/dds/Configurability/samplePubSubTypes.h b/examples/cpp/dds/Configurability/samplePubSubTypes.h index 6022f1e76b7..9e59aa58042 100644 --- a/examples/cpp/dds/Configurability/samplePubSubTypes.h +++ b/examples/cpp/dds/Configurability/samplePubSubTypes.h @@ -29,7 +29,7 @@ #include #include -#include "sample.h" +#include "sample.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type sample defined by the user in the IDL file. * @ingroup sample @@ -90,6 +88,9 @@ class samplePubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/Configurability/sampleTypeObjectSupport.cxx b/examples/cpp/dds/Configurability/sampleTypeObjectSupport.cxx new file mode 100644 index 00000000000..3719bbf77e6 --- /dev/null +++ b/examples/cpp/dds/Configurability/sampleTypeObjectSupport.cxx @@ -0,0 +1,224 @@ +// 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 sampleTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "sampleTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "sample.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_sample_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_sample_type_identifier(); + + }); +} + +void register_sample_type_identifier() +{ + { + StructTypeFlag struct_flags_sample = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_sample; + TypeIdentifierPair type_ids_sample; + QualifiedTypeName type_name_sample = "sample"; + eprosima::fastcdr::optional type_ann_builtin_sample; + eprosima::fastcdr::optional ann_custom_sample; + CompleteTypeDetail detail_sample = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_sample, ann_custom_sample, type_name_sample.to_string()); + CompleteStructHeader header_sample; + header_sample = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_sample); + CompleteStructMemberSeq member_seq_sample; + { + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_sample); + + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_sample.type_identifier1()._d() || TK_NONE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_sample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_sample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_sample.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_sample); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_sample, member_index); + } + { + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_sample); + + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "key_value Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_key_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_key_value; + MemberId member_id_key_value = 0x00000001; + if (EK_COMPLETE == type_ids_sample.type_identifier1()._d() || TK_NONE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_key_value = TypeObjectUtils::build_common_struct_member(member_id_key_value, member_flags_key_value, type_ids_sample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_key_value = TypeObjectUtils::build_common_struct_member(member_id_key_value, member_flags_key_value, type_ids_sample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure key_value member TypeIdentifier inconsistent."); + return; + } + MemberName name_key_value = "key_value"; + eprosima::fastcdr::optional member_ann_builtin_key_value; + ann_custom_sample.reset(); + AppliedAnnotationSeq tmp_ann_custom_key_value; + eprosima::fastcdr::optional unit_key_value; + eprosima::fastcdr::optional min_key_value; + eprosima::fastcdr::optional max_key_value; + eprosima::fastcdr::optional hash_id_key_value; + if (unit_key_value.has_value() || min_key_value.has_value() || max_key_value.has_value() || hash_id_key_value.has_value()) + { + member_ann_builtin_key_value = TypeObjectUtils::build_applied_builtin_member_annotations(unit_key_value, min_key_value, max_key_value, hash_id_key_value); + } + if (!tmp_ann_custom_key_value.empty()) + { + ann_custom_sample = tmp_ann_custom_key_value; + } + CompleteMemberDetail detail_key_value = TypeObjectUtils::build_complete_member_detail(name_key_value, member_ann_builtin_key_value, ann_custom_sample); + CompleteStructMember member_key_value = TypeObjectUtils::build_complete_struct_member(common_key_value, detail_key_value); + TypeObjectUtils::add_complete_struct_member(member_seq_sample, member_key_value); + } + CompleteStructType struct_type_sample = TypeObjectUtils::build_complete_struct_type(struct_flags_sample, header_sample, member_seq_sample); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_sample, type_name_sample.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "sample already registered in TypeObjectRegistry for a different type."); + } + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "sample", type_ids_sample); + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "sample: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/Configurability/sampleTypeObjectSupport.hpp b/examples/cpp/dds/Configurability/sampleTypeObjectSupport.hpp new file mode 100644 index 00000000000..5ad7f2e5e07 --- /dev/null +++ b/examples/cpp/dds/Configurability/sampleTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// 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 sampleTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_sample_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register sample related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_sample_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/Configurability/samplev1.cxx b/examples/cpp/dds/Configurability/samplev1.cxx deleted file mode 100644 index 3b735befaf8..00000000000 --- a/examples/cpp/dds/Configurability/samplev1.cxx +++ /dev/null @@ -1,280 +0,0 @@ -// 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 sample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "sample.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define sample_max_cdr_typesize 6ULL; - - - - -sample::sample() -{ - // octet m_index - m_index = 0; - // octet m_key_value - m_key_value = 0; - -} - -sample::~sample() -{ -} - -sample::sample( - const sample& x) -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - -} - -sample::sample( - sample&& x) noexcept -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - -} - -sample& sample::operator =( - const sample& x) -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - - return *this; -} - -sample& sample::operator =( - sample&& x) noexcept -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - - return *this; -} - -bool sample::operator ==( - const sample& x) const -{ - return (m_index == x.m_index && - m_key_value == x.m_key_value); -} - -bool sample::operator !=( - const sample& x) const -{ - return !(*this == x); -} - -size_t sample::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return sample_max_cdr_typesize; -} - -size_t sample::getCdrSerializedSize( - const sample& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - - -void sample::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_key_value; - -} - -void sample::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_key_value; - - -} - - -bool sample::isKeyDefined() -{ - return true; -} - -void sample::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - - - scdr << m_key_value; - -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void sample::index( - uint8_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint8_t sample::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint8_t& sample::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ -void sample::key_value( - uint8_t _key_value) -{ - m_key_value = _key_value; -} - -/*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ -uint8_t sample::key_value() const -{ - return m_key_value; -} - -/*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ -uint8_t& sample::key_value() -{ - return m_key_value; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/Configurability/samplev1.h b/examples/cpp/dds/Configurability/samplev1.h deleted file mode 100644 index 6aa21a41e80..00000000000 --- a/examples/cpp/dds/Configurability/samplev1.h +++ /dev/null @@ -1,237 +0,0 @@ -// 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 sample.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ -#define _FAST_DDS_GENERATED_SAMPLE_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SAMPLE_SOURCE) -#define SAMPLE_DllAPI __declspec( dllexport ) -#else -#define SAMPLE_DllAPI __declspec( dllimport ) -#endif // SAMPLE_SOURCE -#else -#define SAMPLE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define SAMPLE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure sample defined by the user in the IDL file. - * @ingroup sample - */ -class sample -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport sample(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~sample(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - const sample& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - sample&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - const sample& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - sample&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator ==( - const sample& x) const; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator !=( - const sample& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint8_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint8_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint8_t& index(); - - - /*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ - eProsima_user_DllExport void key_value( - uint8_t _key_value); - - /*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ - eProsima_user_DllExport uint8_t key_value() const; - - /*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ - eProsima_user_DllExport uint8_t& key_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 sample& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint8_t m_index; - uint8_t m_key_value; - -}; - - -#endif // _FAST_DDS_GENERATED_SAMPLE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/ContentFilteredTopicExample/CMakeLists.txt b/examples/cpp/dds/ContentFilteredTopicExample/CMakeLists.txt index c245ed3d8fb..0eb3d11b4fc 100644 --- a/examples/cpp/dds/ContentFilteredTopicExample/CMakeLists.txt +++ b/examples/cpp/dds/ContentFilteredTopicExample/CMakeLists.txt @@ -31,10 +31,8 @@ set(CFT_COMMON_SOURCES ContentFilteredTopicExample_main.cpp ContentFilteredTopicExamplePublisher.cpp ContentFilteredTopicExampleSubscriber.cpp - HelloWorld.cxx - HelloWorldv1.cxx HelloWorldPubSubTypes.cxx - HelloWorldTypeObject.cxx + HelloWorldTypeObjectSupport.cxx ) add_executable(DDSContentFilteredTopicExample ${CFT_COMMON_SOURCES}) diff --git a/examples/cpp/dds/ContentFilteredTopicExample/ContentFilteredTopicExamplePublisher.cpp b/examples/cpp/dds/ContentFilteredTopicExample/ContentFilteredTopicExamplePublisher.cpp index f1419c701e7..77e35423bce 100644 --- a/examples/cpp/dds/ContentFilteredTopicExample/ContentFilteredTopicExamplePublisher.cpp +++ b/examples/cpp/dds/ContentFilteredTopicExample/ContentFilteredTopicExamplePublisher.cpp @@ -29,16 +29,12 @@ #include #include -#include "HelloWorldTypeObject.h" +#include "HelloWorldTypeObjectSupport.hpp" using namespace eprosima::fastdds::dds; bool ContentFilteredTopicExamplePublisher::init() { - // The default filter class requires the TypeObject to be registered - // (see https://fast-dds.docs.eprosima.com/en/latest/fastdds/dds_layer/topic/contentFilteredTopic/createContentFilteredTopic.html) - registerHelloWorldTypes(); - // Initialize internal variables matched_ = 0; diff --git a/examples/cpp/dds/ContentFilteredTopicExample/ContentFilteredTopicExampleSubscriber.cpp b/examples/cpp/dds/ContentFilteredTopicExample/ContentFilteredTopicExampleSubscriber.cpp index 1a91342c43c..b116074dfe4 100644 --- a/examples/cpp/dds/ContentFilteredTopicExample/ContentFilteredTopicExampleSubscriber.cpp +++ b/examples/cpp/dds/ContentFilteredTopicExample/ContentFilteredTopicExampleSubscriber.cpp @@ -27,17 +27,13 @@ #include #include -#include "HelloWorldTypeObject.h" +#include "HelloWorldTypeObjectSupport.hpp" using namespace eprosima::fastdds::dds; bool ContentFilteredTopicExampleSubscriber::init( bool custom_filter) { - // The default filter class requires the TypeObject to be registered - // (see https://fast-dds.docs.eprosima.com/en/latest/fastdds/dds_layer/topic/contentFilteredTopic/createContentFilteredTopic.html) - registerHelloWorldTypes(); - // Initialize internal variables matched_ = 0; @@ -55,7 +51,7 @@ bool ContentFilteredTopicExampleSubscriber::init( if (custom_filter) { // Register the filter factory - if (ReturnCode_t::RETCODE_OK != + if (eprosima::fastdds::dds::RETCODE_OK != participant_->register_content_filter_factory("MY_CUSTOM_FILTER", &filter_factory)) { return false; @@ -159,7 +155,7 @@ void ContentFilteredTopicExampleSubscriber::on_data_available( { SampleInfo info; // Take next sample from DataReader's history - if (ReturnCode_t::RETCODE_OK == reader->take_next_sample(&hello_, &info)) + if (eprosima::fastdds::dds::RETCODE_OK == reader->take_next_sample(&hello_, &info)) { // Some samples only update the instance state. Only if it is a valid sample (with data) if (ALIVE_INSTANCE_STATE == info.instance_state) diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.cxx b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.cxx deleted file mode 100644 index 502f3953b05..00000000000 --- a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.cxx +++ /dev/null @@ -1,172 +0,0 @@ -// 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 HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include "HelloWorldTypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -HelloWorld::HelloWorld() -{ - // Just to register all known types - registerHelloWorldTypes(); -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -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 - */ -void HelloWorld::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& HelloWorld::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "HelloWorldCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.h b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.hpp similarity index 69% rename from examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.h rename to examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.hpp index 5cd0ddba511..971fea8d920 100644 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.h +++ b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.hpp @@ -13,32 +13,19 @@ // limitations under the License. /*! - * @file HelloWorld.h + * @file HelloWorld.hpp * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool fastddsgen. */ -#include -#include "HelloWorldv1.h" +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_HPP_ -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - -#include -#include #include -#include #include -#include - +#include #include -#include -#include - - #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -64,17 +51,6 @@ #define HELLOWORLD_DllAPI #endif // _WIN32 -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 @@ -86,73 +62,117 @@ class HelloWorld /*! * @brief Default constructor. */ - eProsima_user_DllExport HelloWorld(); + eProsima_user_DllExport HelloWorld() + { + } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~HelloWorld(); + eProsima_user_DllExport ~HelloWorld() + { + } /*! * @brief Copy constructor. * @param x Reference to the object HelloWorld that will be copied. */ eProsima_user_DllExport HelloWorld( - const HelloWorld& x); + const HelloWorld& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } /*! * @brief Move constructor. * @param x Reference to the object HelloWorld that will be copied. */ eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; + HelloWorld&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } /*! * @brief Copy assignment. * @param x Reference to the object HelloWorld that will be copied. */ eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); + const HelloWorld& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } /*! * @brief Move assignment. * @param x Reference to the object HelloWorld that will be copied. */ eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; + HelloWorld&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } /*! * @brief Comparison operator. * @param x HelloWorld object to compare. */ eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; + const HelloWorld& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } /*! * @brief Comparison operator. * @param x HelloWorld object to compare. */ eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; + const HelloWorld& x) const + { + return !(*this == x); + } /*! * @brief This function sets a value in member index * @param _index New value for member index */ eProsima_user_DllExport void index( - uint32_t _index); + uint32_t _index) + { + m_index = _index; + } /*! * @brief This function returns the value of member index * @return Value of member index */ - eProsima_user_DllExport uint32_t index() const; + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } /*! * @brief This function returns a reference to member index * @return Reference to member index */ - eProsima_user_DllExport uint32_t& index(); + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } /*! @@ -160,26 +180,40 @@ class HelloWorld * @param _message New value to be copied in member message */ eProsima_user_DllExport void message( - const std::string& _message); + const std::string& _message) + { + m_message = _message; + } /*! * @brief This function moves the value in member message * @param _message New value to be moved in member message */ eProsima_user_DllExport void message( - std::string&& _message); + std::string&& _message) + { + m_message = std::move(_message); + } /*! * @brief This function returns a constant reference to member message * @return Constant reference to member message */ - eProsima_user_DllExport const std::string& message() const; + eProsima_user_DllExport const std::string& message() const + { + return m_message; + } /*! * @brief This function returns a reference to member message * @return Reference to member message */ - eProsima_user_DllExport std::string& message(); + eProsima_user_DllExport std::string& message() + { + return m_message; + } + + private: @@ -188,8 +222,6 @@ class HelloWorld }; -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - +#endif // _FAST_DDS_GENERATED_HELLOWORLD_HPP_ -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldCdrAux.hpp b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldCdrAux.hpp index 9f346d306be..6feb8a9da15 100644 --- a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldCdrAux.hpp +++ b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ #define _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ -#include "HelloWorld.h" +#include "HelloWorld.hpp" constexpr uint32_t HelloWorld_max_cdr_typesize {268UL}; constexpr uint32_t HelloWorld_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloWorld& data); diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldCdrAux.ipp b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldCdrAux.ipp index 42e91f3cc38..97df3fe9d9e 100644 --- a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldCdrAux.ipp +++ b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldPubSubTypes.cxx b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldPubSubTypes.cxx index 85cb477896e..db018e69782 100644 --- a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "HelloWorldPubSubTypes.h" +#include #include -#include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" +#include "HelloWorldTypeObjectSupport.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"); @@ -219,3 +219,11 @@ bool HelloWorldPubSubType::getKey( return true; } +void HelloWorldPubSubType::register_type_object_representation() const +{ + register_HelloWorld_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "HelloWorldCdrAux.ipp" diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldPubSubTypes.h b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldPubSubTypes.h index 545c68b12b2..a9b4ac119e0 100644 --- a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldPubSubTypes.h +++ b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldPubSubTypes.h @@ -29,7 +29,7 @@ #include #include -#include "HelloWorld.h" +#include "HelloWorld.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -90,6 +88,9 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObject.cxx b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObject.cxx deleted file mode 100644 index da3e0720b2e..00000000000 --- a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObject.cxx +++ /dev/null @@ -1,265 +0,0 @@ -// 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 HelloWorldTypeObject.cpp - * This source file contains the definition of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { char dummy; } -#endif - -#include "HelloWorld.h" -#include "HelloWorldTypeObject.h" - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -using namespace eprosima::fastrtps::rtps; - -void registerHelloWorldTypes() -{ - static std::once_flag once_flag; - std::call_once(once_flag, []() - { - TypeObjectFactory *factory = TypeObjectFactory::get_instance(); - factory->add_type_object("HelloWorld", GetHelloWorldIdentifier(true), - GetHelloWorldObject(true)); - factory->add_type_object("HelloWorld", GetHelloWorldIdentifier(false), - GetHelloWorldObject(false)); - - }); -} - - - -const TypeIdentifier* GetHelloWorldIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("HelloWorld", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetHelloWorldObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("HelloWorld", complete); -} - -const TypeObject* GetHelloWorldObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("HelloWorld", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteHelloWorldObject(); - } - //else - return GetMinimalHelloWorldObject(); -} - -const TypeObject* GetMinimalHelloWorldObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("HelloWorld", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_index; - mst_index.common().member_id(memberId++); - mst_index.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_index.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_index.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_index.common().member_flags().IS_OPTIONAL(false); - mst_index.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_index.common().member_flags().IS_KEY(false); - mst_index.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_index.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint32_t", false)); - - - MD5 index_hash("index"); - for(int i = 0; i < 4; ++i) - { - mst_index.detail().name_hash()[i] = index_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_index); - - MinimalStructMember mst_message; - mst_message.common().member_id(memberId++); - mst_message.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_message.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_message.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_message.common().member_flags().IS_OPTIONAL(false); - mst_message.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_message.common().member_flags().IS_KEY(false); - mst_message.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_message.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 message_hash("message"); - for(int i = 0; i < 4; ++i) - { - mst_message.detail().name_hash()[i] = message_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_message); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("HelloWorld", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("HelloWorld", false); -} - -const TypeObject* GetCompleteHelloWorldObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("HelloWorld", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_index; - cst_index.common().member_id(memberId++); - cst_index.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_index.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_index.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_index.common().member_flags().IS_OPTIONAL(false); - cst_index.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_index.common().member_flags().IS_KEY(false); - cst_index.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_index.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint32_t", false)); - - - cst_index.detail().name("index"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_index); - - CompleteStructMember cst_message; - cst_message.common().member_id(memberId++); - cst_message.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_message.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_message.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_message.common().member_flags().IS_OPTIONAL(false); - cst_message.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_message.common().member_flags().IS_KEY(false); - cst_message.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_message.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_message.detail().name("message"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_message); - - - // Header - type_object->complete().struct_type().header().detail().type_name("HelloWorld"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("HelloWorld", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("HelloWorld", true); -} diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObject.h b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObject.h deleted file mode 100644 index 76b2a621eb7..00000000000 --- a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObject.h +++ /dev/null @@ -1,65 +0,0 @@ -// 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 HelloWorldTypeObject.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_H_ - - -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif -#else -#define eProsima_user_DllExport -#endif - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HelloWorld_SOURCE) -#define HelloWorld_DllAPI __declspec( dllexport ) -#else -#define HelloWorld_DllAPI __declspec( dllimport ) -#endif // HelloWorld_SOURCE -#else -#define HelloWorld_DllAPI -#endif -#else -#define HelloWorld_DllAPI -#endif // _WIN32 - -using namespace eprosima::fastrtps::types; - -eProsima_user_DllExport void registerHelloWorldTypes(); - - - -eProsima_user_DllExport const TypeIdentifier* GetHelloWorldIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetHelloWorldObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalHelloWorldObject(); -eProsima_user_DllExport const TypeObject* GetCompleteHelloWorldObject(); - - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_H_ \ No newline at end of file diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObjectSupport.cxx b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObjectSupport.cxx new file mode 100644 index 00000000000..bfae95694f4 --- /dev/null +++ b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObjectSupport.cxx @@ -0,0 +1,248 @@ +// 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 HelloWorldTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "HelloWorldTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "HelloWorld.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_HelloWorld_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_HelloWorld_type_identifier(); + + }); +} + +void register_HelloWorld_type_identifier() +{ + { + StructTypeFlag struct_flags_HelloWorld = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_HelloWorld; + TypeIdentifierPair type_ids_HelloWorld; + QualifiedTypeName type_name_HelloWorld = "HelloWorld"; + eprosima::fastcdr::optional type_ann_builtin_HelloWorld; + eprosima::fastcdr::optional ann_custom_HelloWorld; + CompleteTypeDetail detail_HelloWorld = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_HelloWorld, ann_custom_HelloWorld, type_name_HelloWorld.to_string()); + CompleteStructHeader header_HelloWorld; + header_HelloWorld = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_HelloWorld); + CompleteStructMemberSeq member_seq_HelloWorld; + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_HelloWorld); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_index); + } + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_HelloWorld); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_message); + } + CompleteStructType struct_type_HelloWorld = TypeObjectUtils::build_complete_struct_type(struct_flags_HelloWorld, header_HelloWorld, member_seq_HelloWorld); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_HelloWorld, type_name_HelloWorld.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld already registered in TypeObjectRegistry for a different type."); + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "HelloWorld", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObjectSupport.hpp b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObjectSupport.hpp new file mode 100644 index 00000000000..8650fc061e0 --- /dev/null +++ b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// 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 HelloWorldTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_HelloWorld_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register HelloWorld related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_HelloWorld_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldv1.cxx b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldv1.cxx deleted file mode 100644 index bb049241e49..00000000000 --- a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldv1.cxx +++ /dev/null @@ -1,290 +0,0 @@ -// 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 HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include "HelloWorldTypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define HelloWorld_max_cdr_typesize 268ULL; - - - - -HelloWorld::HelloWorld() -{ - // unsigned long m_index - m_index = 0; - // /type_d() m_message - - - // Just to register all known types - registerHelloWorldTypes(); -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - 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; - - -} - - -bool HelloWorld::isKeyDefined() -{ - return false; -} - -void HelloWorld::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -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 - */ -void HelloWorld::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& HelloWorld::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldv1.h b/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldv1.h deleted file mode 100644 index 8c7406a074a..00000000000 --- a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorldv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// 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 HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloWorld defined by the user in the IDL file. - * @ingroup HelloWorld - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - 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 - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - 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 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; - std::string m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/ContentFilteredTopicExample/MyCustomFilterFactory.hpp b/examples/cpp/dds/ContentFilteredTopicExample/MyCustomFilterFactory.hpp index deb86feca93..606a37d3226 100644 --- a/examples/cpp/dds/ContentFilteredTopicExample/MyCustomFilterFactory.hpp +++ b/examples/cpp/dds/ContentFilteredTopicExample/MyCustomFilterFactory.hpp @@ -22,11 +22,11 @@ class MyCustomFilterFactory : public eprosima::fastdds::dds::IContentFilterFacto * @param filter_parameters Parameters required by the filter * @param filter_instance Instance of the filter to be evaluated * - * @return eprosima::fastrtps::types::ReturnCode_t::RETCODE_BAD_PARAMETER if the requirements for creating the + * @return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER if the requirements for creating the * ContentFilteredTopic using this factory are not met - * eprosima::fastrtps::types::ReturnCode_t::RETCODE_OK if the ContentFilteredTopic is correctly created + * eprosima::fastdds::dds::RETCODE_OK if the ContentFilteredTopic is correctly created */ - eprosima::fastrtps::types::ReturnCode_t create_content_filter( + eprosima::fastdds::dds::ReturnCode_t create_content_filter( const char* filter_class_name, // My custom filter class name is 'MY_CUSTOM_FILTER'. const char* type_name, // This custom filter only supports one type: 'HelloWorld'. const eprosima::fastdds::dds::TopicDataType* /*data_type*/, // Not used in this implementation. @@ -41,7 +41,7 @@ class MyCustomFilterFactory : public eprosima::fastdds::dds::IContentFilterFacto // Check that the two mandatory filter parameters were set. 2 != filter_parameters.length()) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; } // If there is an update, delete previous instance. @@ -53,7 +53,7 @@ class MyCustomFilterFactory : public eprosima::fastdds::dds::IContentFilterFacto // Instantiation of the Custom Filter. filter_instance = new MyCustomFilter(std::stoi(filter_parameters[0]), std::stoi(filter_parameters[1])); - return ReturnCode_t::RETCODE_OK; + return eprosima::fastdds::dds::RETCODE_OK; } /** @@ -62,11 +62,11 @@ class MyCustomFilterFactory : public eprosima::fastdds::dds::IContentFilterFacto * @param filter_class_name Custom filter name * @param filter_instance Instance of the filter to be deleted. * After returning, the passed pointer becomes invalid. - * @return eprosima::fastrtps::types::ReturnCode_t::RETCODE_BAD_PARAMETER if the instance was created with another + * @return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER if the instance was created with another * factory - * eprosima::fastrtps::types::ReturnCode_t::RETCODE_OK if correctly deleted + * eprosima::fastdds::dds::RETCODE_OK if correctly deleted */ - eprosima::fastrtps::types::ReturnCode_t delete_content_filter( + eprosima::fastdds::dds::ReturnCode_t delete_content_filter( const char* filter_class_name, eprosima::fastdds::dds::IContentFilter* filter_instance) override { @@ -75,7 +75,7 @@ class MyCustomFilterFactory : public eprosima::fastdds::dds::IContentFilterFacto // Check the filter instance is valid nullptr != filter_instance) { - return ReturnCode_t::RETCODE_BAD_PARAMETER; + return eprosima::fastdds::dds::RETCODE_BAD_PARAMETER; } // Deletion of the Custom Filter. @@ -84,7 +84,7 @@ class MyCustomFilterFactory : public eprosima::fastdds::dds::IContentFilterFacto delete(dynamic_cast(filter_instance)); } - return ReturnCode_t::RETCODE_OK; + return eprosima::fastdds::dds::RETCODE_OK; } }; diff --git a/examples/cpp/dds/CustomListenerExample/CustomListeners.cpp b/examples/cpp/dds/CustomListenerExample/CustomListeners.cpp index 6aaf72a9325..a2cdd135856 100644 --- a/examples/cpp/dds/CustomListenerExample/CustomListeners.cpp +++ b/examples/cpp/dds/CustomListenerExample/CustomListeners.cpp @@ -80,7 +80,7 @@ void CustomDataReaderListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&hello_, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { @@ -148,7 +148,7 @@ void CustomDomainParticipantListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&hello_, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/examples/cpp/dds/CustomListenerExample/Topic.cxx b/examples/cpp/dds/CustomListenerExample/Topic.cxx deleted file mode 100644 index ca86d176ba1..00000000000 --- a/examples/cpp/dds/CustomListenerExample/Topic.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// 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 Topic.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Topic.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -Topic::Topic() -{ -} - -Topic::~Topic() -{ -} - -Topic::Topic( - const Topic& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -Topic::Topic( - Topic&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -Topic& Topic::operator =( - const Topic& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -Topic& Topic::operator =( - Topic&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool Topic::operator ==( - const Topic& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool Topic::operator !=( - const Topic& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void Topic::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t Topic::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& Topic::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void Topic::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void Topic::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& Topic::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& Topic::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "TopicCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/DisablePositiveACKs/Topic.h b/examples/cpp/dds/CustomListenerExample/Topic.hpp similarity index 69% rename from examples/cpp/dds/DisablePositiveACKs/Topic.h rename to examples/cpp/dds/CustomListenerExample/Topic.hpp index 2596f317a1e..8f86884c2b8 100644 --- a/examples/cpp/dds/DisablePositiveACKs/Topic.h +++ b/examples/cpp/dds/CustomListenerExample/Topic.hpp @@ -13,32 +13,19 @@ // limitations under the License. /*! - * @file Topic.h + * @file Topic.hpp * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool fastddsgen. */ -#include -#include "Topicv1.h" +#ifndef _FAST_DDS_GENERATED_TOPIC_HPP_ +#define _FAST_DDS_GENERATED_TOPIC_HPP_ -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_TOPIC_H_ -#define _FAST_DDS_GENERATED_TOPIC_H_ - -#include -#include #include -#include #include -#include - +#include #include -#include -#include - - #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -64,17 +51,6 @@ #define TOPIC_DllAPI #endif // _WIN32 -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - /*! * @brief This class represents the structure Topic defined by the user in the IDL file. * @ingroup Topic @@ -86,73 +62,117 @@ class Topic /*! * @brief Default constructor. */ - eProsima_user_DllExport Topic(); + eProsima_user_DllExport Topic() + { + } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~Topic(); + eProsima_user_DllExport ~Topic() + { + } /*! * @brief Copy constructor. * @param x Reference to the object Topic that will be copied. */ eProsima_user_DllExport Topic( - const Topic& x); + const Topic& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } /*! * @brief Move constructor. * @param x Reference to the object Topic that will be copied. */ eProsima_user_DllExport Topic( - Topic&& x) noexcept; + Topic&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } /*! * @brief Copy assignment. * @param x Reference to the object Topic that will be copied. */ eProsima_user_DllExport Topic& operator =( - const Topic& x); + const Topic& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } /*! * @brief Move assignment. * @param x Reference to the object Topic that will be copied. */ eProsima_user_DllExport Topic& operator =( - Topic&& x) noexcept; + Topic&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } /*! * @brief Comparison operator. * @param x Topic object to compare. */ eProsima_user_DllExport bool operator ==( - const Topic& x) const; + const Topic& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } /*! * @brief Comparison operator. * @param x Topic object to compare. */ eProsima_user_DllExport bool operator !=( - const Topic& x) const; + const Topic& x) const + { + return !(*this == x); + } /*! * @brief This function sets a value in member index * @param _index New value for member index */ eProsima_user_DllExport void index( - uint32_t _index); + uint32_t _index) + { + m_index = _index; + } /*! * @brief This function returns the value of member index * @return Value of member index */ - eProsima_user_DllExport uint32_t index() const; + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } /*! * @brief This function returns a reference to member index * @return Reference to member index */ - eProsima_user_DllExport uint32_t& index(); + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } /*! @@ -160,26 +180,40 @@ class Topic * @param _message New value to be copied in member message */ eProsima_user_DllExport void message( - const std::string& _message); + const std::string& _message) + { + m_message = _message; + } /*! * @brief This function moves the value in member message * @param _message New value to be moved in member message */ eProsima_user_DllExport void message( - std::string&& _message); + std::string&& _message) + { + m_message = std::move(_message); + } /*! * @brief This function returns a constant reference to member message * @return Constant reference to member message */ - eProsima_user_DllExport const std::string& message() const; + eProsima_user_DllExport const std::string& message() const + { + return m_message; + } /*! * @brief This function returns a reference to member message * @return Reference to member message */ - eProsima_user_DllExport std::string& message(); + eProsima_user_DllExport std::string& message() + { + return m_message; + } + + private: @@ -188,8 +222,6 @@ class Topic }; -#endif // _FAST_DDS_GENERATED_TOPIC_H_ - +#endif // _FAST_DDS_GENERATED_TOPIC_HPP_ -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/CustomListenerExample/TopicCdrAux.hpp b/examples/cpp/dds/CustomListenerExample/TopicCdrAux.hpp index 619cdbbb7b8..7b60c44c7b4 100644 --- a/examples/cpp/dds/CustomListenerExample/TopicCdrAux.hpp +++ b/examples/cpp/dds/CustomListenerExample/TopicCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_TOPICCDRAUX_HPP_ #define _FAST_DDS_GENERATED_TOPICCDRAUX_HPP_ -#include "Topic.h" +#include "Topic.hpp" constexpr uint32_t Topic_max_cdr_typesize {268UL}; constexpr uint32_t Topic_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const Topic& data); diff --git a/examples/cpp/dds/CustomListenerExample/TopicCdrAux.ipp b/examples/cpp/dds/CustomListenerExample/TopicCdrAux.ipp index ac5a8c39ef9..37570c8a6b2 100644 --- a/examples/cpp/dds/CustomListenerExample/TopicCdrAux.ipp +++ b/examples/cpp/dds/CustomListenerExample/TopicCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/CustomListenerExample/TopicPubSubTypes.cxx b/examples/cpp/dds/CustomListenerExample/TopicPubSubTypes.cxx index ce688064a0e..8d6d0b195c9 100644 --- a/examples/cpp/dds/CustomListenerExample/TopicPubSubTypes.cxx +++ b/examples/cpp/dds/CustomListenerExample/TopicPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "TopicPubSubTypes.h" +#include #include -#include "TopicPubSubTypes.h" #include "TopicCdrAux.hpp" +#include "TopicTypeObjectSupport.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; - - TopicPubSubType::TopicPubSubType() { setName("Topic"); @@ -219,3 +219,11 @@ bool TopicPubSubType::getKey( return true; } +void TopicPubSubType::register_type_object_representation() const +{ + register_Topic_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "TopicCdrAux.ipp" diff --git a/examples/cpp/dds/CustomListenerExample/TopicPubSubTypes.h b/examples/cpp/dds/CustomListenerExample/TopicPubSubTypes.h index 0e584d6086a..0b37b3746f3 100644 --- a/examples/cpp/dds/CustomListenerExample/TopicPubSubTypes.h +++ b/examples/cpp/dds/CustomListenerExample/TopicPubSubTypes.h @@ -29,7 +29,7 @@ #include #include -#include "Topic.h" +#include "Topic.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type Topic defined by the user in the IDL file. * @ingroup Topic @@ -90,6 +88,9 @@ class TopicPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/CustomListenerExample/TopicTypeObjectSupport.cxx b/examples/cpp/dds/CustomListenerExample/TopicTypeObjectSupport.cxx new file mode 100644 index 00000000000..067fd08a822 --- /dev/null +++ b/examples/cpp/dds/CustomListenerExample/TopicTypeObjectSupport.cxx @@ -0,0 +1,248 @@ +// 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 TopicTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "TopicTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Topic.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_Topic_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_Topic_type_identifier(); + + }); +} + +void register_Topic_type_identifier() +{ + { + StructTypeFlag struct_flags_Topic = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Topic; + TypeIdentifierPair type_ids_Topic; + QualifiedTypeName type_name_Topic = "Topic"; + eprosima::fastcdr::optional type_ann_builtin_Topic; + eprosima::fastcdr::optional ann_custom_Topic; + CompleteTypeDetail detail_Topic = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Topic, ann_custom_Topic, type_name_Topic.to_string()); + CompleteStructHeader header_Topic; + header_Topic = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Topic); + CompleteStructMemberSeq member_seq_Topic; + { + return_code_Topic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Topic); + + if (return_code_Topic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_Topic.type_identifier1()._d() || TK_NONE == type_ids_Topic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Topic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Topic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_Topic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Topic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Topic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Topic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_Topic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_Topic.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_Topic); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_Topic, member_index); + } + { + return_code_Topic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_Topic); + + if (return_code_Topic != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_Topic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_Topic); + if (return_code_Topic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_Topic.type_identifier1()._d() || TK_NONE == type_ids_Topic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Topic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Topic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_Topic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Topic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Topic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Topic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_Topic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_Topic.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_Topic); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_Topic, member_message); + } + CompleteStructType struct_type_Topic = TypeObjectUtils::build_complete_struct_type(struct_flags_Topic, header_Topic, member_seq_Topic); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Topic, type_name_Topic.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Topic already registered in TypeObjectRegistry for a different type."); + } + return_code_Topic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Topic", type_ids_Topic); + if (return_code_Topic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Topic: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/CustomListenerExample/TopicTypeObjectSupport.hpp b/examples/cpp/dds/CustomListenerExample/TopicTypeObjectSupport.hpp new file mode 100644 index 00000000000..f0576f9b948 --- /dev/null +++ b/examples/cpp/dds/CustomListenerExample/TopicTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// 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 TopicTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_TOPIC_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_TOPIC_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_Topic_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register Topic related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_Topic_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_TOPIC_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/CustomListenerExample/Topicv1.cxx b/examples/cpp/dds/CustomListenerExample/Topicv1.cxx deleted file mode 100644 index a3e85584242..00000000000 --- a/examples/cpp/dds/CustomListenerExample/Topicv1.cxx +++ /dev/null @@ -1,286 +0,0 @@ -// 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 Topic.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Topic.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define Topic_max_cdr_typesize 268ULL; - - - - -Topic::Topic() -{ - // unsigned long m_index - m_index = 0; - // /type_d() m_message - - -} - -Topic::~Topic() -{ -} - -Topic::Topic( - const Topic& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -Topic::Topic( - Topic&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -Topic& Topic::operator =( - const Topic& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -Topic& Topic::operator =( - Topic&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool Topic::operator ==( - const Topic& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool Topic::operator !=( - const Topic& x) const -{ - return !(*this == x); -} - -size_t Topic::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return Topic_max_cdr_typesize; -} - -size_t Topic::getCdrSerializedSize( - const Topic& 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 Topic::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_message.c_str(); - -} - -void Topic::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_message; - - -} - - -bool Topic::isKeyDefined() -{ - return false; -} - -void Topic::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void Topic::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t Topic::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& Topic::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void Topic::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void Topic::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& Topic::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& Topic::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/CustomListenerExample/Topicv1.h b/examples/cpp/dds/CustomListenerExample/Topicv1.h deleted file mode 100644 index 1e9d07ab2b4..00000000000 --- a/examples/cpp/dds/CustomListenerExample/Topicv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// 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 Topic.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_TOPIC_H_ -#define _FAST_DDS_GENERATED_TOPIC_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TOPIC_SOURCE) -#define TOPIC_DllAPI __declspec( dllexport ) -#else -#define TOPIC_DllAPI __declspec( dllimport ) -#endif // TOPIC_SOURCE -#else -#define TOPIC_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TOPIC_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure Topic defined by the user in the IDL file. - * @ingroup Topic - */ -class Topic -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Topic(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Topic(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic( - const Topic& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic( - Topic&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic& operator =( - const Topic& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic& operator =( - Topic&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x Topic object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Topic& x) const; - - /*! - * @brief Comparison operator. - * @param x Topic object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Topic& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - 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 - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - 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 Topic& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint32_t m_index; - std::string m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_TOPIC_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolData.cxx b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolData.cxx deleted file mode 100644 index 7f304177d38..00000000000 --- a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolData.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// 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 CustomPayloadPoolData.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "CustomPayloadPoolData.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -CustomPayloadPoolData::CustomPayloadPoolData() -{ -} - -CustomPayloadPoolData::~CustomPayloadPoolData() -{ -} - -CustomPayloadPoolData::CustomPayloadPoolData( - const CustomPayloadPoolData& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -CustomPayloadPoolData::CustomPayloadPoolData( - CustomPayloadPoolData&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -CustomPayloadPoolData& CustomPayloadPoolData::operator =( - const CustomPayloadPoolData& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -CustomPayloadPoolData& CustomPayloadPoolData::operator =( - CustomPayloadPoolData&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool CustomPayloadPoolData::operator ==( - const CustomPayloadPoolData& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool CustomPayloadPoolData::operator !=( - const CustomPayloadPoolData& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void CustomPayloadPoolData::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t CustomPayloadPoolData::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& CustomPayloadPoolData::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void CustomPayloadPoolData::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void CustomPayloadPoolData::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& CustomPayloadPoolData::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& CustomPayloadPoolData::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "CustomPayloadPoolDataCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolData.h b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolData.hpp similarity index 69% rename from examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolData.h rename to examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolData.hpp index 46b1c16c138..19136a331f9 100644 --- a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolData.h +++ b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolData.hpp @@ -13,32 +13,19 @@ // limitations under the License. /*! - * @file CustomPayloadPoolData.h + * @file CustomPayloadPoolData.hpp * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool fastddsgen. */ -#include -#include "CustomPayloadPoolDatav1.h" +#ifndef _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATA_HPP_ +#define _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATA_HPP_ -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATA_H_ -#define _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATA_H_ - -#include -#include #include -#include #include -#include - +#include #include -#include -#include - - #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -64,17 +51,6 @@ #define CUSTOMPAYLOADPOOLDATA_DllAPI #endif // _WIN32 -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - /*! * @brief This class represents the structure CustomPayloadPoolData defined by the user in the IDL file. * @ingroup CustomPayloadPoolData @@ -86,73 +62,117 @@ class CustomPayloadPoolData /*! * @brief Default constructor. */ - eProsima_user_DllExport CustomPayloadPoolData(); + eProsima_user_DllExport CustomPayloadPoolData() + { + } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~CustomPayloadPoolData(); + eProsima_user_DllExport ~CustomPayloadPoolData() + { + } /*! * @brief Copy constructor. * @param x Reference to the object CustomPayloadPoolData that will be copied. */ eProsima_user_DllExport CustomPayloadPoolData( - const CustomPayloadPoolData& x); + const CustomPayloadPoolData& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } /*! * @brief Move constructor. * @param x Reference to the object CustomPayloadPoolData that will be copied. */ eProsima_user_DllExport CustomPayloadPoolData( - CustomPayloadPoolData&& x) noexcept; + CustomPayloadPoolData&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } /*! * @brief Copy assignment. * @param x Reference to the object CustomPayloadPoolData that will be copied. */ eProsima_user_DllExport CustomPayloadPoolData& operator =( - const CustomPayloadPoolData& x); + const CustomPayloadPoolData& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } /*! * @brief Move assignment. * @param x Reference to the object CustomPayloadPoolData that will be copied. */ eProsima_user_DllExport CustomPayloadPoolData& operator =( - CustomPayloadPoolData&& x) noexcept; + CustomPayloadPoolData&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } /*! * @brief Comparison operator. * @param x CustomPayloadPoolData object to compare. */ eProsima_user_DllExport bool operator ==( - const CustomPayloadPoolData& x) const; + const CustomPayloadPoolData& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } /*! * @brief Comparison operator. * @param x CustomPayloadPoolData object to compare. */ eProsima_user_DllExport bool operator !=( - const CustomPayloadPoolData& x) const; + const CustomPayloadPoolData& x) const + { + return !(*this == x); + } /*! * @brief This function sets a value in member index * @param _index New value for member index */ eProsima_user_DllExport void index( - uint32_t _index); + uint32_t _index) + { + m_index = _index; + } /*! * @brief This function returns the value of member index * @return Value of member index */ - eProsima_user_DllExport uint32_t index() const; + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } /*! * @brief This function returns a reference to member index * @return Reference to member index */ - eProsima_user_DllExport uint32_t& index(); + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } /*! @@ -160,26 +180,40 @@ class CustomPayloadPoolData * @param _message New value to be copied in member message */ eProsima_user_DllExport void message( - const std::string& _message); + const std::string& _message) + { + m_message = _message; + } /*! * @brief This function moves the value in member message * @param _message New value to be moved in member message */ eProsima_user_DllExport void message( - std::string&& _message); + std::string&& _message) + { + m_message = std::move(_message); + } /*! * @brief This function returns a constant reference to member message * @return Constant reference to member message */ - eProsima_user_DllExport const std::string& message() const; + eProsima_user_DllExport const std::string& message() const + { + return m_message; + } /*! * @brief This function returns a reference to member message * @return Reference to member message */ - eProsima_user_DllExport std::string& message(); + eProsima_user_DllExport std::string& message() + { + return m_message; + } + + private: @@ -188,8 +222,6 @@ class CustomPayloadPoolData }; -#endif // _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATA_H_ - +#endif // _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATA_HPP_ -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataCdrAux.hpp b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataCdrAux.hpp index 3d50c83da22..926bf7ea3d7 100644 --- a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataCdrAux.hpp +++ b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATACDRAUX_HPP_ #define _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATACDRAUX_HPP_ -#include "CustomPayloadPoolData.h" +#include "CustomPayloadPoolData.hpp" constexpr uint32_t CustomPayloadPoolData_max_cdr_typesize {268UL}; constexpr uint32_t CustomPayloadPoolData_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const CustomPayloadPoolData& data); diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataCdrAux.ipp b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataCdrAux.ipp index 0fb2b162fb2..89f2aaad27d 100644 --- a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataCdrAux.ipp +++ b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataPubSubTypes.cxx b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataPubSubTypes.cxx index ffd0e7faa97..3133c1d0b6c 100644 --- a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataPubSubTypes.cxx +++ b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "CustomPayloadPoolDataPubSubTypes.h" +#include #include -#include "CustomPayloadPoolDataPubSubTypes.h" #include "CustomPayloadPoolDataCdrAux.hpp" +#include "CustomPayloadPoolDataTypeObjectSupport.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; - - CustomPayloadPoolDataPubSubType::CustomPayloadPoolDataPubSubType() { setName("CustomPayloadPoolData"); @@ -219,3 +219,11 @@ bool CustomPayloadPoolDataPubSubType::getKey( return true; } +void CustomPayloadPoolDataPubSubType::register_type_object_representation() const +{ + register_CustomPayloadPoolData_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "CustomPayloadPoolDataCdrAux.ipp" diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataPubSubTypes.h b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataPubSubTypes.h index 9128e745240..92ce3732bea 100644 --- a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataPubSubTypes.h +++ b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataPubSubTypes.h @@ -29,7 +29,7 @@ #include #include -#include "CustomPayloadPoolData.h" +#include "CustomPayloadPoolData.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type CustomPayloadPoolData defined by the user in the IDL file. * @ingroup CustomPayloadPoolData @@ -90,6 +88,9 @@ class CustomPayloadPoolDataPubSubType : public eprosima::fastdds::dds::TopicData eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataSubscriber.cpp b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataSubscriber.cpp index b78051cd264..ab35a8684e0 100644 --- a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataSubscriber.cpp +++ b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataSubscriber.cpp @@ -149,7 +149,7 @@ void CustomPayloadPoolDataSubscriber::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&hello_, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataTypeObjectSupport.cxx b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataTypeObjectSupport.cxx new file mode 100644 index 00000000000..9491872d4ac --- /dev/null +++ b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataTypeObjectSupport.cxx @@ -0,0 +1,248 @@ +// 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 CustomPayloadPoolDataTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "CustomPayloadPoolDataTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "CustomPayloadPoolData.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_CustomPayloadPoolData_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_CustomPayloadPoolData_type_identifier(); + + }); +} + +void register_CustomPayloadPoolData_type_identifier() +{ + { + StructTypeFlag struct_flags_CustomPayloadPoolData = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_CustomPayloadPoolData; + TypeIdentifierPair type_ids_CustomPayloadPoolData; + QualifiedTypeName type_name_CustomPayloadPoolData = "CustomPayloadPoolData"; + eprosima::fastcdr::optional type_ann_builtin_CustomPayloadPoolData; + eprosima::fastcdr::optional ann_custom_CustomPayloadPoolData; + CompleteTypeDetail detail_CustomPayloadPoolData = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_CustomPayloadPoolData, ann_custom_CustomPayloadPoolData, type_name_CustomPayloadPoolData.to_string()); + CompleteStructHeader header_CustomPayloadPoolData; + header_CustomPayloadPoolData = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_CustomPayloadPoolData); + CompleteStructMemberSeq member_seq_CustomPayloadPoolData; + { + return_code_CustomPayloadPoolData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_CustomPayloadPoolData); + + if (return_code_CustomPayloadPoolData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1()._d() || TK_NONE == type_ids_CustomPayloadPoolData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_CustomPayloadPoolData.type_identifier1()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_CustomPayloadPoolData.type_identifier1()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_CustomPayloadPoolData.type_identifier1()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_CustomPayloadPoolData.type_identifier1()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_CustomPayloadPoolData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_CustomPayloadPoolData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_CustomPayloadPoolData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_CustomPayloadPoolData.type_identifier2()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_CustomPayloadPoolData.type_identifier2()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_CustomPayloadPoolData.type_identifier2()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_CustomPayloadPoolData.type_identifier2()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_CustomPayloadPoolData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_CustomPayloadPoolData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_CustomPayloadPoolData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_CustomPayloadPoolData.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_CustomPayloadPoolData); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_CustomPayloadPoolData, member_index); + } + { + return_code_CustomPayloadPoolData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_CustomPayloadPoolData); + + if (return_code_CustomPayloadPoolData != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_CustomPayloadPoolData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_CustomPayloadPoolData); + if (return_code_CustomPayloadPoolData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1()._d() || TK_NONE == type_ids_CustomPayloadPoolData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_CustomPayloadPoolData.type_identifier1()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_CustomPayloadPoolData.type_identifier1()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_CustomPayloadPoolData.type_identifier1()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_CustomPayloadPoolData.type_identifier1()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_CustomPayloadPoolData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_CustomPayloadPoolData.type_identifier1()._d() && + (EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_CustomPayloadPoolData.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_CustomPayloadPoolData.type_identifier2()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_CustomPayloadPoolData.type_identifier2()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_CustomPayloadPoolData.type_identifier2()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_CustomPayloadPoolData.type_identifier2()._d() && + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_CustomPayloadPoolData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_CustomPayloadPoolData.type_identifier2()._d() && + (EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_CustomPayloadPoolData.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_CustomPayloadPoolData.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_CustomPayloadPoolData.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_CustomPayloadPoolData); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_CustomPayloadPoolData, member_message); + } + CompleteStructType struct_type_CustomPayloadPoolData = TypeObjectUtils::build_complete_struct_type(struct_flags_CustomPayloadPoolData, header_CustomPayloadPoolData, member_seq_CustomPayloadPoolData); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_CustomPayloadPoolData, type_name_CustomPayloadPoolData.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "CustomPayloadPoolData already registered in TypeObjectRegistry for a different type."); + } + return_code_CustomPayloadPoolData = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "CustomPayloadPoolData", type_ids_CustomPayloadPoolData); + if (return_code_CustomPayloadPoolData != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "CustomPayloadPoolData: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataTypeObjectSupport.hpp b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataTypeObjectSupport.hpp new file mode 100644 index 00000000000..adc9d80573a --- /dev/null +++ b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDataTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// 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 CustomPayloadPoolDataTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATA_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATA_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_CustomPayloadPoolData_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register CustomPayloadPoolData related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_CustomPayloadPoolData_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATA_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDatav1.cxx b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDatav1.cxx deleted file mode 100644 index 51f45ea225f..00000000000 --- a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDatav1.cxx +++ /dev/null @@ -1,286 +0,0 @@ -// 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 CustomPayloadPoolData.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "CustomPayloadPoolData.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define CustomPayloadPoolData_max_cdr_typesize 268ULL; - - - - -CustomPayloadPoolData::CustomPayloadPoolData() -{ - // unsigned long m_index - m_index = 0; - // /type_d() m_message - - -} - -CustomPayloadPoolData::~CustomPayloadPoolData() -{ -} - -CustomPayloadPoolData::CustomPayloadPoolData( - const CustomPayloadPoolData& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -CustomPayloadPoolData::CustomPayloadPoolData( - CustomPayloadPoolData&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -CustomPayloadPoolData& CustomPayloadPoolData::operator =( - const CustomPayloadPoolData& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -CustomPayloadPoolData& CustomPayloadPoolData::operator =( - CustomPayloadPoolData&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool CustomPayloadPoolData::operator ==( - const CustomPayloadPoolData& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool CustomPayloadPoolData::operator !=( - const CustomPayloadPoolData& x) const -{ - return !(*this == x); -} - -size_t CustomPayloadPoolData::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return CustomPayloadPoolData_max_cdr_typesize; -} - -size_t CustomPayloadPoolData::getCdrSerializedSize( - const CustomPayloadPoolData& 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 CustomPayloadPoolData::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_message.c_str(); - -} - -void CustomPayloadPoolData::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_message; - - -} - - -bool CustomPayloadPoolData::isKeyDefined() -{ - return false; -} - -void CustomPayloadPoolData::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void CustomPayloadPoolData::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t CustomPayloadPoolData::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& CustomPayloadPoolData::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void CustomPayloadPoolData::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void CustomPayloadPoolData::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& CustomPayloadPoolData::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& CustomPayloadPoolData::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDatav1.h b/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDatav1.h deleted file mode 100644 index bf2bf62642c..00000000000 --- a/examples/cpp/dds/CustomPayloadPoolExample/CustomPayloadPoolDatav1.h +++ /dev/null @@ -1,244 +0,0 @@ -// 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 CustomPayloadPoolData.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATA_H_ -#define _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATA_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CUSTOMPAYLOADPOOLDATA_SOURCE) -#define CUSTOMPAYLOADPOOLDATA_DllAPI __declspec( dllexport ) -#else -#define CUSTOMPAYLOADPOOLDATA_DllAPI __declspec( dllimport ) -#endif // CUSTOMPAYLOADPOOLDATA_SOURCE -#else -#define CUSTOMPAYLOADPOOLDATA_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define CUSTOMPAYLOADPOOLDATA_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure CustomPayloadPoolData defined by the user in the IDL file. - * @ingroup CustomPayloadPoolData - */ -class CustomPayloadPoolData -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport CustomPayloadPoolData(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~CustomPayloadPoolData(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object CustomPayloadPoolData that will be copied. - */ - eProsima_user_DllExport CustomPayloadPoolData( - const CustomPayloadPoolData& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object CustomPayloadPoolData that will be copied. - */ - eProsima_user_DllExport CustomPayloadPoolData( - CustomPayloadPoolData&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object CustomPayloadPoolData that will be copied. - */ - eProsima_user_DllExport CustomPayloadPoolData& operator =( - const CustomPayloadPoolData& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object CustomPayloadPoolData that will be copied. - */ - eProsima_user_DllExport CustomPayloadPoolData& operator =( - CustomPayloadPoolData&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x CustomPayloadPoolData object to compare. - */ - eProsima_user_DllExport bool operator ==( - const CustomPayloadPoolData& x) const; - - /*! - * @brief Comparison operator. - * @param x CustomPayloadPoolData object to compare. - */ - eProsima_user_DllExport bool operator !=( - const CustomPayloadPoolData& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - 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 - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - 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 CustomPayloadPoolData& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint32_t m_index; - std::string m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_CUSTOMPAYLOADPOOLDATA_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.cxx b/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.cxx deleted file mode 100644 index ded92f4bcdc..00000000000 --- a/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// 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 deadlinepayload.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "deadlinepayload.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -HelloMsg::HelloMsg() -{ -} - -HelloMsg::~HelloMsg() -{ -} - -HelloMsg::HelloMsg( - const HelloMsg& x) -{ - m_deadlinekey = x.m_deadlinekey; - m_payload = x.m_payload; -} - -HelloMsg::HelloMsg( - HelloMsg&& x) noexcept -{ - m_deadlinekey = x.m_deadlinekey; - m_payload = std::move(x.m_payload); -} - -HelloMsg& HelloMsg::operator =( - const HelloMsg& x) -{ - - m_deadlinekey = x.m_deadlinekey; - m_payload = x.m_payload; - return *this; -} - -HelloMsg& HelloMsg::operator =( - HelloMsg&& x) noexcept -{ - - m_deadlinekey = x.m_deadlinekey; - m_payload = std::move(x.m_payload); - return *this; -} - -bool HelloMsg::operator ==( - const HelloMsg& x) const -{ - return (m_deadlinekey == x.m_deadlinekey && - m_payload == x.m_payload); -} - -bool HelloMsg::operator !=( - const HelloMsg& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member deadlinekey - * @param _deadlinekey New value for member deadlinekey - */ -void HelloMsg::deadlinekey( - uint16_t _deadlinekey) -{ - m_deadlinekey = _deadlinekey; -} - -/*! - * @brief This function returns the value of member deadlinekey - * @return Value of member deadlinekey - */ -uint16_t HelloMsg::deadlinekey() const -{ - return m_deadlinekey; -} - -/*! - * @brief This function returns a reference to member deadlinekey - * @return Reference to member deadlinekey - */ -uint16_t& HelloMsg::deadlinekey() -{ - return m_deadlinekey; -} - - -/*! - * @brief This function copies the value in member payload - * @param _payload New value to be copied in member payload - */ -void HelloMsg::payload( - const eprosima::fastcdr::fixed_string<256>& _payload) -{ - m_payload = _payload; -} - -/*! - * @brief This function moves the value in member payload - * @param _payload New value to be moved in member payload - */ -void HelloMsg::payload( - eprosima::fastcdr::fixed_string<256>&& _payload) -{ - m_payload = std::move(_payload); -} - -/*! - * @brief This function returns a constant reference to member payload - * @return Constant reference to member payload - */ -const eprosima::fastcdr::fixed_string<256>& HelloMsg::payload() const -{ - return m_payload; -} - -/*! - * @brief This function returns a reference to member payload - * @return Reference to member payload - */ -eprosima::fastcdr::fixed_string<256>& HelloMsg::payload() -{ - return m_payload; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "deadlinepayloadCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.h b/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.hpp similarity index 71% rename from examples/cpp/dds/DeadlineQoSExample/deadlinepayload.h rename to examples/cpp/dds/DeadlineQoSExample/deadlinepayload.hpp index 4dd530394b2..e46adfefb01 100644 --- a/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.h +++ b/examples/cpp/dds/DeadlineQoSExample/deadlinepayload.hpp @@ -13,32 +13,19 @@ // limitations under the License. /*! - * @file deadlinepayload.h + * @file deadlinepayload.hpp * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool fastddsgen. */ -#include -#include "deadlinepayloadv1.h" +#ifndef _FAST_DDS_GENERATED_DEADLINEPAYLOAD_HPP_ +#define _FAST_DDS_GENERATED_DEADLINEPAYLOAD_HPP_ -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_DEADLINEPAYLOAD_H_ -#define _FAST_DDS_GENERATED_DEADLINEPAYLOAD_H_ - -#include -#include #include -#include #include -#include - +#include #include -#include -#include - - #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -64,17 +51,6 @@ #define DEADLINEPAYLOAD_DllAPI #endif // _WIN32 -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - /*! * @brief This class represents the structure HelloMsg defined by the user in the IDL file. * @ingroup deadlinepayload @@ -86,73 +62,117 @@ class HelloMsg /*! * @brief Default constructor. */ - eProsima_user_DllExport HelloMsg(); + eProsima_user_DllExport HelloMsg() + { + } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~HelloMsg(); + eProsima_user_DllExport ~HelloMsg() + { + } /*! * @brief Copy constructor. * @param x Reference to the object HelloMsg that will be copied. */ eProsima_user_DllExport HelloMsg( - const HelloMsg& x); + const HelloMsg& x) + { + m_deadlinekey = x.m_deadlinekey; + + m_payload = x.m_payload; + + } /*! * @brief Move constructor. * @param x Reference to the object HelloMsg that will be copied. */ eProsima_user_DllExport HelloMsg( - HelloMsg&& x) noexcept; + HelloMsg&& x) noexcept + { + m_deadlinekey = x.m_deadlinekey; + m_payload = std::move(x.m_payload); + } /*! * @brief Copy assignment. * @param x Reference to the object HelloMsg that will be copied. */ eProsima_user_DllExport HelloMsg& operator =( - const HelloMsg& x); + const HelloMsg& x) + { + + m_deadlinekey = x.m_deadlinekey; + + m_payload = x.m_payload; + + return *this; + } /*! * @brief Move assignment. * @param x Reference to the object HelloMsg that will be copied. */ eProsima_user_DllExport HelloMsg& operator =( - HelloMsg&& x) noexcept; + HelloMsg&& x) noexcept + { + + m_deadlinekey = x.m_deadlinekey; + m_payload = std::move(x.m_payload); + return *this; + } /*! * @brief Comparison operator. * @param x HelloMsg object to compare. */ eProsima_user_DllExport bool operator ==( - const HelloMsg& x) const; + const HelloMsg& x) const + { + return (m_deadlinekey == x.m_deadlinekey && + m_payload == x.m_payload); + } /*! * @brief Comparison operator. * @param x HelloMsg object to compare. */ eProsima_user_DllExport bool operator !=( - const HelloMsg& x) const; + const HelloMsg& x) const + { + return !(*this == x); + } /*! * @brief This function sets a value in member deadlinekey * @param _deadlinekey New value for member deadlinekey */ eProsima_user_DllExport void deadlinekey( - uint16_t _deadlinekey); + uint16_t _deadlinekey) + { + m_deadlinekey = _deadlinekey; + } /*! * @brief This function returns the value of member deadlinekey * @return Value of member deadlinekey */ - eProsima_user_DllExport uint16_t deadlinekey() const; + eProsima_user_DllExport uint16_t deadlinekey() const + { + return m_deadlinekey; + } /*! * @brief This function returns a reference to member deadlinekey * @return Reference to member deadlinekey */ - eProsima_user_DllExport uint16_t& deadlinekey(); + eProsima_user_DllExport uint16_t& deadlinekey() + { + return m_deadlinekey; + } /*! @@ -160,26 +180,40 @@ class HelloMsg * @param _payload New value to be copied in member payload */ eProsima_user_DllExport void payload( - const eprosima::fastcdr::fixed_string<256>& _payload); + const eprosima::fastcdr::fixed_string<256>& _payload) + { + m_payload = _payload; + } /*! * @brief This function moves the value in member payload * @param _payload New value to be moved in member payload */ eProsima_user_DllExport void payload( - eprosima::fastcdr::fixed_string<256>&& _payload); + eprosima::fastcdr::fixed_string<256>&& _payload) + { + m_payload = std::move(_payload); + } /*! * @brief This function returns a constant reference to member payload * @return Constant reference to member payload */ - eProsima_user_DllExport const eprosima::fastcdr::fixed_string<256>& payload() const; + eProsima_user_DllExport const eprosima::fastcdr::fixed_string<256>& payload() const + { + return m_payload; + } /*! * @brief This function returns a reference to member payload * @return Reference to member payload */ - eProsima_user_DllExport eprosima::fastcdr::fixed_string<256>& payload(); + eProsima_user_DllExport eprosima::fastcdr::fixed_string<256>& payload() + { + return m_payload; + } + + private: @@ -188,8 +222,6 @@ class HelloMsg }; -#endif // _FAST_DDS_GENERATED_DEADLINEPAYLOAD_H_ - +#endif // _FAST_DDS_GENERATED_DEADLINEPAYLOAD_HPP_ -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadCdrAux.hpp b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadCdrAux.hpp index cf5ad3e0bdc..a23da79e9bb 100644 --- a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadCdrAux.hpp +++ b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_DEADLINEPAYLOADCDRAUX_HPP_ #define _FAST_DDS_GENERATED_DEADLINEPAYLOADCDRAUX_HPP_ -#include "deadlinepayload.h" +#include "deadlinepayload.hpp" constexpr uint32_t HelloMsg_max_cdr_typesize {269UL}; constexpr uint32_t HelloMsg_max_key_cdr_typesize {2UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloMsg& data); diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadCdrAux.ipp b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadCdrAux.ipp index a16c0446aab..6dd3947b3c6 100644 --- a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadCdrAux.ipp +++ b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadPubSubTypes.cxx b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadPubSubTypes.cxx index 300ac806538..faa25783be9 100644 --- a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadPubSubTypes.cxx +++ b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "deadlinepayloadPubSubTypes.h" +#include #include -#include "deadlinepayloadPubSubTypes.h" #include "deadlinepayloadCdrAux.hpp" +#include "deadlinepayloadTypeObjectSupport.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; - - HelloMsgPubSubType::HelloMsgPubSubType() { setName("HelloMsg"); @@ -219,3 +219,11 @@ bool HelloMsgPubSubType::getKey( return true; } +void HelloMsgPubSubType::register_type_object_representation() const +{ + register_deadlinepayload_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "deadlinepayloadCdrAux.ipp" diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadPubSubTypes.h b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadPubSubTypes.h index 8269a45c84c..a49ed543f16 100644 --- a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadPubSubTypes.h +++ b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadPubSubTypes.h @@ -29,7 +29,7 @@ #include #include -#include "deadlinepayload.h" +#include "deadlinepayload.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type HelloMsg defined by the user in the IDL file. * @ingroup deadlinepayload @@ -90,6 +88,9 @@ class HelloMsgPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadSubscriber.cxx b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadSubscriber.cxx index 09d89827bac..0a893426857 100644 --- a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadSubscriber.cxx +++ b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadSubscriber.cxx @@ -124,7 +124,7 @@ void deadlinepayloadSubscriber::SubListener::on_data_available( { SampleInfo info; HelloMsg st; - if (reader->take_next_sample(&st, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&st, &info) == RETCODE_OK) { if (info.valid_data) { diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadTypeObjectSupport.cxx b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadTypeObjectSupport.cxx new file mode 100644 index 00000000000..4d75ddf0def --- /dev/null +++ b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadTypeObjectSupport.cxx @@ -0,0 +1,261 @@ +// 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 deadlinepayloadTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "deadlinepayloadTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "deadlinepayload.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_deadlinepayload_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_HelloMsg_type_identifier(); + + }); +} + +void register_HelloMsg_type_identifier() +{ + { + StructTypeFlag struct_flags_HelloMsg = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_HelloMsg; + TypeIdentifierPair type_ids_HelloMsg; + QualifiedTypeName type_name_HelloMsg = "HelloMsg"; + eprosima::fastcdr::optional type_ann_builtin_HelloMsg; + eprosima::fastcdr::optional ann_custom_HelloMsg; + CompleteTypeDetail detail_HelloMsg = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_HelloMsg, ann_custom_HelloMsg, type_name_HelloMsg.to_string()); + CompleteStructHeader header_HelloMsg; + header_HelloMsg = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_HelloMsg); + CompleteStructMemberSeq member_seq_HelloMsg; + { + return_code_HelloMsg = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint16_t", type_ids_HelloMsg); + + if (return_code_HelloMsg != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "deadlinekey Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_deadlinekey = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_deadlinekey; + MemberId member_id_deadlinekey = 0x00000000; + if (EK_COMPLETE == type_ids_HelloMsg.type_identifier1()._d() || TK_NONE == type_ids_HelloMsg.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloMsg.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloMsg.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloMsg.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloMsg.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloMsg.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloMsg.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloMsg.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloMsg.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloMsg.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloMsg.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_deadlinekey = TypeObjectUtils::build_common_struct_member(member_id_deadlinekey, member_flags_deadlinekey, type_ids_HelloMsg.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloMsg.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloMsg.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloMsg.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloMsg.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloMsg.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloMsg.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloMsg.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloMsg.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloMsg.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloMsg.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloMsg.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_deadlinekey = TypeObjectUtils::build_common_struct_member(member_id_deadlinekey, member_flags_deadlinekey, type_ids_HelloMsg.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure deadlinekey member TypeIdentifier inconsistent."); + return; + } + MemberName name_deadlinekey = "deadlinekey"; + eprosima::fastcdr::optional member_ann_builtin_deadlinekey; + ann_custom_HelloMsg.reset(); + AppliedAnnotationSeq tmp_ann_custom_deadlinekey; + eprosima::fastcdr::optional unit_deadlinekey; + eprosima::fastcdr::optional min_deadlinekey; + eprosima::fastcdr::optional max_deadlinekey; + eprosima::fastcdr::optional hash_id_deadlinekey; + if (unit_deadlinekey.has_value() || min_deadlinekey.has_value() || max_deadlinekey.has_value() || hash_id_deadlinekey.has_value()) + { + member_ann_builtin_deadlinekey = TypeObjectUtils::build_applied_builtin_member_annotations(unit_deadlinekey, min_deadlinekey, max_deadlinekey, hash_id_deadlinekey); + } + if (!tmp_ann_custom_deadlinekey.empty()) + { + ann_custom_HelloMsg = tmp_ann_custom_deadlinekey; + } + CompleteMemberDetail detail_deadlinekey = TypeObjectUtils::build_complete_member_detail(name_deadlinekey, member_ann_builtin_deadlinekey, ann_custom_HelloMsg); + CompleteStructMember member_deadlinekey = TypeObjectUtils::build_complete_struct_member(common_deadlinekey, detail_deadlinekey); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloMsg, member_deadlinekey); + } + { + return_code_HelloMsg = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_256", type_ids_HelloMsg); + + if (return_code_HelloMsg != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_256("TI_STRING8_LARGE"); + if (type_id_kind_anonymous_string_256 == "TI_STRING8_SMALL") + { + SBound bound = static_cast(256); + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_256")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_256 already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_256 == "TI_STRING8_LARGE") + { + LBound bound = 256; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_256")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_256 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_256: Unknown String kind."); + return; + } + return_code_HelloMsg = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_256", type_ids_HelloMsg); + if (return_code_HelloMsg != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_256: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_payload = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_payload; + MemberId member_id_payload = 0x00000001; + if (EK_COMPLETE == type_ids_HelloMsg.type_identifier1()._d() || TK_NONE == type_ids_HelloMsg.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloMsg.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloMsg.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloMsg.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloMsg.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloMsg.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloMsg.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloMsg.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloMsg.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloMsg.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloMsg.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_payload = TypeObjectUtils::build_common_struct_member(member_id_payload, member_flags_payload, type_ids_HelloMsg.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloMsg.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloMsg.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloMsg.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloMsg.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloMsg.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloMsg.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloMsg.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloMsg.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloMsg.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloMsg.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloMsg.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloMsg.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_payload = TypeObjectUtils::build_common_struct_member(member_id_payload, member_flags_payload, type_ids_HelloMsg.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure payload member TypeIdentifier inconsistent."); + return; + } + MemberName name_payload = "payload"; + eprosima::fastcdr::optional member_ann_builtin_payload; + ann_custom_HelloMsg.reset(); + CompleteMemberDetail detail_payload = TypeObjectUtils::build_complete_member_detail(name_payload, member_ann_builtin_payload, ann_custom_HelloMsg); + CompleteStructMember member_payload = TypeObjectUtils::build_complete_struct_member(common_payload, detail_payload); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloMsg, member_payload); + } + CompleteStructType struct_type_HelloMsg = TypeObjectUtils::build_complete_struct_type(struct_flags_HelloMsg, header_HelloMsg, member_seq_HelloMsg); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_HelloMsg, type_name_HelloMsg.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloMsg already registered in TypeObjectRegistry for a different type."); + } + return_code_HelloMsg = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "HelloMsg", type_ids_HelloMsg); + if (return_code_HelloMsg != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloMsg: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadTypeObjectSupport.hpp b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadTypeObjectSupport.hpp new file mode 100644 index 00000000000..ae7ba5c9f0a --- /dev/null +++ b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// 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 deadlinepayloadTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_DEADLINEPAYLOAD_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_DEADLINEPAYLOAD_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_deadlinepayload_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register HelloMsg related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_HelloMsg_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_DEADLINEPAYLOAD_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadv1.cxx b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadv1.cxx deleted file mode 100644 index 64d77540aa4..00000000000 --- a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadv1.cxx +++ /dev/null @@ -1,294 +0,0 @@ -// 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 deadlinepayload.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "deadlinepayload.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define HelloMsg_max_cdr_typesize 269ULL; - - - - -HelloMsg::HelloMsg() -{ - // unsigned short m_deadlinekey - m_deadlinekey = 0; - // /type_d() m_payload - - -} - -HelloMsg::~HelloMsg() -{ -} - -HelloMsg::HelloMsg( - const HelloMsg& x) -{ - m_deadlinekey = x.m_deadlinekey; - - - m_payload = x.m_payload; - -} - -HelloMsg::HelloMsg( - HelloMsg&& x) noexcept -{ - m_deadlinekey = x.m_deadlinekey; - - - m_payload = std::move(x.m_payload); - -} - -HelloMsg& HelloMsg::operator =( - const HelloMsg& x) -{ - m_deadlinekey = x.m_deadlinekey; - - - m_payload = x.m_payload; - - return *this; -} - -HelloMsg& HelloMsg::operator =( - HelloMsg&& x) noexcept -{ - m_deadlinekey = x.m_deadlinekey; - - - m_payload = std::move(x.m_payload); - - return *this; -} - -bool HelloMsg::operator ==( - const HelloMsg& x) const -{ - return (m_deadlinekey == x.m_deadlinekey && - m_payload == x.m_payload); -} - -bool HelloMsg::operator !=( - const HelloMsg& x) const -{ - return !(*this == x); -} - -size_t HelloMsg::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return HelloMsg_max_cdr_typesize; -} - -size_t HelloMsg::getCdrSerializedSize( - const HelloMsg& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.payload().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void HelloMsg::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_deadlinekey; - - scdr << m_payload.c_str(); - -} - -void HelloMsg::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_deadlinekey; - - - - { - std::string aux; - dcdr >> aux; - m_payload = aux.c_str(); - } - - -} - - -bool HelloMsg::isKeyDefined() -{ - return true; -} - -void HelloMsg::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - - scdr << m_deadlinekey; - - -} - -/*! - * @brief This function sets a value in member deadlinekey - * @param _deadlinekey New value for member deadlinekey - */ -void HelloMsg::deadlinekey( - uint16_t _deadlinekey) -{ - m_deadlinekey = _deadlinekey; -} - -/*! - * @brief This function returns the value of member deadlinekey - * @return Value of member deadlinekey - */ -uint16_t HelloMsg::deadlinekey() const -{ - return m_deadlinekey; -} - -/*! - * @brief This function returns a reference to member deadlinekey - * @return Reference to member deadlinekey - */ -uint16_t& HelloMsg::deadlinekey() -{ - return m_deadlinekey; -} - - -/*! - * @brief This function copies the value in member payload - * @param _payload New value to be copied in member payload - */ -void HelloMsg::payload( - const eprosima::fastcdr::fixed_string<256>& _payload) -{ - m_payload = _payload; -} - -/*! - * @brief This function moves the value in member payload - * @param _payload New value to be moved in member payload - */ -void HelloMsg::payload( - eprosima::fastcdr::fixed_string<256>&& _payload) -{ - m_payload = std::move(_payload); -} - -/*! - * @brief This function returns a constant reference to member payload - * @return Constant reference to member payload - */ -const eprosima::fastcdr::fixed_string<256>& HelloMsg::payload() const -{ - return m_payload; -} - -/*! - * @brief This function returns a reference to member payload - * @return Reference to member payload - */ -eprosima::fastcdr::fixed_string<256>& HelloMsg::payload() -{ - return m_payload; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadv1.h b/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadv1.h deleted file mode 100644 index 357516d4e5e..00000000000 --- a/examples/cpp/dds/DeadlineQoSExample/deadlinepayloadv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// 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 deadlinepayload.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_DEADLINEPAYLOAD_H_ -#define _FAST_DDS_GENERATED_DEADLINEPAYLOAD_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(DEADLINEPAYLOAD_SOURCE) -#define DEADLINEPAYLOAD_DllAPI __declspec( dllexport ) -#else -#define DEADLINEPAYLOAD_DllAPI __declspec( dllimport ) -#endif // DEADLINEPAYLOAD_SOURCE -#else -#define DEADLINEPAYLOAD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define DEADLINEPAYLOAD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloMsg defined by the user in the IDL file. - * @ingroup deadlinepayload - */ -class HelloMsg -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloMsg(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloMsg(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloMsg that will be copied. - */ - eProsima_user_DllExport HelloMsg( - const HelloMsg& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloMsg that will be copied. - */ - eProsima_user_DllExport HelloMsg( - HelloMsg&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloMsg that will be copied. - */ - eProsima_user_DllExport HelloMsg& operator =( - const HelloMsg& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloMsg that will be copied. - */ - eProsima_user_DllExport HelloMsg& operator =( - HelloMsg&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloMsg object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloMsg& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloMsg object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloMsg& x) const; - - /*! - * @brief This function sets a value in member deadlinekey - * @param _deadlinekey New value for member deadlinekey - */ - eProsima_user_DllExport void deadlinekey( - uint16_t _deadlinekey); - - /*! - * @brief This function returns the value of member deadlinekey - * @return Value of member deadlinekey - */ - eProsima_user_DllExport uint16_t deadlinekey() const; - - /*! - * @brief This function returns a reference to member deadlinekey - * @return Reference to member deadlinekey - */ - eProsima_user_DllExport uint16_t& deadlinekey(); - - - /*! - * @brief This function copies the value in member payload - * @param _payload New value to be copied in member payload - */ - eProsima_user_DllExport void payload( - const eprosima::fastcdr::fixed_string<256>& _payload); - - /*! - * @brief This function moves the value in member payload - * @param _payload New value to be moved in member payload - */ - eProsima_user_DllExport void payload( - eprosima::fastcdr::fixed_string<256>&& _payload); - - /*! - * @brief This function returns a constant reference to member payload - * @return Constant reference to member payload - */ - eProsima_user_DllExport const eprosima::fastcdr::fixed_string<256>& payload() const; - - /*! - * @brief This function returns a reference to member payload - * @return Reference to member payload - */ - eProsima_user_DllExport eprosima::fastcdr::fixed_string<256>& payload(); - - - /*! - * @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 HelloMsg& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint16_t m_deadlinekey; - eprosima::fastcdr::fixed_string<256> m_payload; - -}; - - -#endif // _FAST_DDS_GENERATED_DEADLINEPAYLOAD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKsPublisher.h b/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKsPublisher.h index 694f227fec9..8c0aa046795 100644 --- a/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKsPublisher.h +++ b/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKsPublisher.h @@ -20,7 +20,7 @@ #ifndef DisablePositiveACKsPublisher_H_ #define DisablePositiveACKsPublisher_H_ -#include "Topic.h" +#include "Topic.hpp" #include "TopicPubSubTypes.h" #include diff --git a/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKsSubscriber.cpp b/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKsSubscriber.cpp index 72186e17663..38569a7fb77 100644 --- a/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKsSubscriber.cpp +++ b/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKsSubscriber.cpp @@ -129,7 +129,7 @@ void DisablePositiveACKsSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(&hello, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&hello, &info) == RETCODE_OK) { if (info.valid_data) { diff --git a/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKsSubscriber.h b/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKsSubscriber.h index 0d383c77717..7423e10579d 100644 --- a/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKsSubscriber.h +++ b/examples/cpp/dds/DisablePositiveACKs/DisablePositiveACKsSubscriber.h @@ -20,8 +20,8 @@ #ifndef DisablePositiveACKsSubscriber_H_ #define DisablePositiveACKsSubscriber_H_ +#include "Topic.hpp" #include "TopicPubSubTypes.h" -#include "Topic.h" #include #include diff --git a/examples/cpp/dds/DisablePositiveACKs/Topic.cxx b/examples/cpp/dds/DisablePositiveACKs/Topic.cxx deleted file mode 100644 index ca86d176ba1..00000000000 --- a/examples/cpp/dds/DisablePositiveACKs/Topic.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// 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 Topic.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Topic.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -Topic::Topic() -{ -} - -Topic::~Topic() -{ -} - -Topic::Topic( - const Topic& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -Topic::Topic( - Topic&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -Topic& Topic::operator =( - const Topic& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -Topic& Topic::operator =( - Topic&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool Topic::operator ==( - const Topic& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool Topic::operator !=( - const Topic& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void Topic::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t Topic::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& Topic::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void Topic::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void Topic::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& Topic::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& Topic::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "TopicCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/LivelinessQoS/Topic.h b/examples/cpp/dds/DisablePositiveACKs/Topic.hpp similarity index 69% rename from examples/cpp/dds/LivelinessQoS/Topic.h rename to examples/cpp/dds/DisablePositiveACKs/Topic.hpp index 2596f317a1e..8f86884c2b8 100644 --- a/examples/cpp/dds/LivelinessQoS/Topic.h +++ b/examples/cpp/dds/DisablePositiveACKs/Topic.hpp @@ -13,32 +13,19 @@ // limitations under the License. /*! - * @file Topic.h + * @file Topic.hpp * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool fastddsgen. */ -#include -#include "Topicv1.h" +#ifndef _FAST_DDS_GENERATED_TOPIC_HPP_ +#define _FAST_DDS_GENERATED_TOPIC_HPP_ -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_TOPIC_H_ -#define _FAST_DDS_GENERATED_TOPIC_H_ - -#include -#include #include -#include #include -#include - +#include #include -#include -#include - - #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -64,17 +51,6 @@ #define TOPIC_DllAPI #endif // _WIN32 -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - /*! * @brief This class represents the structure Topic defined by the user in the IDL file. * @ingroup Topic @@ -86,73 +62,117 @@ class Topic /*! * @brief Default constructor. */ - eProsima_user_DllExport Topic(); + eProsima_user_DllExport Topic() + { + } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~Topic(); + eProsima_user_DllExport ~Topic() + { + } /*! * @brief Copy constructor. * @param x Reference to the object Topic that will be copied. */ eProsima_user_DllExport Topic( - const Topic& x); + const Topic& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } /*! * @brief Move constructor. * @param x Reference to the object Topic that will be copied. */ eProsima_user_DllExport Topic( - Topic&& x) noexcept; + Topic&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } /*! * @brief Copy assignment. * @param x Reference to the object Topic that will be copied. */ eProsima_user_DllExport Topic& operator =( - const Topic& x); + const Topic& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } /*! * @brief Move assignment. * @param x Reference to the object Topic that will be copied. */ eProsima_user_DllExport Topic& operator =( - Topic&& x) noexcept; + Topic&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } /*! * @brief Comparison operator. * @param x Topic object to compare. */ eProsima_user_DllExport bool operator ==( - const Topic& x) const; + const Topic& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } /*! * @brief Comparison operator. * @param x Topic object to compare. */ eProsima_user_DllExport bool operator !=( - const Topic& x) const; + const Topic& x) const + { + return !(*this == x); + } /*! * @brief This function sets a value in member index * @param _index New value for member index */ eProsima_user_DllExport void index( - uint32_t _index); + uint32_t _index) + { + m_index = _index; + } /*! * @brief This function returns the value of member index * @return Value of member index */ - eProsima_user_DllExport uint32_t index() const; + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } /*! * @brief This function returns a reference to member index * @return Reference to member index */ - eProsima_user_DllExport uint32_t& index(); + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } /*! @@ -160,26 +180,40 @@ class Topic * @param _message New value to be copied in member message */ eProsima_user_DllExport void message( - const std::string& _message); + const std::string& _message) + { + m_message = _message; + } /*! * @brief This function moves the value in member message * @param _message New value to be moved in member message */ eProsima_user_DllExport void message( - std::string&& _message); + std::string&& _message) + { + m_message = std::move(_message); + } /*! * @brief This function returns a constant reference to member message * @return Constant reference to member message */ - eProsima_user_DllExport const std::string& message() const; + eProsima_user_DllExport const std::string& message() const + { + return m_message; + } /*! * @brief This function returns a reference to member message * @return Reference to member message */ - eProsima_user_DllExport std::string& message(); + eProsima_user_DllExport std::string& message() + { + return m_message; + } + + private: @@ -188,8 +222,6 @@ class Topic }; -#endif // _FAST_DDS_GENERATED_TOPIC_H_ - +#endif // _FAST_DDS_GENERATED_TOPIC_HPP_ -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/DisablePositiveACKs/TopicCdrAux.hpp b/examples/cpp/dds/DisablePositiveACKs/TopicCdrAux.hpp index 619cdbbb7b8..7b60c44c7b4 100644 --- a/examples/cpp/dds/DisablePositiveACKs/TopicCdrAux.hpp +++ b/examples/cpp/dds/DisablePositiveACKs/TopicCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_TOPICCDRAUX_HPP_ #define _FAST_DDS_GENERATED_TOPICCDRAUX_HPP_ -#include "Topic.h" +#include "Topic.hpp" constexpr uint32_t Topic_max_cdr_typesize {268UL}; constexpr uint32_t Topic_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const Topic& data); diff --git a/examples/cpp/dds/DisablePositiveACKs/TopicCdrAux.ipp b/examples/cpp/dds/DisablePositiveACKs/TopicCdrAux.ipp index ac5a8c39ef9..37570c8a6b2 100644 --- a/examples/cpp/dds/DisablePositiveACKs/TopicCdrAux.ipp +++ b/examples/cpp/dds/DisablePositiveACKs/TopicCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/DisablePositiveACKs/TopicPubSubTypes.cxx b/examples/cpp/dds/DisablePositiveACKs/TopicPubSubTypes.cxx index ce688064a0e..8d6d0b195c9 100644 --- a/examples/cpp/dds/DisablePositiveACKs/TopicPubSubTypes.cxx +++ b/examples/cpp/dds/DisablePositiveACKs/TopicPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "TopicPubSubTypes.h" +#include #include -#include "TopicPubSubTypes.h" #include "TopicCdrAux.hpp" +#include "TopicTypeObjectSupport.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; - - TopicPubSubType::TopicPubSubType() { setName("Topic"); @@ -219,3 +219,11 @@ bool TopicPubSubType::getKey( return true; } +void TopicPubSubType::register_type_object_representation() const +{ + register_Topic_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "TopicCdrAux.ipp" diff --git a/examples/cpp/dds/DisablePositiveACKs/TopicPubSubTypes.h b/examples/cpp/dds/DisablePositiveACKs/TopicPubSubTypes.h index 0e584d6086a..0b37b3746f3 100644 --- a/examples/cpp/dds/DisablePositiveACKs/TopicPubSubTypes.h +++ b/examples/cpp/dds/DisablePositiveACKs/TopicPubSubTypes.h @@ -29,7 +29,7 @@ #include #include -#include "Topic.h" +#include "Topic.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type Topic defined by the user in the IDL file. * @ingroup Topic @@ -90,6 +88,9 @@ class TopicPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/DisablePositiveACKs/TopicTypeObjectSupport.cxx b/examples/cpp/dds/DisablePositiveACKs/TopicTypeObjectSupport.cxx new file mode 100644 index 00000000000..067fd08a822 --- /dev/null +++ b/examples/cpp/dds/DisablePositiveACKs/TopicTypeObjectSupport.cxx @@ -0,0 +1,248 @@ +// 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 TopicTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "TopicTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Topic.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_Topic_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_Topic_type_identifier(); + + }); +} + +void register_Topic_type_identifier() +{ + { + StructTypeFlag struct_flags_Topic = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Topic; + TypeIdentifierPair type_ids_Topic; + QualifiedTypeName type_name_Topic = "Topic"; + eprosima::fastcdr::optional type_ann_builtin_Topic; + eprosima::fastcdr::optional ann_custom_Topic; + CompleteTypeDetail detail_Topic = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Topic, ann_custom_Topic, type_name_Topic.to_string()); + CompleteStructHeader header_Topic; + header_Topic = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Topic); + CompleteStructMemberSeq member_seq_Topic; + { + return_code_Topic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Topic); + + if (return_code_Topic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_Topic.type_identifier1()._d() || TK_NONE == type_ids_Topic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Topic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Topic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_Topic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Topic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Topic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Topic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_Topic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_Topic.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_Topic); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_Topic, member_index); + } + { + return_code_Topic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_Topic); + + if (return_code_Topic != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_Topic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_Topic); + if (return_code_Topic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_Topic.type_identifier1()._d() || TK_NONE == type_ids_Topic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Topic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Topic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_Topic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Topic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Topic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Topic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_Topic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_Topic.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_Topic); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_Topic, member_message); + } + CompleteStructType struct_type_Topic = TypeObjectUtils::build_complete_struct_type(struct_flags_Topic, header_Topic, member_seq_Topic); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Topic, type_name_Topic.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Topic already registered in TypeObjectRegistry for a different type."); + } + return_code_Topic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Topic", type_ids_Topic); + if (return_code_Topic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Topic: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/DisablePositiveACKs/TopicTypeObjectSupport.hpp b/examples/cpp/dds/DisablePositiveACKs/TopicTypeObjectSupport.hpp new file mode 100644 index 00000000000..f0576f9b948 --- /dev/null +++ b/examples/cpp/dds/DisablePositiveACKs/TopicTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// 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 TopicTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_TOPIC_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_TOPIC_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_Topic_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register Topic related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_Topic_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_TOPIC_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/DisablePositiveACKs/Topicv1.cxx b/examples/cpp/dds/DisablePositiveACKs/Topicv1.cxx deleted file mode 100644 index a3e85584242..00000000000 --- a/examples/cpp/dds/DisablePositiveACKs/Topicv1.cxx +++ /dev/null @@ -1,286 +0,0 @@ -// 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 Topic.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Topic.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define Topic_max_cdr_typesize 268ULL; - - - - -Topic::Topic() -{ - // unsigned long m_index - m_index = 0; - // /type_d() m_message - - -} - -Topic::~Topic() -{ -} - -Topic::Topic( - const Topic& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -Topic::Topic( - Topic&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -Topic& Topic::operator =( - const Topic& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -Topic& Topic::operator =( - Topic&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool Topic::operator ==( - const Topic& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool Topic::operator !=( - const Topic& x) const -{ - return !(*this == x); -} - -size_t Topic::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return Topic_max_cdr_typesize; -} - -size_t Topic::getCdrSerializedSize( - const Topic& 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 Topic::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_message.c_str(); - -} - -void Topic::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_message; - - -} - - -bool Topic::isKeyDefined() -{ - return false; -} - -void Topic::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void Topic::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t Topic::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& Topic::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void Topic::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void Topic::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& Topic::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& Topic::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/DisablePositiveACKs/Topicv1.h b/examples/cpp/dds/DisablePositiveACKs/Topicv1.h deleted file mode 100644 index 1e9d07ab2b4..00000000000 --- a/examples/cpp/dds/DisablePositiveACKs/Topicv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// 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 Topic.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_TOPIC_H_ -#define _FAST_DDS_GENERATED_TOPIC_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TOPIC_SOURCE) -#define TOPIC_DllAPI __declspec( dllexport ) -#else -#define TOPIC_DllAPI __declspec( dllimport ) -#endif // TOPIC_SOURCE -#else -#define TOPIC_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TOPIC_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure Topic defined by the user in the IDL file. - * @ingroup Topic - */ -class Topic -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Topic(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Topic(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic( - const Topic& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic( - Topic&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic& operator =( - const Topic& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic& operator =( - Topic&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x Topic object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Topic& x) const; - - /*! - * @brief Comparison operator. - * @param x Topic object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Topic& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - 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 - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - 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 Topic& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint32_t m_index; - std::string m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_TOPIC_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerSubscriber.cpp b/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerSubscriber.cpp index 42402bec60c..b3d65084678 100644 --- a/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerSubscriber.cpp +++ b/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerSubscriber.cpp @@ -275,7 +275,7 @@ void HelloWorldSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - while ((reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) && !is_stopped()) + while ((reader->take_next_sample(&hello_, &info) == RETCODE_OK) && !is_stopped()) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorld.cxx b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorld.cxx deleted file mode 100644 index 4b415d67769..00000000000 --- a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorld.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// 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 HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -HelloWorld::HelloWorld() -{ -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -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 - */ -void HelloWorld::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& HelloWorld::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "HelloWorldCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorld.h b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorld.hpp similarity index 69% rename from examples/cpp/dds/HelloWorldExample/HelloWorld.h rename to examples/cpp/dds/DiscoveryServerExample/types/HelloWorld.hpp index 5cd0ddba511..971fea8d920 100644 --- a/examples/cpp/dds/HelloWorldExample/HelloWorld.h +++ b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorld.hpp @@ -13,32 +13,19 @@ // limitations under the License. /*! - * @file HelloWorld.h + * @file HelloWorld.hpp * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool fastddsgen. */ -#include -#include "HelloWorldv1.h" +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_HPP_ -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - -#include -#include #include -#include #include -#include - +#include #include -#include -#include - - #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -64,17 +51,6 @@ #define HELLOWORLD_DllAPI #endif // _WIN32 -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 @@ -86,73 +62,117 @@ class HelloWorld /*! * @brief Default constructor. */ - eProsima_user_DllExport HelloWorld(); + eProsima_user_DllExport HelloWorld() + { + } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~HelloWorld(); + eProsima_user_DllExport ~HelloWorld() + { + } /*! * @brief Copy constructor. * @param x Reference to the object HelloWorld that will be copied. */ eProsima_user_DllExport HelloWorld( - const HelloWorld& x); + const HelloWorld& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } /*! * @brief Move constructor. * @param x Reference to the object HelloWorld that will be copied. */ eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; + HelloWorld&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } /*! * @brief Copy assignment. * @param x Reference to the object HelloWorld that will be copied. */ eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); + const HelloWorld& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } /*! * @brief Move assignment. * @param x Reference to the object HelloWorld that will be copied. */ eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; + HelloWorld&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } /*! * @brief Comparison operator. * @param x HelloWorld object to compare. */ eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; + const HelloWorld& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } /*! * @brief Comparison operator. * @param x HelloWorld object to compare. */ eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; + const HelloWorld& x) const + { + return !(*this == x); + } /*! * @brief This function sets a value in member index * @param _index New value for member index */ eProsima_user_DllExport void index( - uint32_t _index); + uint32_t _index) + { + m_index = _index; + } /*! * @brief This function returns the value of member index * @return Value of member index */ - eProsima_user_DllExport uint32_t index() const; + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } /*! * @brief This function returns a reference to member index * @return Reference to member index */ - eProsima_user_DllExport uint32_t& index(); + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } /*! @@ -160,26 +180,40 @@ class HelloWorld * @param _message New value to be copied in member message */ eProsima_user_DllExport void message( - const std::string& _message); + const std::string& _message) + { + m_message = _message; + } /*! * @brief This function moves the value in member message * @param _message New value to be moved in member message */ eProsima_user_DllExport void message( - std::string&& _message); + std::string&& _message) + { + m_message = std::move(_message); + } /*! * @brief This function returns a constant reference to member message * @return Constant reference to member message */ - eProsima_user_DllExport const std::string& message() const; + eProsima_user_DllExport const std::string& message() const + { + return m_message; + } /*! * @brief This function returns a reference to member message * @return Reference to member message */ - eProsima_user_DllExport std::string& message(); + eProsima_user_DllExport std::string& message() + { + return m_message; + } + + private: @@ -188,8 +222,6 @@ class HelloWorld }; -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - +#endif // _FAST_DDS_GENERATED_HELLOWORLD_HPP_ -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldCdrAux.hpp b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldCdrAux.hpp index 9f346d306be..6feb8a9da15 100644 --- a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldCdrAux.hpp +++ b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ #define _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ -#include "HelloWorld.h" +#include "HelloWorld.hpp" constexpr uint32_t HelloWorld_max_cdr_typesize {268UL}; constexpr uint32_t HelloWorld_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloWorld& data); diff --git a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldCdrAux.ipp b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldCdrAux.ipp index 42e91f3cc38..97df3fe9d9e 100644 --- a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldCdrAux.ipp +++ b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldPubSubTypes.cxx b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldPubSubTypes.cxx index 85cb477896e..db018e69782 100644 --- a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "HelloWorldPubSubTypes.h" +#include #include -#include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" +#include "HelloWorldTypeObjectSupport.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"); @@ -219,3 +219,11 @@ bool HelloWorldPubSubType::getKey( return true; } +void HelloWorldPubSubType::register_type_object_representation() const +{ + register_HelloWorld_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "HelloWorldCdrAux.ipp" diff --git a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldPubSubTypes.h b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldPubSubTypes.h index 545c68b12b2..a9b4ac119e0 100644 --- a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldPubSubTypes.h +++ b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldPubSubTypes.h @@ -29,7 +29,7 @@ #include #include -#include "HelloWorld.h" +#include "HelloWorld.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -90,6 +88,9 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldTypeObjectSupport.cxx b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldTypeObjectSupport.cxx new file mode 100644 index 00000000000..bfae95694f4 --- /dev/null +++ b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldTypeObjectSupport.cxx @@ -0,0 +1,248 @@ +// 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 HelloWorldTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "HelloWorldTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "HelloWorld.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_HelloWorld_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_HelloWorld_type_identifier(); + + }); +} + +void register_HelloWorld_type_identifier() +{ + { + StructTypeFlag struct_flags_HelloWorld = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_HelloWorld; + TypeIdentifierPair type_ids_HelloWorld; + QualifiedTypeName type_name_HelloWorld = "HelloWorld"; + eprosima::fastcdr::optional type_ann_builtin_HelloWorld; + eprosima::fastcdr::optional ann_custom_HelloWorld; + CompleteTypeDetail detail_HelloWorld = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_HelloWorld, ann_custom_HelloWorld, type_name_HelloWorld.to_string()); + CompleteStructHeader header_HelloWorld; + header_HelloWorld = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_HelloWorld); + CompleteStructMemberSeq member_seq_HelloWorld; + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_HelloWorld); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_index); + } + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_HelloWorld); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_message); + } + CompleteStructType struct_type_HelloWorld = TypeObjectUtils::build_complete_struct_type(struct_flags_HelloWorld, header_HelloWorld, member_seq_HelloWorld); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_HelloWorld, type_name_HelloWorld.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld already registered in TypeObjectRegistry for a different type."); + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "HelloWorld", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldTypeObjectSupport.hpp b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldTypeObjectSupport.hpp new file mode 100644 index 00000000000..8650fc061e0 --- /dev/null +++ b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// 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 HelloWorldTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_HelloWorld_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register HelloWorld related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_HelloWorld_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldv1.cxx b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldv1.cxx deleted file mode 100644 index 90e82ea88a7..00000000000 --- a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldv1.cxx +++ /dev/null @@ -1,286 +0,0 @@ -// 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 HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define HelloWorld_max_cdr_typesize 268ULL; - - - - -HelloWorld::HelloWorld() -{ - // unsigned long m_index - m_index = 0; - // /type_d() m_message - - -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - 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; - - -} - - -bool HelloWorld::isKeyDefined() -{ - return false; -} - -void HelloWorld::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -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 - */ -void HelloWorld::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& HelloWorld::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldv1.h b/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldv1.h deleted file mode 100644 index 8c7406a074a..00000000000 --- a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorldv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// 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 HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloWorld defined by the user in the IDL file. - * @ingroup HelloWorld - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - 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 - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - 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 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; - std::string m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldPublisher.cpp b/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldPublisher.cpp index 4e172f77ae5..d5c6f93a514 100644 --- a/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldPublisher.cpp +++ b/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldPublisher.cpp @@ -26,7 +26,9 @@ #include #include #include -#include +#include +#include +#include using namespace eprosima::fastdds::dds; @@ -38,7 +40,7 @@ HelloWorldPublisher::HelloWorldPublisher() bool HelloWorldPublisher::init() { - if (ReturnCode_t::RETCODE_OK != + if (RETCODE_OK != DomainParticipantFactory::get_instance()->load_XML_profiles_file("helloworld_example_type_profile.xml")) { std::cout << @@ -47,33 +49,21 @@ bool HelloWorldPublisher::init() return false; } - eprosima::fastrtps::types::DynamicTypeBuilder* type; - if (ReturnCode_t::RETCODE_OK != - DomainParticipantFactory::get_instance()->get_dynamic_type_builder_from_xml_by_name("HelloWorld", type)) + DynamicType::_ref_type dyn_type; + if (RETCODE_OK != + DomainParticipantFactory::get_instance()->get_dynamic_type_builder_from_xml_by_name("HelloWorld", + dyn_type)) { std::cout << "Error getting dynamic type \"HelloWorld\"." << std::endl; return false; } - eprosima::fastrtps::types::DynamicType_ptr dyn_type = type->build(); - TypeSupport m_type(new eprosima::fastrtps::types::DynamicPubSubType(dyn_type)); - m_Hello = eprosima::fastrtps::types::DynamicDataFactory::get_instance()->create_data(dyn_type); - - m_Hello->set_string_value("Hello DDS Dynamic World", 0); - m_Hello->set_uint32_value(0, 1); - eprosima::fastrtps::types::DynamicData* array = m_Hello->loan_value(2); - array->set_uint32_value(10, array->get_array_index({0, 0})); - array->set_uint32_value(20, array->get_array_index({1, 0})); - array->set_uint32_value(30, array->get_array_index({2, 0})); - array->set_uint32_value(40, array->get_array_index({3, 0})); - array->set_uint32_value(50, array->get_array_index({4, 0})); - array->set_uint32_value(60, array->get_array_index({0, 1})); - array->set_uint32_value(70, array->get_array_index({1, 1})); - array->set_uint32_value(80, array->get_array_index({2, 1})); - array->set_uint32_value(90, array->get_array_index({3, 1})); - array->set_uint32_value(100, array->get_array_index({4, 1})); - m_Hello->return_loaned_value(array); + TypeSupport m_type(new DynamicPubSubType(dyn_type)); + m_Hello = DynamicDataFactory::get_instance()->create_data(dyn_type); + m_Hello->set_string_value(m_Hello->get_member_id_by_name("message"), "Hello DDS Dynamic World"); + m_Hello->set_uint32_value(m_Hello->get_member_id_by_name("index"), 0); + m_Hello->set_uint32_values(m_Hello->get_member_id_by_name("array"), {10, 20, 30, 40, 50, 60, 70, 80, 90, 100}); DomainParticipantQos pqos; pqos.name("Participant_pub"); @@ -85,8 +75,8 @@ bool HelloWorldPublisher::init() } //REGISTER THE TYPE + //TODO(Xtypes) this property will be removed m_type.get()->auto_fill_type_information(false); - m_type.get()->auto_fill_type_object(true); m_type.register_type(mp_participant); @@ -98,7 +88,7 @@ bool HelloWorldPublisher::init() return false; } - topic_ = mp_participant->create_topic("DDSDynHelloWorldTopic", "HelloWorld", TOPIC_QOS_DEFAULT); + topic_ = mp_participant->create_topic("DDSDynHelloWorldTopic", m_type->getName(), TOPIC_QOS_DEFAULT); if (topic_ == nullptr) { @@ -167,23 +157,23 @@ void HelloWorldPublisher::runThread( if (publish(false)) { std::string message; - m_Hello->get_string_value(message, 0); - uint32_t index; - m_Hello->get_uint32_value(index, 1); + m_Hello->get_string_value(message, m_Hello->get_member_id_by_name("message")); + uint32_t index {0}; + m_Hello->get_uint32_value(index, m_Hello->get_member_id_by_name("index")); + UInt32Seq array; + m_Hello->get_uint32_values(array, m_Hello->get_member_id_by_name("array")); std::string aux_array = "["; - eprosima::fastrtps::types::DynamicData* array = m_Hello->loan_value(2); + for (uint32_t i = 0; i < 5; ++i) { aux_array += "["; for (uint32_t j = 0; j < 2; ++j) { - uint32_t elem; - array->get_uint32_value(elem, array->get_array_index({i, j})); - aux_array += std::to_string(elem) + (j == 1 ? "]" : ", "); + aux_array += std::to_string(array.at((i * 5) + j)) + (j == 1 ? "]" : ", "); } aux_array += (i == 4 ? "]" : "], "); } - m_Hello->return_loaned_value(array); + std::cout << "Message: " << message << " with index: " << index << " array: " << aux_array << " SENT" << std::endl; } @@ -201,23 +191,23 @@ void HelloWorldPublisher::runThread( else { std::string message; - m_Hello->get_string_value(message, 0); - uint32_t index; - m_Hello->get_uint32_value(index, 1); + m_Hello->get_string_value(message, m_Hello->get_member_id_by_name("message")); + uint32_t index {0}; + m_Hello->get_uint32_value(index, m_Hello->get_member_id_by_name("index")); + UInt32Seq array; + m_Hello->get_uint32_values(array, m_Hello->get_member_id_by_name("array")); std::string aux_array = "["; - eprosima::fastrtps::types::DynamicData* array = m_Hello->loan_value(2); + for (uint32_t i = 0; i < 5; ++i) { aux_array += "["; for (uint32_t j = 0; j < 2; ++j) { - uint32_t elem; - array->get_uint32_value(elem, array->get_array_index({i, j})); - aux_array += std::to_string(elem) + (j == 1 ? "]" : ", "); + aux_array += std::to_string(array.at((i * 5) + j)) + (j == 1 ? "]" : ", "); } aux_array += (i == 4 ? "]" : "], "); } - m_Hello->return_loaned_value(array); + std::cout << "Message: " << message << " with index: " << index << " array: " << aux_array << " SENT" << std::endl; } @@ -251,23 +241,13 @@ bool HelloWorldPublisher::publish( if (m_listener.firstConnected || !waitForListener || m_listener.n_matched > 0) { uint32_t index; - m_Hello->get_uint32_value(index, 1); - m_Hello->set_uint32_value(index + 1, 1); - - eprosima::fastrtps::types::DynamicData* array = m_Hello->loan_value(2); - array->set_uint32_value(10 + index, array->get_array_index({0, 0})); - array->set_uint32_value(20 + index, array->get_array_index({1, 0})); - array->set_uint32_value(30 + index, array->get_array_index({2, 0})); - array->set_uint32_value(40 + index, array->get_array_index({3, 0})); - array->set_uint32_value(50 + index, array->get_array_index({4, 0})); - array->set_uint32_value(60 + index, array->get_array_index({0, 1})); - array->set_uint32_value(70 + index, array->get_array_index({1, 1})); - array->set_uint32_value(80 + index, array->get_array_index({2, 1})); - array->set_uint32_value(90 + index, array->get_array_index({3, 1})); - array->set_uint32_value(100 + index, array->get_array_index({4, 1})); - m_Hello->return_loaned_value(array); - - writer_->write(m_Hello.get()); + m_Hello->get_uint32_value(index, m_Hello->get_member_id_by_name("index")); + m_Hello->set_uint32_value(m_Hello->get_member_id_by_name("index"), index + 1); + m_Hello->set_uint32_values(m_Hello->get_member_id_by_name( + "array"), + {10 + index, 20 + index, 30 + index, 40 + index, 50 + index, 60 + index, 70 + index, 80 + index, 90 + index, + 100 + index}); + writer_->write(&m_Hello); return true; } return false; diff --git a/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldPublisher.h b/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldPublisher.h index 39f10fd2e0b..03f734e35aa 100644 --- a/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldPublisher.h +++ b/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldPublisher.h @@ -20,6 +20,8 @@ #ifndef HELLOWORLDPUBLISHER_H_ #define HELLOWORLDPUBLISHER_H_ +#include + #include #include @@ -45,7 +47,7 @@ class HelloWorldPublisher private: - eprosima::fastrtps::types::DynamicData_ptr m_Hello; + eprosima::fastdds::dds::DynamicData::_ref_type m_Hello; eprosima::fastdds::dds::DomainParticipant* mp_participant; diff --git a/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldSubscriber.cpp b/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldSubscriber.cpp index ed1a775ed98..f65d324a2cf 100644 --- a/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldSubscriber.cpp +++ b/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldSubscriber.cpp @@ -27,11 +27,10 @@ #include #include #include -#include -#include +#include +#include using namespace eprosima::fastdds::dds; -using eprosima::fastrtps::types::ReturnCode_t; HelloWorldSubscriber::HelloWorldSubscriber() : mp_participant(nullptr) @@ -56,7 +55,7 @@ bool HelloWorldSubscriber::init() { return false; } - if (mp_participant->enable() != ReturnCode_t::RETCODE_OK) + if (mp_participant->enable() != RETCODE_OK) { DomainParticipantFactory::get_instance()->delete_participant(mp_participant); return false; @@ -115,40 +114,25 @@ void HelloWorldSubscriber::SubListener::on_data_available( if (dit != subscriber_->datas_.end()) { - eprosima::fastrtps::types::DynamicData_ptr data = dit->second; + DynamicData::_ref_type data {dit->second}; SampleInfo info; - if (reader->take_next_sample(data.get(), &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&data, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { - eprosima::fastrtps::types::DynamicType_ptr type = subscriber_->readers_[reader]; + const DynamicType::_ref_type type {subscriber_->readers_[reader]}; this->n_samples++; std::cout << "Received data of type " << type->get_name() << std::endl; - eprosima::fastrtps::types::DynamicDataHelper::print(data); } } } } -void HelloWorldSubscriber::SubListener::on_type_discovery( - DomainParticipant*, - const eprosima::fastrtps::rtps::SampleIdentity&, - const eprosima::fastcdr::string_255& topic_name, - const eprosima::fastrtps::types::TypeIdentifier*, - const eprosima::fastrtps::types::TypeObject*, - eprosima::fastrtps::types::DynamicType_ptr dyn_type) -{ - std::cout << "Discovered type: " << dyn_type->get_name() << " from topic " << topic_name << std::endl; - received_type_ = dyn_type; - reception_flag_.store(true); - types_cv_.notify_one(); -} - void HelloWorldSubscriber::initialize_entities() { auto type = m_listener.received_type_; std::cout << "Initializing DDS entities for type: " << type->get_name() << std::endl; - TypeSupport m_type(new eprosima::fastrtps::types::DynamicPubSubType(type)); + TypeSupport m_type(new DynamicPubSubType(type)); m_type.register_type(mp_participant); if (mp_subscriber == nullptr) @@ -182,8 +166,7 @@ void HelloWorldSubscriber::initialize_entities() topics_[reader] = topic; readers_[reader] = type; - eprosima::fastrtps::types::DynamicData_ptr data( - eprosima::fastrtps::types::DynamicDataFactory::get_instance()->create_data(type)); + DynamicData::_ref_type data {DynamicDataFactory::get_instance()->create_data(type)}; datas_[reader] = data; } diff --git a/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldSubscriber.h b/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldSubscriber.h index 7570cfdd323..447d8685e9f 100644 --- a/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldSubscriber.h +++ b/examples/cpp/dds/DynamicHelloWorldExample/HelloWorldSubscriber.h @@ -29,9 +29,8 @@ #include #include #include -#include -#include -#include +#include +#include class HelloWorldSubscriber { @@ -62,9 +61,9 @@ class HelloWorldSubscriber std::map topics_; - std::map readers_; + std::map readers_; - std::map datas_; + std::map datas_; eprosima::fastdds::dds::DataReaderQos qos_; @@ -94,14 +93,6 @@ class HelloWorldSubscriber eprosima::fastdds::dds::DataReader* reader, const eprosima::fastdds::dds::SubscriptionMatchedStatus& info) override; - void on_type_discovery( - eprosima::fastdds::dds::DomainParticipant* participant, - const eprosima::fastrtps::rtps::SampleIdentity& request_sample_id, - const eprosima::fastcdr::string_255& topic, - const eprosima::fastrtps::types::TypeIdentifier* identifier, - const eprosima::fastrtps::types::TypeObject* object, - eprosima::fastrtps::types::DynamicType_ptr dyn_type) override; - int n_matched; uint32_t n_samples; @@ -110,7 +101,7 @@ class HelloWorldSubscriber std::condition_variable types_cv_; - eprosima::fastrtps::types::DynamicType_ptr received_type_; + eprosima::fastdds::dds::DynamicType::_ref_type received_type_; std::atomic reception_flag_{false}; diff --git a/examples/cpp/dds/Filtering/FilteringExample.cxx b/examples/cpp/dds/Filtering/FilteringExample.cxx deleted file mode 100644 index 3f489150d46..00000000000 --- a/examples/cpp/dds/Filtering/FilteringExample.cxx +++ /dev/null @@ -1,124 +0,0 @@ -// 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 FilteringExample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "FilteringExample.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -FilteringExample::FilteringExample() -{ -} - -FilteringExample::~FilteringExample() -{ -} - -FilteringExample::FilteringExample( - const FilteringExample& x) -{ - m_sampleNumber = x.m_sampleNumber; -} - -FilteringExample::FilteringExample( - FilteringExample&& x) noexcept -{ - m_sampleNumber = x.m_sampleNumber; -} - -FilteringExample& FilteringExample::operator =( - const FilteringExample& x) -{ - - m_sampleNumber = x.m_sampleNumber; - return *this; -} - -FilteringExample& FilteringExample::operator =( - FilteringExample&& x) noexcept -{ - - m_sampleNumber = x.m_sampleNumber; - return *this; -} - -bool FilteringExample::operator ==( - const FilteringExample& x) const -{ - return (m_sampleNumber == x.m_sampleNumber); -} - -bool FilteringExample::operator !=( - const FilteringExample& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member sampleNumber - * @param _sampleNumber New value for member sampleNumber - */ -void FilteringExample::sampleNumber( - int32_t _sampleNumber) -{ - m_sampleNumber = _sampleNumber; -} - -/*! - * @brief This function returns the value of member sampleNumber - * @return Value of member sampleNumber - */ -int32_t FilteringExample::sampleNumber() const -{ - return m_sampleNumber; -} - -/*! - * @brief This function returns a reference to member sampleNumber - * @return Reference to member sampleNumber - */ -int32_t& FilteringExample::sampleNumber() -{ - return m_sampleNumber; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "FilteringExampleCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/Filtering/FilteringExample.h b/examples/cpp/dds/Filtering/FilteringExample.hpp similarity index 72% rename from examples/cpp/dds/Filtering/FilteringExample.h rename to examples/cpp/dds/Filtering/FilteringExample.hpp index c57439eb75c..b79790c6dec 100644 --- a/examples/cpp/dds/Filtering/FilteringExample.h +++ b/examples/cpp/dds/Filtering/FilteringExample.hpp @@ -13,32 +13,17 @@ // limitations under the License. /*! - * @file FilteringExample.h + * @file FilteringExample.hpp * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool fastddsgen. */ -#include -#include "FilteringExamplev1.h" +#ifndef _FAST_DDS_GENERATED_FILTERINGEXAMPLE_HPP_ +#define _FAST_DDS_GENERATED_FILTERINGEXAMPLE_HPP_ -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_FILTERINGEXAMPLE_H_ -#define _FAST_DDS_GENERATED_FILTERINGEXAMPLE_H_ - -#include -#include #include -#include -#include -#include - -#include -#include -#include - - +#include #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -64,17 +49,6 @@ #define FILTERINGEXAMPLE_DllAPI #endif // _WIN32 -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - /*! * @brief This class represents the structure FilteringExample defined by the user in the IDL file. * @ingroup FilteringExample @@ -86,73 +60,112 @@ class FilteringExample /*! * @brief Default constructor. */ - eProsima_user_DllExport FilteringExample(); + eProsima_user_DllExport FilteringExample() + { + } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~FilteringExample(); + eProsima_user_DllExport ~FilteringExample() + { + } /*! * @brief Copy constructor. * @param x Reference to the object FilteringExample that will be copied. */ eProsima_user_DllExport FilteringExample( - const FilteringExample& x); + const FilteringExample& x) + { + m_sampleNumber = x.m_sampleNumber; + + } /*! * @brief Move constructor. * @param x Reference to the object FilteringExample that will be copied. */ eProsima_user_DllExport FilteringExample( - FilteringExample&& x) noexcept; + FilteringExample&& x) noexcept + { + m_sampleNumber = x.m_sampleNumber; + } /*! * @brief Copy assignment. * @param x Reference to the object FilteringExample that will be copied. */ eProsima_user_DllExport FilteringExample& operator =( - const FilteringExample& x); + const FilteringExample& x) + { + + m_sampleNumber = x.m_sampleNumber; + + return *this; + } /*! * @brief Move assignment. * @param x Reference to the object FilteringExample that will be copied. */ eProsima_user_DllExport FilteringExample& operator =( - FilteringExample&& x) noexcept; + FilteringExample&& x) noexcept + { + + m_sampleNumber = x.m_sampleNumber; + return *this; + } /*! * @brief Comparison operator. * @param x FilteringExample object to compare. */ eProsima_user_DllExport bool operator ==( - const FilteringExample& x) const; + const FilteringExample& x) const + { + return (m_sampleNumber == x.m_sampleNumber); + } /*! * @brief Comparison operator. * @param x FilteringExample object to compare. */ eProsima_user_DllExport bool operator !=( - const FilteringExample& x) const; + const FilteringExample& x) const + { + return !(*this == x); + } /*! * @brief This function sets a value in member sampleNumber * @param _sampleNumber New value for member sampleNumber */ eProsima_user_DllExport void sampleNumber( - int32_t _sampleNumber); + int32_t _sampleNumber) + { + m_sampleNumber = _sampleNumber; + } /*! * @brief This function returns the value of member sampleNumber * @return Value of member sampleNumber */ - eProsima_user_DllExport int32_t sampleNumber() const; + eProsima_user_DllExport int32_t sampleNumber() const + { + return m_sampleNumber; + } /*! * @brief This function returns a reference to member sampleNumber * @return Reference to member sampleNumber */ - eProsima_user_DllExport int32_t& sampleNumber(); + eProsima_user_DllExport int32_t& sampleNumber() + { + return m_sampleNumber; + } + + private: @@ -160,8 +173,6 @@ class FilteringExample }; -#endif // _FAST_DDS_GENERATED_FILTERINGEXAMPLE_H_ - +#endif // _FAST_DDS_GENERATED_FILTERINGEXAMPLE_HPP_ -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/Filtering/FilteringExampleCdrAux.hpp b/examples/cpp/dds/Filtering/FilteringExampleCdrAux.hpp index 54b78a2c93a..7b9e9f23d6c 100644 --- a/examples/cpp/dds/Filtering/FilteringExampleCdrAux.hpp +++ b/examples/cpp/dds/Filtering/FilteringExampleCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_FILTERINGEXAMPLECDRAUX_HPP_ #define _FAST_DDS_GENERATED_FILTERINGEXAMPLECDRAUX_HPP_ -#include "FilteringExample.h" +#include "FilteringExample.hpp" constexpr uint32_t FilteringExample_max_cdr_typesize {8UL}; constexpr uint32_t FilteringExample_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const FilteringExample& data); diff --git a/examples/cpp/dds/Filtering/FilteringExampleCdrAux.ipp b/examples/cpp/dds/Filtering/FilteringExampleCdrAux.ipp index d2fdb2c7032..5e95da1ef32 100644 --- a/examples/cpp/dds/Filtering/FilteringExampleCdrAux.ipp +++ b/examples/cpp/dds/Filtering/FilteringExampleCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/Filtering/FilteringExamplePubSubTypes.cxx b/examples/cpp/dds/Filtering/FilteringExamplePubSubTypes.cxx index be0bd937a6b..86c035eec5e 100644 --- a/examples/cpp/dds/Filtering/FilteringExamplePubSubTypes.cxx +++ b/examples/cpp/dds/Filtering/FilteringExamplePubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "FilteringExamplePubSubTypes.h" +#include #include -#include "FilteringExamplePubSubTypes.h" #include "FilteringExampleCdrAux.hpp" +#include "FilteringExampleTypeObjectSupport.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; - - FilteringExamplePubSubType::FilteringExamplePubSubType() { setName("FilteringExample"); @@ -219,3 +219,11 @@ bool FilteringExamplePubSubType::getKey( return true; } +void FilteringExamplePubSubType::register_type_object_representation() const +{ + register_FilteringExample_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "FilteringExampleCdrAux.ipp" diff --git a/examples/cpp/dds/Filtering/FilteringExamplePubSubTypes.h b/examples/cpp/dds/Filtering/FilteringExamplePubSubTypes.h index 7f22c98cb7f..8b75d448159 100644 --- a/examples/cpp/dds/Filtering/FilteringExamplePubSubTypes.h +++ b/examples/cpp/dds/Filtering/FilteringExamplePubSubTypes.h @@ -29,7 +29,7 @@ #include #include -#include "FilteringExample.h" +#include "FilteringExample.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type FilteringExample defined by the user in the IDL file. * @ingroup FilteringExample @@ -90,6 +88,9 @@ class FilteringExamplePubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/Filtering/FilteringExampleSubscriber.cxx b/examples/cpp/dds/Filtering/FilteringExampleSubscriber.cxx index 6a5f254046e..b2bbc02297f 100644 --- a/examples/cpp/dds/Filtering/FilteringExampleSubscriber.cxx +++ b/examples/cpp/dds/Filtering/FilteringExampleSubscriber.cxx @@ -127,7 +127,7 @@ void FilteringExampleSubscriber::SubListener::on_data_available( { SampleInfo info; FilteringExample st; - if (reader->take_next_sample(&st, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&st, &info) == RETCODE_OK) { if (info.valid_data) { diff --git a/examples/cpp/dds/Filtering/FilteringExampleTypeObjectSupport.cxx b/examples/cpp/dds/Filtering/FilteringExampleTypeObjectSupport.cxx new file mode 100644 index 00000000000..24837dd4cc2 --- /dev/null +++ b/examples/cpp/dds/Filtering/FilteringExampleTypeObjectSupport.cxx @@ -0,0 +1,147 @@ +// 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 FilteringExampleTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "FilteringExampleTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "FilteringExample.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_FilteringExample_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_FilteringExample_type_identifier(); + + }); +} + +void register_FilteringExample_type_identifier() +{ + { + StructTypeFlag struct_flags_FilteringExample = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_FilteringExample; + TypeIdentifierPair type_ids_FilteringExample; + QualifiedTypeName type_name_FilteringExample = "FilteringExample"; + eprosima::fastcdr::optional type_ann_builtin_FilteringExample; + eprosima::fastcdr::optional ann_custom_FilteringExample; + CompleteTypeDetail detail_FilteringExample = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_FilteringExample, ann_custom_FilteringExample, type_name_FilteringExample.to_string()); + CompleteStructHeader header_FilteringExample; + header_FilteringExample = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_FilteringExample); + CompleteStructMemberSeq member_seq_FilteringExample; + { + return_code_FilteringExample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_FilteringExample); + + if (return_code_FilteringExample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "sampleNumber Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_sampleNumber = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_sampleNumber; + MemberId member_id_sampleNumber = 0x00000000; + if (EK_COMPLETE == type_ids_FilteringExample.type_identifier1()._d() || TK_NONE == type_ids_FilteringExample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_FilteringExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FilteringExample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_FilteringExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FilteringExample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_FilteringExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FilteringExample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_FilteringExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FilteringExample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_FilteringExample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_FilteringExample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FilteringExample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_FilteringExample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_FilteringExample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FilteringExample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_sampleNumber = TypeObjectUtils::build_common_struct_member(member_id_sampleNumber, member_flags_sampleNumber, type_ids_FilteringExample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_FilteringExample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_FilteringExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FilteringExample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_FilteringExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FilteringExample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_FilteringExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FilteringExample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_FilteringExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FilteringExample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_FilteringExample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_FilteringExample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FilteringExample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_FilteringExample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_FilteringExample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FilteringExample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_sampleNumber = TypeObjectUtils::build_common_struct_member(member_id_sampleNumber, member_flags_sampleNumber, type_ids_FilteringExample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure sampleNumber member TypeIdentifier inconsistent."); + return; + } + MemberName name_sampleNumber = "sampleNumber"; + eprosima::fastcdr::optional member_ann_builtin_sampleNumber; + ann_custom_FilteringExample.reset(); + CompleteMemberDetail detail_sampleNumber = TypeObjectUtils::build_complete_member_detail(name_sampleNumber, member_ann_builtin_sampleNumber, ann_custom_FilteringExample); + CompleteStructMember member_sampleNumber = TypeObjectUtils::build_complete_struct_member(common_sampleNumber, detail_sampleNumber); + TypeObjectUtils::add_complete_struct_member(member_seq_FilteringExample, member_sampleNumber); + } + CompleteStructType struct_type_FilteringExample = TypeObjectUtils::build_complete_struct_type(struct_flags_FilteringExample, header_FilteringExample, member_seq_FilteringExample); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_FilteringExample, type_name_FilteringExample.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "FilteringExample already registered in TypeObjectRegistry for a different type."); + } + return_code_FilteringExample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "FilteringExample", type_ids_FilteringExample); + if (return_code_FilteringExample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "FilteringExample: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/Filtering/FilteringExampleTypeObjectSupport.hpp b/examples/cpp/dds/Filtering/FilteringExampleTypeObjectSupport.hpp new file mode 100644 index 00000000000..a2f76df5a00 --- /dev/null +++ b/examples/cpp/dds/Filtering/FilteringExampleTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// 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 FilteringExampleTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_FILTERINGEXAMPLE_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_FILTERINGEXAMPLE_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_FilteringExample_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register FilteringExample related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_FilteringExample_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_FILTERINGEXAMPLE_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/Filtering/FilteringExamplev1.cxx b/examples/cpp/dds/Filtering/FilteringExamplev1.cxx deleted file mode 100644 index 22b80052278..00000000000 --- a/examples/cpp/dds/Filtering/FilteringExamplev1.cxx +++ /dev/null @@ -1,223 +0,0 @@ -// 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 FilteringExample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "FilteringExample.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define FilteringExample_max_cdr_typesize 8ULL; - - - - -FilteringExample::FilteringExample() -{ - // long m_sampleNumber - m_sampleNumber = 0; - -} - -FilteringExample::~FilteringExample() -{ -} - -FilteringExample::FilteringExample( - const FilteringExample& x) -{ - m_sampleNumber = x.m_sampleNumber; - -} - -FilteringExample::FilteringExample( - FilteringExample&& x) noexcept -{ - m_sampleNumber = x.m_sampleNumber; - -} - -FilteringExample& FilteringExample::operator =( - const FilteringExample& x) -{ - m_sampleNumber = x.m_sampleNumber; - - return *this; -} - -FilteringExample& FilteringExample::operator =( - FilteringExample&& x) noexcept -{ - m_sampleNumber = x.m_sampleNumber; - - return *this; -} - -bool FilteringExample::operator ==( - const FilteringExample& x) const -{ - return (m_sampleNumber == x.m_sampleNumber); -} - -bool FilteringExample::operator !=( - const FilteringExample& x) const -{ - return !(*this == x); -} - -size_t FilteringExample::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return FilteringExample_max_cdr_typesize; -} - -size_t FilteringExample::getCdrSerializedSize( - const FilteringExample& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void FilteringExample::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_sampleNumber; - -} - -void FilteringExample::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_sampleNumber; - - -} - - -bool FilteringExample::isKeyDefined() -{ - return false; -} - -void FilteringExample::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member sampleNumber - * @param _sampleNumber New value for member sampleNumber - */ -void FilteringExample::sampleNumber( - int32_t _sampleNumber) -{ - m_sampleNumber = _sampleNumber; -} - -/*! - * @brief This function returns the value of member sampleNumber - * @return Value of member sampleNumber - */ -int32_t FilteringExample::sampleNumber() const -{ - return m_sampleNumber; -} - -/*! - * @brief This function returns a reference to member sampleNumber - * @return Reference to member sampleNumber - */ -int32_t& FilteringExample::sampleNumber() -{ - return m_sampleNumber; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/Filtering/FilteringExamplev1.h b/examples/cpp/dds/Filtering/FilteringExamplev1.h deleted file mode 100644 index 44231f22028..00000000000 --- a/examples/cpp/dds/Filtering/FilteringExamplev1.h +++ /dev/null @@ -1,216 +0,0 @@ -// 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 FilteringExample.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_FILTERINGEXAMPLE_H_ -#define _FAST_DDS_GENERATED_FILTERINGEXAMPLE_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(FILTERINGEXAMPLE_SOURCE) -#define FILTERINGEXAMPLE_DllAPI __declspec( dllexport ) -#else -#define FILTERINGEXAMPLE_DllAPI __declspec( dllimport ) -#endif // FILTERINGEXAMPLE_SOURCE -#else -#define FILTERINGEXAMPLE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define FILTERINGEXAMPLE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure FilteringExample defined by the user in the IDL file. - * @ingroup FilteringExample - */ -class FilteringExample -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport FilteringExample(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~FilteringExample(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object FilteringExample that will be copied. - */ - eProsima_user_DllExport FilteringExample( - const FilteringExample& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object FilteringExample that will be copied. - */ - eProsima_user_DllExport FilteringExample( - FilteringExample&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object FilteringExample that will be copied. - */ - eProsima_user_DllExport FilteringExample& operator =( - const FilteringExample& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object FilteringExample that will be copied. - */ - eProsima_user_DllExport FilteringExample& operator =( - FilteringExample&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x FilteringExample object to compare. - */ - eProsima_user_DllExport bool operator ==( - const FilteringExample& x) const; - - /*! - * @brief Comparison operator. - * @param x FilteringExample object to compare. - */ - eProsima_user_DllExport bool operator !=( - const FilteringExample& x) const; - - /*! - * @brief This function sets a value in member sampleNumber - * @param _sampleNumber New value for member sampleNumber - */ - eProsima_user_DllExport void sampleNumber( - int32_t _sampleNumber); - - /*! - * @brief This function returns the value of member sampleNumber - * @return Value of member sampleNumber - */ - eProsima_user_DllExport int32_t sampleNumber() const; - - /*! - * @brief This function returns a reference to member sampleNumber - * @return Reference to member sampleNumber - */ - eProsima_user_DllExport int32_t& sampleNumber(); - - - /*! - * @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 FilteringExample& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - int32_t m_sampleNumber; - -}; - - -#endif // _FAST_DDS_GENERATED_FILTERINGEXAMPLE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExample.cxx b/examples/cpp/dds/FlowControlExample/FlowControlExample.cxx deleted file mode 100644 index c38d02771de..00000000000 --- a/examples/cpp/dds/FlowControlExample/FlowControlExample.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// 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 FlowControlExample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "FlowControlExample.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -FlowControlExample::FlowControlExample() -{ -} - -FlowControlExample::~FlowControlExample() -{ -} - -FlowControlExample::FlowControlExample( - const FlowControlExample& x) -{ - m_message = x.m_message; - m_wasFast = x.m_wasFast; -} - -FlowControlExample::FlowControlExample( - FlowControlExample&& x) noexcept -{ - m_message = std::move(x.m_message); - m_wasFast = x.m_wasFast; -} - -FlowControlExample& FlowControlExample::operator =( - const FlowControlExample& x) -{ - - m_message = x.m_message; - m_wasFast = x.m_wasFast; - return *this; -} - -FlowControlExample& FlowControlExample::operator =( - FlowControlExample&& x) noexcept -{ - - m_message = std::move(x.m_message); - m_wasFast = x.m_wasFast; - return *this; -} - -bool FlowControlExample::operator ==( - const FlowControlExample& x) const -{ - return (m_message == x.m_message && - m_wasFast == x.m_wasFast); -} - -bool FlowControlExample::operator !=( - const FlowControlExample& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void FlowControlExample::message( - const std::array& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void FlowControlExample::message( - std::array&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::array& FlowControlExample::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::array& FlowControlExample::message() -{ - return m_message; -} - - -/*! - * @brief This function sets a value in member wasFast - * @param _wasFast New value for member wasFast - */ -void FlowControlExample::wasFast( - char _wasFast) -{ - m_wasFast = _wasFast; -} - -/*! - * @brief This function returns the value of member wasFast - * @return Value of member wasFast - */ -char FlowControlExample::wasFast() const -{ - return m_wasFast; -} - -/*! - * @brief This function returns a reference to member wasFast - * @return Reference to member wasFast - */ -char& FlowControlExample::wasFast() -{ - return m_wasFast; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "FlowControlExampleCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExample.h b/examples/cpp/dds/FlowControlExample/FlowControlExample.hpp similarity index 69% rename from examples/cpp/dds/FlowControlExample/FlowControlExample.h rename to examples/cpp/dds/FlowControlExample/FlowControlExample.hpp index d68406cb810..68bcb6de578 100644 --- a/examples/cpp/dds/FlowControlExample/FlowControlExample.h +++ b/examples/cpp/dds/FlowControlExample/FlowControlExample.hpp @@ -13,32 +13,18 @@ // limitations under the License. /*! - * @file FlowControlExample.h + * @file FlowControlExample.hpp * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool fastddsgen. */ -#include -#include "FlowControlExamplev1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_H_ -#define _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_H_ +#ifndef _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_HPP_ +#define _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_HPP_ #include -#include #include -#include -#include -#include - -#include -#include -#include - - +#include #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -64,17 +50,6 @@ #define FLOWCONTROLEXAMPLE_DllAPI #endif // _WIN32 -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - /*! * @brief This class represents the structure FlowControlExample defined by the user in the IDL file. * @ingroup FlowControlExample @@ -86,80 +61,127 @@ class FlowControlExample /*! * @brief Default constructor. */ - eProsima_user_DllExport FlowControlExample(); + eProsima_user_DllExport FlowControlExample() + { + } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~FlowControlExample(); + eProsima_user_DllExport ~FlowControlExample() + { + } /*! * @brief Copy constructor. * @param x Reference to the object FlowControlExample that will be copied. */ eProsima_user_DllExport FlowControlExample( - const FlowControlExample& x); + const FlowControlExample& x) + { + m_message = x.m_message; + + m_wasFast = x.m_wasFast; + + } /*! * @brief Move constructor. * @param x Reference to the object FlowControlExample that will be copied. */ eProsima_user_DllExport FlowControlExample( - FlowControlExample&& x) noexcept; + FlowControlExample&& x) noexcept + { + m_message = std::move(x.m_message); + m_wasFast = x.m_wasFast; + } /*! * @brief Copy assignment. * @param x Reference to the object FlowControlExample that will be copied. */ eProsima_user_DllExport FlowControlExample& operator =( - const FlowControlExample& x); + const FlowControlExample& x) + { + + m_message = x.m_message; + + m_wasFast = x.m_wasFast; + + return *this; + } /*! * @brief Move assignment. * @param x Reference to the object FlowControlExample that will be copied. */ eProsima_user_DllExport FlowControlExample& operator =( - FlowControlExample&& x) noexcept; + FlowControlExample&& x) noexcept + { + + m_message = std::move(x.m_message); + m_wasFast = x.m_wasFast; + return *this; + } /*! * @brief Comparison operator. * @param x FlowControlExample object to compare. */ eProsima_user_DllExport bool operator ==( - const FlowControlExample& x) const; + const FlowControlExample& x) const + { + return (m_message == x.m_message && + m_wasFast == x.m_wasFast); + } /*! * @brief Comparison operator. * @param x FlowControlExample object to compare. */ eProsima_user_DllExport bool operator !=( - const FlowControlExample& x) const; + const FlowControlExample& x) const + { + return !(*this == x); + } /*! * @brief This function copies the value in member message * @param _message New value to be copied in member message */ eProsima_user_DllExport void message( - const std::array& _message); + const std::array& _message) + { + m_message = _message; + } /*! * @brief This function moves the value in member message * @param _message New value to be moved in member message */ eProsima_user_DllExport void message( - std::array&& _message); + std::array&& _message) + { + m_message = std::move(_message); + } /*! * @brief This function returns a constant reference to member message * @return Constant reference to member message */ - eProsima_user_DllExport const std::array& message() const; + eProsima_user_DllExport const std::array& message() const + { + return m_message; + } /*! * @brief This function returns a reference to member message * @return Reference to member message */ - eProsima_user_DllExport std::array& message(); + eProsima_user_DllExport std::array& message() + { + return m_message; + } /*! @@ -167,19 +189,30 @@ class FlowControlExample * @param _wasFast New value for member wasFast */ eProsima_user_DllExport void wasFast( - char _wasFast); + char _wasFast) + { + m_wasFast = _wasFast; + } /*! * @brief This function returns the value of member wasFast * @return Value of member wasFast */ - eProsima_user_DllExport char wasFast() const; + eProsima_user_DllExport char wasFast() const + { + return m_wasFast; + } /*! * @brief This function returns a reference to member wasFast * @return Reference to member wasFast */ - eProsima_user_DllExport char& wasFast(); + eProsima_user_DllExport char& wasFast() + { + return m_wasFast; + } + + private: @@ -188,8 +221,6 @@ class FlowControlExample }; -#endif // _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_H_ - +#endif // _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_HPP_ -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExampleCdrAux.hpp b/examples/cpp/dds/FlowControlExample/FlowControlExampleCdrAux.hpp index 4ef8e609e19..279a35713c0 100644 --- a/examples/cpp/dds/FlowControlExample/FlowControlExampleCdrAux.hpp +++ b/examples/cpp/dds/FlowControlExample/FlowControlExampleCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLECDRAUX_HPP_ #define _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLECDRAUX_HPP_ -#include "FlowControlExample.h" +#include "FlowControlExample.hpp" constexpr uint32_t FlowControlExample_max_cdr_typesize {600005UL}; constexpr uint32_t FlowControlExample_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const FlowControlExample& data); diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExampleCdrAux.ipp b/examples/cpp/dds/FlowControlExample/FlowControlExampleCdrAux.ipp index 361c67ee3cf..f2f080c5235 100644 --- a/examples/cpp/dds/FlowControlExample/FlowControlExampleCdrAux.ipp +++ b/examples/cpp/dds/FlowControlExample/FlowControlExampleCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExamplePubSubTypes.cxx b/examples/cpp/dds/FlowControlExample/FlowControlExamplePubSubTypes.cxx index 1d375cfbfe3..9267a718200 100644 --- a/examples/cpp/dds/FlowControlExample/FlowControlExamplePubSubTypes.cxx +++ b/examples/cpp/dds/FlowControlExample/FlowControlExamplePubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "FlowControlExamplePubSubTypes.h" +#include #include -#include "FlowControlExamplePubSubTypes.h" #include "FlowControlExampleCdrAux.hpp" +#include "FlowControlExampleTypeObjectSupport.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; - - FlowControlExamplePubSubType::FlowControlExamplePubSubType() { setName("FlowControlExample"); @@ -219,3 +219,11 @@ bool FlowControlExamplePubSubType::getKey( return true; } +void FlowControlExamplePubSubType::register_type_object_representation() const +{ + register_FlowControlExample_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "FlowControlExampleCdrAux.ipp" diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExamplePubSubTypes.h b/examples/cpp/dds/FlowControlExample/FlowControlExamplePubSubTypes.h index 68bb15aaf58..ce79bf04a31 100644 --- a/examples/cpp/dds/FlowControlExample/FlowControlExamplePubSubTypes.h +++ b/examples/cpp/dds/FlowControlExample/FlowControlExamplePubSubTypes.h @@ -29,7 +29,7 @@ #include #include -#include "FlowControlExample.h" +#include "FlowControlExample.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type FlowControlExample defined by the user in the IDL file. * @ingroup FlowControlExample @@ -90,6 +88,9 @@ class FlowControlExamplePubSubType : public eprosima::fastdds::dds::TopicDataTyp eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExampleSubscriber.cxx b/examples/cpp/dds/FlowControlExample/FlowControlExampleSubscriber.cxx index ffff981281c..4edeba1b574 100644 --- a/examples/cpp/dds/FlowControlExample/FlowControlExampleSubscriber.cxx +++ b/examples/cpp/dds/FlowControlExample/FlowControlExampleSubscriber.cxx @@ -124,7 +124,7 @@ void FlowControlExampleSubscriber::SubListener::on_data_available( { SampleInfo info; FlowControlExample st; - if (reader->take_next_sample(&st, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&st, &info) == RETCODE_OK) { if (info.valid_data) { diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExampleTypeObjectSupport.cxx b/examples/cpp/dds/FlowControlExample/FlowControlExampleTypeObjectSupport.cxx new file mode 100644 index 00000000000..b6383b89cc1 --- /dev/null +++ b/examples/cpp/dds/FlowControlExample/FlowControlExampleTypeObjectSupport.cxx @@ -0,0 +1,306 @@ +// 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 FlowControlExampleTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "FlowControlExampleTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "FlowControlExample.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_FlowControlExample_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_FlowControlExample_type_identifier(); + + }); +} + +void register_FlowControlExample_type_identifier() +{ + { + StructTypeFlag struct_flags_FlowControlExample = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_FlowControlExample; + TypeIdentifierPair type_ids_FlowControlExample; + QualifiedTypeName type_name_FlowControlExample = "FlowControlExample"; + eprosima::fastcdr::optional type_ann_builtin_FlowControlExample; + eprosima::fastcdr::optional ann_custom_FlowControlExample; + CompleteTypeDetail detail_FlowControlExample = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_FlowControlExample, ann_custom_FlowControlExample, type_name_FlowControlExample.to_string()); + CompleteStructHeader header_FlowControlExample; + header_FlowControlExample = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_FlowControlExample); + CompleteStructMemberSeq member_seq_FlowControlExample; + { + return_code_FlowControlExample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_char_600000", type_ids_FlowControlExample); + + if (return_code_FlowControlExample != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_FlowControlExample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_char", type_ids_FlowControlExample); + + if (return_code_FlowControlExample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_char_600000 {nullptr}; + if (EK_COMPLETE == type_ids_FlowControlExample.type_identifier1()._d() || TK_NONE == type_ids_FlowControlExample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_FlowControlExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_FlowControlExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_FlowControlExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_FlowControlExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_FlowControlExample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_FlowControlExample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_char_600000 = new TypeIdentifier(type_ids_FlowControlExample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_FlowControlExample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_FlowControlExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_FlowControlExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_FlowControlExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_FlowControlExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_FlowControlExample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_FlowControlExample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_char_600000 = new TypeIdentifier(type_ids_FlowControlExample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_char_600000 = EK_COMPLETE; + if (TK_NONE == type_ids_FlowControlExample.type_identifier2()._d()) + { + equiv_kind_anonymous_array_char_600000 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_char_600000 = 0; + PlainCollectionHeader header_anonymous_array_char_600000 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_char_600000, element_flags_anonymous_array_char_600000); + std::string type_id_kind_anonymous_array_char_600000("TI_PLAIN_ARRAY_LARGE"); + if (type_id_kind_anonymous_array_char_600000 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(600000)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_char_600000, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_char_600000)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_char_600000")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_600000 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(600000)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_char_600000, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_char_600000)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_char_600000")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_600000 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_FlowControlExample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_char_600000", type_ids_FlowControlExample); + if (return_code_FlowControlExample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_600000: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000000; + if (EK_COMPLETE == type_ids_FlowControlExample.type_identifier1()._d() || TK_NONE == type_ids_FlowControlExample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_FlowControlExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_FlowControlExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_FlowControlExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_FlowControlExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_FlowControlExample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_FlowControlExample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_FlowControlExample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_FlowControlExample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_FlowControlExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_FlowControlExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_FlowControlExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_FlowControlExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_FlowControlExample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_FlowControlExample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_FlowControlExample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_FlowControlExample.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_FlowControlExample); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_FlowControlExample, member_message); + } + { + return_code_FlowControlExample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_char", type_ids_FlowControlExample); + + if (return_code_FlowControlExample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "wasFast Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_wasFast = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_wasFast; + MemberId member_id_wasFast = 0x00000001; + if (EK_COMPLETE == type_ids_FlowControlExample.type_identifier1()._d() || TK_NONE == type_ids_FlowControlExample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_FlowControlExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_FlowControlExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_FlowControlExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_FlowControlExample.type_identifier1()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_FlowControlExample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_FlowControlExample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FlowControlExample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_wasFast = TypeObjectUtils::build_common_struct_member(member_id_wasFast, member_flags_wasFast, type_ids_FlowControlExample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_FlowControlExample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_FlowControlExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_FlowControlExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_FlowControlExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_FlowControlExample.type_identifier2()._d() && + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_FlowControlExample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_FlowControlExample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_FlowControlExample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_wasFast = TypeObjectUtils::build_common_struct_member(member_id_wasFast, member_flags_wasFast, type_ids_FlowControlExample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure wasFast member TypeIdentifier inconsistent."); + return; + } + MemberName name_wasFast = "wasFast"; + eprosima::fastcdr::optional member_ann_builtin_wasFast; + ann_custom_FlowControlExample.reset(); + CompleteMemberDetail detail_wasFast = TypeObjectUtils::build_complete_member_detail(name_wasFast, member_ann_builtin_wasFast, ann_custom_FlowControlExample); + CompleteStructMember member_wasFast = TypeObjectUtils::build_complete_struct_member(common_wasFast, detail_wasFast); + TypeObjectUtils::add_complete_struct_member(member_seq_FlowControlExample, member_wasFast); + } + CompleteStructType struct_type_FlowControlExample = TypeObjectUtils::build_complete_struct_type(struct_flags_FlowControlExample, header_FlowControlExample, member_seq_FlowControlExample); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_FlowControlExample, type_name_FlowControlExample.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "FlowControlExample already registered in TypeObjectRegistry for a different type."); + } + return_code_FlowControlExample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "FlowControlExample", type_ids_FlowControlExample); + if (return_code_FlowControlExample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "FlowControlExample: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExampleTypeObjectSupport.hpp b/examples/cpp/dds/FlowControlExample/FlowControlExampleTypeObjectSupport.hpp new file mode 100644 index 00000000000..7caf86c114a --- /dev/null +++ b/examples/cpp/dds/FlowControlExample/FlowControlExampleTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// 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 FlowControlExampleTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_FlowControlExample_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register FlowControlExample related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_FlowControlExample_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExamplev1.cxx b/examples/cpp/dds/FlowControlExample/FlowControlExamplev1.cxx deleted file mode 100644 index 8da82aa6d10..00000000000 --- a/examples/cpp/dds/FlowControlExample/FlowControlExamplev1.cxx +++ /dev/null @@ -1,288 +0,0 @@ -// 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 FlowControlExample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "FlowControlExample.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define FlowControlExample_max_cdr_typesize 600005ULL; - - - - -FlowControlExample::FlowControlExample() -{ - // char m_message - memset(&m_message, 0, ((600000)) * 1); - // char m_wasFast - m_wasFast = 0; - -} - -FlowControlExample::~FlowControlExample() -{ -} - -FlowControlExample::FlowControlExample( - const FlowControlExample& x) -{ - m_message = x.m_message; - - - m_wasFast = x.m_wasFast; - -} - -FlowControlExample::FlowControlExample( - FlowControlExample&& x) noexcept -{ - m_message = std::move(x.m_message); - - - m_wasFast = x.m_wasFast; - -} - -FlowControlExample& FlowControlExample::operator =( - const FlowControlExample& x) -{ - m_message = x.m_message; - - - m_wasFast = x.m_wasFast; - - return *this; -} - -FlowControlExample& FlowControlExample::operator =( - FlowControlExample&& x) noexcept -{ - m_message = std::move(x.m_message); - - - m_wasFast = x.m_wasFast; - - return *this; -} - -bool FlowControlExample::operator ==( - const FlowControlExample& x) const -{ - return (m_message == x.m_message && - m_wasFast == x.m_wasFast); -} - -bool FlowControlExample::operator !=( - const FlowControlExample& x) const -{ - return !(*this == x); -} - -size_t FlowControlExample::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return FlowControlExample_max_cdr_typesize; -} - -size_t FlowControlExample::getCdrSerializedSize( - const FlowControlExample& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += (((600000)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - - -void FlowControlExample::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_message; - - - scdr << m_wasFast; - -} - -void FlowControlExample::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_message; - - - - dcdr >> m_wasFast; - - -} - - -bool FlowControlExample::isKeyDefined() -{ - return false; -} - -void FlowControlExample::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void FlowControlExample::message( - const std::array& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void FlowControlExample::message( - std::array&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::array& FlowControlExample::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::array& FlowControlExample::message() -{ - return m_message; -} - - -/*! - * @brief This function sets a value in member wasFast - * @param _wasFast New value for member wasFast - */ -void FlowControlExample::wasFast( - char _wasFast) -{ - m_wasFast = _wasFast; -} - -/*! - * @brief This function returns the value of member wasFast - * @return Value of member wasFast - */ -char FlowControlExample::wasFast() const -{ - return m_wasFast; -} - -/*! - * @brief This function returns a reference to member wasFast - * @return Reference to member wasFast - */ -char& FlowControlExample::wasFast() -{ - return m_wasFast; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/FlowControlExample/FlowControlExamplev1.h b/examples/cpp/dds/FlowControlExample/FlowControlExamplev1.h deleted file mode 100644 index de00fea2d36..00000000000 --- a/examples/cpp/dds/FlowControlExample/FlowControlExamplev1.h +++ /dev/null @@ -1,244 +0,0 @@ -// 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 FlowControlExample.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_H_ -#define _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(FLOWCONTROLEXAMPLE_SOURCE) -#define FLOWCONTROLEXAMPLE_DllAPI __declspec( dllexport ) -#else -#define FLOWCONTROLEXAMPLE_DllAPI __declspec( dllimport ) -#endif // FLOWCONTROLEXAMPLE_SOURCE -#else -#define FLOWCONTROLEXAMPLE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define FLOWCONTROLEXAMPLE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure FlowControlExample defined by the user in the IDL file. - * @ingroup FlowControlExample - */ -class FlowControlExample -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport FlowControlExample(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~FlowControlExample(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object FlowControlExample that will be copied. - */ - eProsima_user_DllExport FlowControlExample( - const FlowControlExample& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object FlowControlExample that will be copied. - */ - eProsima_user_DllExport FlowControlExample( - FlowControlExample&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object FlowControlExample that will be copied. - */ - eProsima_user_DllExport FlowControlExample& operator =( - const FlowControlExample& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object FlowControlExample that will be copied. - */ - eProsima_user_DllExport FlowControlExample& operator =( - FlowControlExample&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x FlowControlExample object to compare. - */ - eProsima_user_DllExport bool operator ==( - const FlowControlExample& x) const; - - /*! - * @brief Comparison operator. - * @param x FlowControlExample object to compare. - */ - eProsima_user_DllExport bool operator !=( - const FlowControlExample& x) const; - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::array& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::array&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::array& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::array& message(); - - - /*! - * @brief This function sets a value in member wasFast - * @param _wasFast New value for member wasFast - */ - eProsima_user_DllExport void wasFast( - char _wasFast); - - /*! - * @brief This function returns the value of member wasFast - * @return Value of member wasFast - */ - eProsima_user_DllExport char wasFast() const; - - /*! - * @brief This function returns a reference to member wasFast - * @return Reference to member wasFast - */ - eProsima_user_DllExport char& wasFast(); - - - /*! - * @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 FlowControlExample& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::array m_message; - char m_wasFast; - -}; - - -#endif // _FAST_DDS_GENERATED_FLOWCONTROLEXAMPLE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorld.cxx b/examples/cpp/dds/HelloWorldExample/HelloWorld.cxx deleted file mode 100644 index 4b415d67769..00000000000 --- a/examples/cpp/dds/HelloWorldExample/HelloWorld.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// 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 HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -HelloWorld::HelloWorld() -{ -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -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 - */ -void HelloWorld::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& HelloWorld::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "HelloWorldCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorld.h b/examples/cpp/dds/HelloWorldExample/HelloWorld.hpp similarity index 69% rename from examples/cpp/dds/DiscoveryServerExample/types/HelloWorld.h rename to examples/cpp/dds/HelloWorldExample/HelloWorld.hpp index 5cd0ddba511..971fea8d920 100644 --- a/examples/cpp/dds/DiscoveryServerExample/types/HelloWorld.h +++ b/examples/cpp/dds/HelloWorldExample/HelloWorld.hpp @@ -13,32 +13,19 @@ // limitations under the License. /*! - * @file HelloWorld.h + * @file HelloWorld.hpp * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool fastddsgen. */ -#include -#include "HelloWorldv1.h" +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_HPP_ -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - -#include -#include #include -#include #include -#include - +#include #include -#include -#include - - #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -64,17 +51,6 @@ #define HELLOWORLD_DllAPI #endif // _WIN32 -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 @@ -86,73 +62,117 @@ class HelloWorld /*! * @brief Default constructor. */ - eProsima_user_DllExport HelloWorld(); + eProsima_user_DllExport HelloWorld() + { + } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~HelloWorld(); + eProsima_user_DllExport ~HelloWorld() + { + } /*! * @brief Copy constructor. * @param x Reference to the object HelloWorld that will be copied. */ eProsima_user_DllExport HelloWorld( - const HelloWorld& x); + const HelloWorld& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } /*! * @brief Move constructor. * @param x Reference to the object HelloWorld that will be copied. */ eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; + HelloWorld&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } /*! * @brief Copy assignment. * @param x Reference to the object HelloWorld that will be copied. */ eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); + const HelloWorld& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } /*! * @brief Move assignment. * @param x Reference to the object HelloWorld that will be copied. */ eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; + HelloWorld&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } /*! * @brief Comparison operator. * @param x HelloWorld object to compare. */ eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; + const HelloWorld& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } /*! * @brief Comparison operator. * @param x HelloWorld object to compare. */ eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; + const HelloWorld& x) const + { + return !(*this == x); + } /*! * @brief This function sets a value in member index * @param _index New value for member index */ eProsima_user_DllExport void index( - uint32_t _index); + uint32_t _index) + { + m_index = _index; + } /*! * @brief This function returns the value of member index * @return Value of member index */ - eProsima_user_DllExport uint32_t index() const; + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } /*! * @brief This function returns a reference to member index * @return Reference to member index */ - eProsima_user_DllExport uint32_t& index(); + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } /*! @@ -160,26 +180,40 @@ class HelloWorld * @param _message New value to be copied in member message */ eProsima_user_DllExport void message( - const std::string& _message); + const std::string& _message) + { + m_message = _message; + } /*! * @brief This function moves the value in member message * @param _message New value to be moved in member message */ eProsima_user_DllExport void message( - std::string&& _message); + std::string&& _message) + { + m_message = std::move(_message); + } /*! * @brief This function returns a constant reference to member message * @return Constant reference to member message */ - eProsima_user_DllExport const std::string& message() const; + eProsima_user_DllExport const std::string& message() const + { + return m_message; + } /*! * @brief This function returns a reference to member message * @return Reference to member message */ - eProsima_user_DllExport std::string& message(); + eProsima_user_DllExport std::string& message() + { + return m_message; + } + + private: @@ -188,8 +222,6 @@ class HelloWorld }; -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - +#endif // _FAST_DDS_GENERATED_HELLOWORLD_HPP_ -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorldCdrAux.hpp b/examples/cpp/dds/HelloWorldExample/HelloWorldCdrAux.hpp index 9f346d306be..6feb8a9da15 100644 --- a/examples/cpp/dds/HelloWorldExample/HelloWorldCdrAux.hpp +++ b/examples/cpp/dds/HelloWorldExample/HelloWorldCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ #define _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ -#include "HelloWorld.h" +#include "HelloWorld.hpp" constexpr uint32_t HelloWorld_max_cdr_typesize {268UL}; constexpr uint32_t HelloWorld_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloWorld& data); diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorldCdrAux.ipp b/examples/cpp/dds/HelloWorldExample/HelloWorldCdrAux.ipp index 42e91f3cc38..97df3fe9d9e 100644 --- a/examples/cpp/dds/HelloWorldExample/HelloWorldCdrAux.ipp +++ b/examples/cpp/dds/HelloWorldExample/HelloWorldCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorldPubSubTypes.cxx b/examples/cpp/dds/HelloWorldExample/HelloWorldPubSubTypes.cxx index 85cb477896e..db018e69782 100644 --- a/examples/cpp/dds/HelloWorldExample/HelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/HelloWorldExample/HelloWorldPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "HelloWorldPubSubTypes.h" +#include #include -#include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" +#include "HelloWorldTypeObjectSupport.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"); @@ -219,3 +219,11 @@ bool HelloWorldPubSubType::getKey( return true; } +void HelloWorldPubSubType::register_type_object_representation() const +{ + register_HelloWorld_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "HelloWorldCdrAux.ipp" diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorldPubSubTypes.h b/examples/cpp/dds/HelloWorldExample/HelloWorldPubSubTypes.h index 545c68b12b2..a9b4ac119e0 100644 --- a/examples/cpp/dds/HelloWorldExample/HelloWorldPubSubTypes.h +++ b/examples/cpp/dds/HelloWorldExample/HelloWorldPubSubTypes.h @@ -29,7 +29,7 @@ #include #include -#include "HelloWorld.h" +#include "HelloWorld.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -90,6 +88,9 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorldSubscriber.cpp b/examples/cpp/dds/HelloWorldExample/HelloWorldSubscriber.cpp index 9c65d38ffcb..680194c85b8 100644 --- a/examples/cpp/dds/HelloWorldExample/HelloWorldSubscriber.cpp +++ b/examples/cpp/dds/HelloWorldExample/HelloWorldSubscriber.cpp @@ -156,7 +156,7 @@ void HelloWorldSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&hello_, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorldTypeObjectSupport.cxx b/examples/cpp/dds/HelloWorldExample/HelloWorldTypeObjectSupport.cxx new file mode 100644 index 00000000000..bfae95694f4 --- /dev/null +++ b/examples/cpp/dds/HelloWorldExample/HelloWorldTypeObjectSupport.cxx @@ -0,0 +1,248 @@ +// 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 HelloWorldTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "HelloWorldTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "HelloWorld.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_HelloWorld_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_HelloWorld_type_identifier(); + + }); +} + +void register_HelloWorld_type_identifier() +{ + { + StructTypeFlag struct_flags_HelloWorld = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_HelloWorld; + TypeIdentifierPair type_ids_HelloWorld; + QualifiedTypeName type_name_HelloWorld = "HelloWorld"; + eprosima::fastcdr::optional type_ann_builtin_HelloWorld; + eprosima::fastcdr::optional ann_custom_HelloWorld; + CompleteTypeDetail detail_HelloWorld = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_HelloWorld, ann_custom_HelloWorld, type_name_HelloWorld.to_string()); + CompleteStructHeader header_HelloWorld; + header_HelloWorld = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_HelloWorld); + CompleteStructMemberSeq member_seq_HelloWorld; + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_HelloWorld); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_index); + } + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_HelloWorld); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_message); + } + CompleteStructType struct_type_HelloWorld = TypeObjectUtils::build_complete_struct_type(struct_flags_HelloWorld, header_HelloWorld, member_seq_HelloWorld); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_HelloWorld, type_name_HelloWorld.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld already registered in TypeObjectRegistry for a different type."); + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "HelloWorld", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorldTypeObjectSupport.hpp b/examples/cpp/dds/HelloWorldExample/HelloWorldTypeObjectSupport.hpp new file mode 100644 index 00000000000..8650fc061e0 --- /dev/null +++ b/examples/cpp/dds/HelloWorldExample/HelloWorldTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// 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 HelloWorldTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_HelloWorld_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register HelloWorld related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_HelloWorld_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorldv1.cxx b/examples/cpp/dds/HelloWorldExample/HelloWorldv1.cxx deleted file mode 100644 index 90e82ea88a7..00000000000 --- a/examples/cpp/dds/HelloWorldExample/HelloWorldv1.cxx +++ /dev/null @@ -1,286 +0,0 @@ -// 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 HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define HelloWorld_max_cdr_typesize 268ULL; - - - - -HelloWorld::HelloWorld() -{ - // unsigned long m_index - m_index = 0; - // /type_d() m_message - - -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - 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; - - -} - - -bool HelloWorld::isKeyDefined() -{ - return false; -} - -void HelloWorld::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -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 - */ -void HelloWorld::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& HelloWorld::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/HelloWorldExample/HelloWorldv1.h b/examples/cpp/dds/HelloWorldExample/HelloWorldv1.h deleted file mode 100644 index 8c7406a074a..00000000000 --- a/examples/cpp/dds/HelloWorldExample/HelloWorldv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// 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 HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloWorld defined by the user in the IDL file. - * @ingroup HelloWorld - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - 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 - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - 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 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; - std::string m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.cxx b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.cxx deleted file mode 100644 index 3622c2401de..00000000000 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// 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 HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -HelloWorld::HelloWorld() -{ -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -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 - */ -void HelloWorld::message( - const eprosima::fastcdr::fixed_string<20>& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - eprosima::fastcdr::fixed_string<20>&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const eprosima::fastcdr::fixed_string<20>& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -eprosima::fastcdr::fixed_string<20>& HelloWorld::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "HelloWorldCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.h b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.hpp similarity index 72% rename from examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.h rename to examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.hpp index 3488835aafe..22c4f7b2cda 100644 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.h +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorld.hpp @@ -13,32 +13,19 @@ // limitations under the License. /*! - * @file HelloWorld.h + * @file HelloWorld.hpp * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool fastddsgen. */ -#include -#include "HelloWorldv1.h" +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_HPP_ -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - -#include -#include #include -#include #include -#include - +#include #include -#include -#include - - #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -64,17 +51,6 @@ #define HELLOWORLD_DllAPI #endif // _WIN32 -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 @@ -86,73 +62,117 @@ class HelloWorld /*! * @brief Default constructor. */ - eProsima_user_DllExport HelloWorld(); + eProsima_user_DllExport HelloWorld() + { + } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~HelloWorld(); + eProsima_user_DllExport ~HelloWorld() + { + } /*! * @brief Copy constructor. * @param x Reference to the object HelloWorld that will be copied. */ eProsima_user_DllExport HelloWorld( - const HelloWorld& x); + const HelloWorld& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } /*! * @brief Move constructor. * @param x Reference to the object HelloWorld that will be copied. */ eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; + HelloWorld&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } /*! * @brief Copy assignment. * @param x Reference to the object HelloWorld that will be copied. */ eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); + const HelloWorld& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } /*! * @brief Move assignment. * @param x Reference to the object HelloWorld that will be copied. */ eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; + HelloWorld&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } /*! * @brief Comparison operator. * @param x HelloWorld object to compare. */ eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; + const HelloWorld& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } /*! * @brief Comparison operator. * @param x HelloWorld object to compare. */ eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; + const HelloWorld& x) const + { + return !(*this == x); + } /*! * @brief This function sets a value in member index * @param _index New value for member index */ eProsima_user_DllExport void index( - uint32_t _index); + uint32_t _index) + { + m_index = _index; + } /*! * @brief This function returns the value of member index * @return Value of member index */ - eProsima_user_DllExport uint32_t index() const; + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } /*! * @brief This function returns a reference to member index * @return Reference to member index */ - eProsima_user_DllExport uint32_t& index(); + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } /*! @@ -160,26 +180,40 @@ class HelloWorld * @param _message New value to be copied in member message */ eProsima_user_DllExport void message( - const eprosima::fastcdr::fixed_string<20>& _message); + const eprosima::fastcdr::fixed_string<20>& _message) + { + m_message = _message; + } /*! * @brief This function moves the value in member message * @param _message New value to be moved in member message */ eProsima_user_DllExport void message( - eprosima::fastcdr::fixed_string<20>&& _message); + eprosima::fastcdr::fixed_string<20>&& _message) + { + m_message = std::move(_message); + } /*! * @brief This function returns a constant reference to member message * @return Constant reference to member message */ - eProsima_user_DllExport const eprosima::fastcdr::fixed_string<20>& message() const; + eProsima_user_DllExport const eprosima::fastcdr::fixed_string<20>& message() const + { + return m_message; + } /*! * @brief This function returns a reference to member message * @return Reference to member message */ - eProsima_user_DllExport eprosima::fastcdr::fixed_string<20>& message(); + eProsima_user_DllExport eprosima::fastcdr::fixed_string<20>& message() + { + return m_message; + } + + private: @@ -188,8 +222,6 @@ class HelloWorld }; -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - +#endif // _FAST_DDS_GENERATED_HELLOWORLD_HPP_ -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldCdrAux.hpp b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldCdrAux.hpp index b0d081fe956..5d8548e14b8 100644 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldCdrAux.hpp +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ #define _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ -#include "HelloWorld.h" +#include "HelloWorld.hpp" constexpr uint32_t HelloWorld_max_cdr_typesize {33UL}; constexpr uint32_t HelloWorld_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloWorld& data); diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldCdrAux.ipp b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldCdrAux.ipp index 42e91f3cc38..97df3fe9d9e 100644 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldCdrAux.ipp +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldPubSubTypes.cxx b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldPubSubTypes.cxx index 85cb477896e..db018e69782 100644 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "HelloWorldPubSubTypes.h" +#include #include -#include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" +#include "HelloWorldTypeObjectSupport.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"); @@ -219,3 +219,11 @@ bool HelloWorldPubSubType::getKey( return true; } +void HelloWorldPubSubType::register_type_object_representation() const +{ + register_HelloWorld_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "HelloWorldCdrAux.ipp" diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldPubSubTypes.h b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldPubSubTypes.h index 44dc2c8493d..52736f6dad8 100644 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldPubSubTypes.h +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldPubSubTypes.h @@ -29,7 +29,7 @@ #include #include -#include "HelloWorld.h" +#include "HelloWorld.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -90,6 +88,9 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldSubscriber.cpp b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldSubscriber.cpp index 365f0934271..690cdfdab64 100644 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldSubscriber.cpp +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldSubscriber.cpp @@ -129,7 +129,7 @@ void HelloWorldSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&hello_, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldTypeObjectSupport.cxx b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldTypeObjectSupport.cxx new file mode 100644 index 00000000000..7049f02b87e --- /dev/null +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldTypeObjectSupport.cxx @@ -0,0 +1,248 @@ +// 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 HelloWorldTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "HelloWorldTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "HelloWorld.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_HelloWorld_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_HelloWorld_type_identifier(); + + }); +} + +void register_HelloWorld_type_identifier() +{ + { + StructTypeFlag struct_flags_HelloWorld = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_HelloWorld; + TypeIdentifierPair type_ids_HelloWorld; + QualifiedTypeName type_name_HelloWorld = "HelloWorld"; + eprosima::fastcdr::optional type_ann_builtin_HelloWorld; + eprosima::fastcdr::optional ann_custom_HelloWorld; + CompleteTypeDetail detail_HelloWorld = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_HelloWorld, ann_custom_HelloWorld, type_name_HelloWorld.to_string()); + CompleteStructHeader header_HelloWorld; + header_HelloWorld = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_HelloWorld); + CompleteStructMemberSeq member_seq_HelloWorld; + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_HelloWorld); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_index); + } + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_20", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_20("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_20 == "TI_STRING8_SMALL") + { + SBound bound = static_cast(20); + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_20")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_20 already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_20 == "TI_STRING8_LARGE") + { + LBound bound = 20; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_20")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_20 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_20: Unknown String kind."); + return; + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_20", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_20: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_HelloWorld); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_message); + } + CompleteStructType struct_type_HelloWorld = TypeObjectUtils::build_complete_struct_type(struct_flags_HelloWorld, header_HelloWorld, member_seq_HelloWorld); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_HelloWorld, type_name_HelloWorld.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld already registered in TypeObjectRegistry for a different type."); + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "HelloWorld", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldTypeObjectSupport.hpp b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldTypeObjectSupport.hpp new file mode 100644 index 00000000000..8650fc061e0 --- /dev/null +++ b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// 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 HelloWorldTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_HelloWorld_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register HelloWorld related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_HelloWorld_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldv1.cxx b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldv1.cxx deleted file mode 100644 index 77c66ce8325..00000000000 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldv1.cxx +++ /dev/null @@ -1,290 +0,0 @@ -// 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 HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define HelloWorld_max_cdr_typesize 33ULL; - - - - -HelloWorld::HelloWorld() -{ - // unsigned long m_index - m_index = 0; - // /type_d() m_message - - -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - 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; - - - - { - std::string aux; - dcdr >> aux; - m_message = aux.c_str(); - } - - -} - - -bool HelloWorld::isKeyDefined() -{ - return false; -} - -void HelloWorld::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -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 - */ -void HelloWorld::message( - const eprosima::fastcdr::fixed_string<20>& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - eprosima::fastcdr::fixed_string<20>&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const eprosima::fastcdr::fixed_string<20>& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -eprosima::fastcdr::fixed_string<20>& HelloWorld::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldv1.h b/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldv1.h deleted file mode 100644 index 4f06824f719..00000000000 --- a/examples/cpp/dds/HelloWorldExampleDataSharing/HelloWorldv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// 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 HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloWorld defined by the user in the IDL file. - * @ingroup HelloWorld - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - 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 - */ - eProsima_user_DllExport void message( - const eprosima::fastcdr::fixed_string<20>& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - eprosima::fastcdr::fixed_string<20>&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const eprosima::fastcdr::fixed_string<20>& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport eprosima::fastcdr::fixed_string<20>& 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 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; - eprosima::fastcdr::fixed_string<20> m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.cxx b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.cxx deleted file mode 100644 index 68c604b6588..00000000000 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.cxx +++ /dev/null @@ -1,212 +0,0 @@ -// 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 HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -HelloWorld::HelloWorld() -{ -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - m_message = x.m_message; - m_data = x.m_data; -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); - m_data = std::move(x.m_data); -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - m_data = x.m_data; - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - m_data = std::move(x.m_data); - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message && - m_data == x.m_data); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -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 - */ -void HelloWorld::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& HelloWorld::message() -{ - return m_message; -} - - -/*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ -void HelloWorld::data( - const std::array& _data) -{ - m_data = _data; -} - -/*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ -void HelloWorld::data( - std::array&& _data) -{ - m_data = std::move(_data); -} - -/*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ -const std::array& HelloWorld::data() const -{ - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -std::array& HelloWorld::data() -{ - return m_data; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "HelloWorldCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.h b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.hpp similarity index 67% rename from examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.h rename to examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.hpp index 1fa4522175d..7fbb251328b 100644 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.h +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorld.hpp @@ -13,32 +13,20 @@ // limitations under the License. /*! - * @file HelloWorld.h + * @file HelloWorld.hpp * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool fastddsgen. */ -#include -#include "HelloWorldv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_HPP_ #include -#include #include -#include #include -#include - +#include #include -#include -#include - - #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -64,17 +52,6 @@ #define HELLOWORLD_DllAPI #endif // _WIN32 -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 @@ -86,73 +63,124 @@ class HelloWorld /*! * @brief Default constructor. */ - eProsima_user_DllExport HelloWorld(); + eProsima_user_DllExport HelloWorld() + { + } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~HelloWorld(); + eProsima_user_DllExport ~HelloWorld() + { + } /*! * @brief Copy constructor. * @param x Reference to the object HelloWorld that will be copied. */ eProsima_user_DllExport HelloWorld( - const HelloWorld& x); + const HelloWorld& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + m_data = x.m_data; + + } /*! * @brief Move constructor. * @param x Reference to the object HelloWorld that will be copied. */ eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; + HelloWorld&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + m_data = std::move(x.m_data); + } /*! * @brief Copy assignment. * @param x Reference to the object HelloWorld that will be copied. */ eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); + const HelloWorld& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + m_data = x.m_data; + + return *this; + } /*! * @brief Move assignment. * @param x Reference to the object HelloWorld that will be copied. */ eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; + HelloWorld&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + m_data = std::move(x.m_data); + return *this; + } /*! * @brief Comparison operator. * @param x HelloWorld object to compare. */ eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; + const HelloWorld& x) const + { + return (m_index == x.m_index && + m_message == x.m_message && + m_data == x.m_data); + } /*! * @brief Comparison operator. * @param x HelloWorld object to compare. */ eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; + const HelloWorld& x) const + { + return !(*this == x); + } /*! * @brief This function sets a value in member index * @param _index New value for member index */ eProsima_user_DllExport void index( - uint32_t _index); + uint32_t _index) + { + m_index = _index; + } /*! * @brief This function returns the value of member index * @return Value of member index */ - eProsima_user_DllExport uint32_t index() const; + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } /*! * @brief This function returns a reference to member index * @return Reference to member index */ - eProsima_user_DllExport uint32_t& index(); + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } /*! @@ -160,26 +188,38 @@ class HelloWorld * @param _message New value to be copied in member message */ eProsima_user_DllExport void message( - const std::string& _message); + const std::string& _message) + { + m_message = _message; + } /*! * @brief This function moves the value in member message * @param _message New value to be moved in member message */ eProsima_user_DllExport void message( - std::string&& _message); + std::string&& _message) + { + m_message = std::move(_message); + } /*! * @brief This function returns a constant reference to member message * @return Constant reference to member message */ - eProsima_user_DllExport const std::string& message() const; + eProsima_user_DllExport const std::string& message() const + { + return m_message; + } /*! * @brief This function returns a reference to member message * @return Reference to member message */ - eProsima_user_DllExport std::string& message(); + eProsima_user_DllExport std::string& message() + { + return m_message; + } /*! @@ -187,26 +227,40 @@ class HelloWorld * @param _data New value to be copied in member data */ eProsima_user_DllExport void data( - const std::array& _data); + const std::array& _data) + { + m_data = _data; + } /*! * @brief This function moves the value in member data * @param _data New value to be moved in member data */ eProsima_user_DllExport void data( - std::array&& _data); + std::array&& _data) + { + m_data = std::move(_data); + } /*! * @brief This function returns a constant reference to member data * @return Constant reference to member data */ - eProsima_user_DllExport const std::array& data() const; + eProsima_user_DllExport const std::array& data() const + { + return m_data; + } /*! * @brief This function returns a reference to member data * @return Reference to member data */ - eProsima_user_DllExport std::array& data(); + eProsima_user_DllExport std::array& data() + { + return m_data; + } + + private: @@ -216,8 +270,6 @@ class HelloWorld }; -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - +#endif // _FAST_DDS_GENERATED_HELLOWORLD_HPP_ -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldCdrAux.hpp b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldCdrAux.hpp index 77b8e2a63aa..2755baecef9 100644 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldCdrAux.hpp +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ #define _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ -#include "HelloWorld.h" +#include "HelloWorld.hpp" constexpr uint32_t HelloWorld_max_cdr_typesize {1048844UL}; constexpr uint32_t HelloWorld_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloWorld& data); diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldCdrAux.ipp b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldCdrAux.ipp index 2243fe1af8d..bcdc3a4d321 100644 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldCdrAux.ipp +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPubSubTypes.cxx b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPubSubTypes.cxx index 85cb477896e..db018e69782 100644 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "HelloWorldPubSubTypes.h" +#include #include -#include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" +#include "HelloWorldTypeObjectSupport.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"); @@ -219,3 +219,11 @@ bool HelloWorldPubSubType::getKey( return true; } +void HelloWorldPubSubType::register_type_object_representation() const +{ + register_HelloWorld_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "HelloWorldCdrAux.ipp" diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPubSubTypes.h b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPubSubTypes.h index 545c68b12b2..a9b4ac119e0 100644 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPubSubTypes.h +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPubSubTypes.h @@ -29,7 +29,7 @@ #include #include -#include "HelloWorld.h" +#include "HelloWorld.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -90,6 +88,9 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPublisher.h b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPublisher.h index b3728ca47ad..ef37aa5f383 100644 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPublisher.h +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldPublisher.h @@ -28,7 +28,7 @@ #include #include -#include "HelloWorld.h" +#include "HelloWorld.hpp" class HelloWorldPublisher { diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldSubscriber.cpp b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldSubscriber.cpp index 9afd1360353..77a438830bf 100644 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldSubscriber.cpp +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldSubscriber.cpp @@ -146,7 +146,7 @@ void HelloWorldSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(hello_.get(), &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(hello_.get(), &info) == RETCODE_OK) { if (info.valid_data) { diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldSubscriber.h b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldSubscriber.h index d6be44aaf28..706ca6ada3d 100644 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldSubscriber.h +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldSubscriber.h @@ -28,7 +28,7 @@ #include #include -#include "HelloWorld.h" +#include "HelloWorld.hpp" class HelloWorldSubscriber { diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldTypeObjectSupport.cxx b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldTypeObjectSupport.cxx new file mode 100644 index 00000000000..afeb68f5251 --- /dev/null +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldTypeObjectSupport.cxx @@ -0,0 +1,407 @@ +// 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 HelloWorldTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "HelloWorldTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "HelloWorld.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_HelloWorld_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_HelloWorld_type_identifier(); + + }); +} + +void register_HelloWorld_type_identifier() +{ + { + StructTypeFlag struct_flags_HelloWorld = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_HelloWorld; + TypeIdentifierPair type_ids_HelloWorld; + QualifiedTypeName type_name_HelloWorld = "HelloWorld"; + eprosima::fastcdr::optional type_ann_builtin_HelloWorld; + eprosima::fastcdr::optional ann_custom_HelloWorld; + CompleteTypeDetail detail_HelloWorld = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_HelloWorld, ann_custom_HelloWorld, type_name_HelloWorld.to_string()); + CompleteStructHeader header_HelloWorld; + header_HelloWorld = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_HelloWorld); + CompleteStructMemberSeq member_seq_HelloWorld; + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_HelloWorld); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_index); + } + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_HelloWorld); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_message); + } + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_char_1048576", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_char", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_char_1048576 {nullptr}; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_char_1048576 = new TypeIdentifier(type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_char_1048576 = new TypeIdentifier(type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_char_1048576 = EK_COMPLETE; + if (TK_NONE == type_ids_HelloWorld.type_identifier2()._d()) + { + equiv_kind_anonymous_array_char_1048576 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_char_1048576 = 0; + PlainCollectionHeader header_anonymous_array_char_1048576 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_char_1048576, element_flags_anonymous_array_char_1048576); + std::string type_id_kind_anonymous_array_char_1048576("TI_PLAIN_ARRAY_LARGE"); + if (type_id_kind_anonymous_array_char_1048576 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(1048576)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_char_1048576, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_char_1048576)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_char_1048576")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_1048576 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(1048576)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_char_1048576, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_char_1048576)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_char_1048576")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_1048576 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_char_1048576", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_1048576: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_data = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_data; + MemberId member_id_data = 0x00000002; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_data = TypeObjectUtils::build_common_struct_member(member_id_data, member_flags_data, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure data member TypeIdentifier inconsistent."); + return; + } + MemberName name_data = "data"; + eprosima::fastcdr::optional member_ann_builtin_data; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_data = TypeObjectUtils::build_complete_member_detail(name_data, member_ann_builtin_data, ann_custom_HelloWorld); + CompleteStructMember member_data = TypeObjectUtils::build_complete_struct_member(common_data, detail_data); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_data); + } + CompleteStructType struct_type_HelloWorld = TypeObjectUtils::build_complete_struct_type(struct_flags_HelloWorld, header_HelloWorld, member_seq_HelloWorld); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_HelloWorld, type_name_HelloWorld.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld already registered in TypeObjectRegistry for a different type."); + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "HelloWorld", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldTypeObjectSupport.hpp b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldTypeObjectSupport.hpp new file mode 100644 index 00000000000..8650fc061e0 --- /dev/null +++ b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// 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 HelloWorldTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_HelloWorld_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register HelloWorld related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_HelloWorld_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldv1.cxx b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldv1.cxx deleted file mode 100644 index 0136d21e4c7..00000000000 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldv1.cxx +++ /dev/null @@ -1,351 +0,0 @@ -// 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 HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define HelloWorld_max_cdr_typesize 1048844ULL; - - - - -HelloWorld::HelloWorld() -{ - // unsigned long m_index - m_index = 0; - // /type_d() m_message - - // char m_data - memset(&m_data, 0, ((1024*1024)) * 1); - -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - - m_data = x.m_data; - -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - - m_data = std::move(x.m_data); - -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - - m_data = x.m_data; - - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - - m_data = std::move(x.m_data); - - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message && - m_data == x.m_data); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - 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; - - - current_alignment += (((1024*1024)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - - -void HelloWorld::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_message.c_str(); - - scdr << m_data; - - -} - -void HelloWorld::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_message; - - - - dcdr >> m_data; - - -} - - -bool HelloWorld::isKeyDefined() -{ - return false; -} - -void HelloWorld::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -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 - */ -void HelloWorld::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& HelloWorld::message() -{ - return m_message; -} - - -/*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ -void HelloWorld::data( - const std::array& _data) -{ - m_data = _data; -} - -/*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ -void HelloWorld::data( - std::array&& _data) -{ - m_data = std::move(_data); -} - -/*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ -const std::array& HelloWorld::data() const -{ - return m_data; -} - -/*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ -std::array& HelloWorld::data() -{ - return m_data; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldv1.h b/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldv1.h deleted file mode 100644 index 52c52c2d384..00000000000 --- a/examples/cpp/dds/HelloWorldExampleSharedMem/HelloWorldv1.h +++ /dev/null @@ -1,272 +0,0 @@ -// 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 HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloWorld defined by the user in the IDL file. - * @ingroup HelloWorld - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - 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 - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - - - /*! - * @brief This function copies the value in member data - * @param _data New value to be copied in member data - */ - eProsima_user_DllExport void data( - const std::array& _data); - - /*! - * @brief This function moves the value in member data - * @param _data New value to be moved in member data - */ - eProsima_user_DllExport void data( - std::array&& _data); - - /*! - * @brief This function returns a constant reference to member data - * @return Constant reference to member data - */ - eProsima_user_DllExport const std::array& data() const; - - /*! - * @brief This function returns a reference to member data - * @return Reference to member data - */ - eProsima_user_DllExport std::array& 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 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 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; - std::string m_message; - std::array m_data; - -}; - - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.cxx b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.cxx deleted file mode 100644 index 4b415d67769..00000000000 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// 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 HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -HelloWorld::HelloWorld() -{ -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -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 - */ -void HelloWorld::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& HelloWorld::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "HelloWorldCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.h b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.hpp similarity index 69% rename from examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.h rename to examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.hpp index 5cd0ddba511..971fea8d920 100644 --- a/examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.h +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorld.hpp @@ -13,32 +13,19 @@ // limitations under the License. /*! - * @file HelloWorld.h + * @file HelloWorld.hpp * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool fastddsgen. */ -#include -#include "HelloWorldv1.h" +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_HPP_ -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - -#include -#include #include -#include #include -#include - +#include #include -#include -#include - - #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -64,17 +51,6 @@ #define HELLOWORLD_DllAPI #endif // _WIN32 -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 @@ -86,73 +62,117 @@ class HelloWorld /*! * @brief Default constructor. */ - eProsima_user_DllExport HelloWorld(); + eProsima_user_DllExport HelloWorld() + { + } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~HelloWorld(); + eProsima_user_DllExport ~HelloWorld() + { + } /*! * @brief Copy constructor. * @param x Reference to the object HelloWorld that will be copied. */ eProsima_user_DllExport HelloWorld( - const HelloWorld& x); + const HelloWorld& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } /*! * @brief Move constructor. * @param x Reference to the object HelloWorld that will be copied. */ eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; + HelloWorld&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } /*! * @brief Copy assignment. * @param x Reference to the object HelloWorld that will be copied. */ eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); + const HelloWorld& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } /*! * @brief Move assignment. * @param x Reference to the object HelloWorld that will be copied. */ eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; + HelloWorld&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } /*! * @brief Comparison operator. * @param x HelloWorld object to compare. */ eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; + const HelloWorld& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } /*! * @brief Comparison operator. * @param x HelloWorld object to compare. */ eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; + const HelloWorld& x) const + { + return !(*this == x); + } /*! * @brief This function sets a value in member index * @param _index New value for member index */ eProsima_user_DllExport void index( - uint32_t _index); + uint32_t _index) + { + m_index = _index; + } /*! * @brief This function returns the value of member index * @return Value of member index */ - eProsima_user_DllExport uint32_t index() const; + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } /*! * @brief This function returns a reference to member index * @return Reference to member index */ - eProsima_user_DllExport uint32_t& index(); + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } /*! @@ -160,26 +180,40 @@ class HelloWorld * @param _message New value to be copied in member message */ eProsima_user_DllExport void message( - const std::string& _message); + const std::string& _message) + { + m_message = _message; + } /*! * @brief This function moves the value in member message * @param _message New value to be moved in member message */ eProsima_user_DllExport void message( - std::string&& _message); + std::string&& _message) + { + m_message = std::move(_message); + } /*! * @brief This function returns a constant reference to member message * @return Constant reference to member message */ - eProsima_user_DllExport const std::string& message() const; + eProsima_user_DllExport const std::string& message() const + { + return m_message; + } /*! * @brief This function returns a reference to member message * @return Reference to member message */ - eProsima_user_DllExport std::string& message(); + eProsima_user_DllExport std::string& message() + { + return m_message; + } + + private: @@ -188,8 +222,6 @@ class HelloWorld }; -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - +#endif // _FAST_DDS_GENERATED_HELLOWORLD_HPP_ -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldCdrAux.hpp b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldCdrAux.hpp index 9f346d306be..6feb8a9da15 100644 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldCdrAux.hpp +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ #define _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ -#include "HelloWorld.h" +#include "HelloWorld.hpp" constexpr uint32_t HelloWorld_max_cdr_typesize {268UL}; constexpr uint32_t HelloWorld_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloWorld& data); diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldCdrAux.ipp b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldCdrAux.ipp index 42e91f3cc38..97df3fe9d9e 100644 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldCdrAux.ipp +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPubSubTypes.cxx b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPubSubTypes.cxx index 85cb477896e..db018e69782 100644 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "HelloWorldPubSubTypes.h" +#include #include -#include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" +#include "HelloWorldTypeObjectSupport.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"); @@ -219,3 +219,11 @@ bool HelloWorldPubSubType::getKey( return true; } +void HelloWorldPubSubType::register_type_object_representation() const +{ + register_HelloWorld_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "HelloWorldCdrAux.ipp" diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPubSubTypes.h b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPubSubTypes.h index 545c68b12b2..a9b4ac119e0 100644 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPubSubTypes.h +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPubSubTypes.h @@ -29,7 +29,7 @@ #include #include -#include "HelloWorld.h" +#include "HelloWorld.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -90,6 +88,9 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPublisher.h b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPublisher.h index 1301ec490dd..63a228fe286 100644 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPublisher.h +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPublisher.h @@ -28,7 +28,7 @@ #include #include -#include "HelloWorld.h" +#include "HelloWorld.hpp" #include diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldSubscriber.cpp b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldSubscriber.cpp index 0686dfce7dc..df49a3d256d 100644 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldSubscriber.cpp +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldSubscriber.cpp @@ -179,7 +179,7 @@ void HelloWorldSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&hello_, &info) == RETCODE_OK) { if (info.valid_data) { diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldSubscriber.h b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldSubscriber.h index 9f3c4c2eb10..15133e2ba63 100644 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldSubscriber.h +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldSubscriber.h @@ -28,7 +28,7 @@ #include #include -#include "HelloWorld.h" +#include "HelloWorld.hpp" #include diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldTypeObjectSupport.cxx b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldTypeObjectSupport.cxx new file mode 100644 index 00000000000..bfae95694f4 --- /dev/null +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldTypeObjectSupport.cxx @@ -0,0 +1,248 @@ +// 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 HelloWorldTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "HelloWorldTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "HelloWorld.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_HelloWorld_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_HelloWorld_type_identifier(); + + }); +} + +void register_HelloWorld_type_identifier() +{ + { + StructTypeFlag struct_flags_HelloWorld = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_HelloWorld; + TypeIdentifierPair type_ids_HelloWorld; + QualifiedTypeName type_name_HelloWorld = "HelloWorld"; + eprosima::fastcdr::optional type_ann_builtin_HelloWorld; + eprosima::fastcdr::optional ann_custom_HelloWorld; + CompleteTypeDetail detail_HelloWorld = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_HelloWorld, ann_custom_HelloWorld, type_name_HelloWorld.to_string()); + CompleteStructHeader header_HelloWorld; + header_HelloWorld = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_HelloWorld); + CompleteStructMemberSeq member_seq_HelloWorld; + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_HelloWorld); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_index); + } + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_HelloWorld); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_message); + } + CompleteStructType struct_type_HelloWorld = TypeObjectUtils::build_complete_struct_type(struct_flags_HelloWorld, header_HelloWorld, member_seq_HelloWorld); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_HelloWorld, type_name_HelloWorld.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld already registered in TypeObjectRegistry for a different type."); + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "HelloWorld", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldTypeObjectSupport.hpp b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldTypeObjectSupport.hpp new file mode 100644 index 00000000000..8650fc061e0 --- /dev/null +++ b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// 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 HelloWorldTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_HelloWorld_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register HelloWorld related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_HelloWorld_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldv1.cxx b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldv1.cxx deleted file mode 100644 index 90e82ea88a7..00000000000 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldv1.cxx +++ /dev/null @@ -1,286 +0,0 @@ -// 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 HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define HelloWorld_max_cdr_typesize 268ULL; - - - - -HelloWorld::HelloWorld() -{ - // unsigned long m_index - m_index = 0; - // /type_d() m_message - - -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - 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; - - -} - - -bool HelloWorld::isKeyDefined() -{ - return false; -} - -void HelloWorld::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -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 - */ -void HelloWorld::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& HelloWorld::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldv1.h b/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldv1.h deleted file mode 100644 index 8c7406a074a..00000000000 --- a/examples/cpp/dds/HelloWorldExampleTCP/HelloWorldv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// 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 HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloWorld defined by the user in the IDL file. - * @ingroup HelloWorld - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - 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 - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - 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 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; - std::string m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/HistoryKind/pastsamples.cpp b/examples/cpp/dds/HistoryKind/pastsamples.cpp index 6561d835ede..25937ac9182 100644 --- a/examples/cpp/dds/HistoryKind/pastsamples.cpp +++ b/examples/cpp/dds/HistoryKind/pastsamples.cpp @@ -193,14 +193,14 @@ void pastsamples() //Read the contents of both histories: std::cout << "The Keep All Subscriber holds: " << std::endl; - while (myReader1->read_next_sample(&my_sample, &sample_info) == ReturnCode_t::RETCODE_OK) + while (myReader1->read_next_sample(&my_sample, &sample_info) == RETCODE_OK) { std::cout << std::to_string(my_sample.index()) << " "; } std::cout << std::endl; std::cout << "The Keep Last (Depth 10) Subscriber holds: " << std::endl; - while (myReader2->read_next_sample(&my_sample, &sample_info) == ReturnCode_t::RETCODE_OK) + while (myReader2->read_next_sample(&my_sample, &sample_info) == RETCODE_OK) { std::cout << std::to_string(my_sample.index()) << " "; } diff --git a/examples/cpp/dds/HistoryKind/sample.cxx b/examples/cpp/dds/HistoryKind/sample.cxx deleted file mode 100644 index 360d4a1b2b2..00000000000 --- a/examples/cpp/dds/HistoryKind/sample.cxx +++ /dev/null @@ -1,158 +0,0 @@ -// 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 sample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "sample.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -sample::sample() -{ -} - -sample::~sample() -{ -} - -sample::sample( - const sample& x) -{ - m_index = x.m_index; - m_key_value = x.m_key_value; -} - -sample::sample( - sample&& x) noexcept -{ - m_index = x.m_index; - m_key_value = x.m_key_value; -} - -sample& sample::operator =( - const sample& x) -{ - - m_index = x.m_index; - m_key_value = x.m_key_value; - return *this; -} - -sample& sample::operator =( - sample&& x) noexcept -{ - - m_index = x.m_index; - m_key_value = x.m_key_value; - return *this; -} - -bool sample::operator ==( - const sample& x) const -{ - return (m_index == x.m_index && - m_key_value == x.m_key_value); -} - -bool sample::operator !=( - const sample& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void sample::index( - uint8_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint8_t sample::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint8_t& sample::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ -void sample::key_value( - uint8_t _key_value) -{ - m_key_value = _key_value; -} - -/*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ -uint8_t sample::key_value() const -{ - return m_key_value; -} - -/*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ -uint8_t& sample::key_value() -{ - return m_key_value; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "sampleCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/HistoryKind/sample.h b/examples/cpp/dds/HistoryKind/sample.hpp similarity index 69% rename from examples/cpp/dds/HistoryKind/sample.h rename to examples/cpp/dds/HistoryKind/sample.hpp index c050c8527cc..3023a792269 100644 --- a/examples/cpp/dds/HistoryKind/sample.h +++ b/examples/cpp/dds/HistoryKind/sample.hpp @@ -13,32 +13,17 @@ // limitations under the License. /*! - * @file sample.h + * @file sample.hpp * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool fastddsgen. */ -#include -#include "samplev1.h" +#ifndef _FAST_DDS_GENERATED_SAMPLE_HPP_ +#define _FAST_DDS_GENERATED_SAMPLE_HPP_ -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ -#define _FAST_DDS_GENERATED_SAMPLE_H_ - -#include -#include #include -#include -#include -#include - -#include -#include -#include - - +#include #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -64,17 +49,6 @@ #define SAMPLE_DllAPI #endif // _WIN32 -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - /*! * @brief This class represents the structure sample defined by the user in the IDL file. * @ingroup sample @@ -86,73 +60,117 @@ class sample /*! * @brief Default constructor. */ - eProsima_user_DllExport sample(); + eProsima_user_DllExport sample() + { + } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~sample(); + eProsima_user_DllExport ~sample() + { + } /*! * @brief Copy constructor. * @param x Reference to the object sample that will be copied. */ eProsima_user_DllExport sample( - const sample& x); + const sample& x) + { + m_index = x.m_index; + + m_key_value = x.m_key_value; + + } /*! * @brief Move constructor. * @param x Reference to the object sample that will be copied. */ eProsima_user_DllExport sample( - sample&& x) noexcept; + sample&& x) noexcept + { + m_index = x.m_index; + m_key_value = x.m_key_value; + } /*! * @brief Copy assignment. * @param x Reference to the object sample that will be copied. */ eProsima_user_DllExport sample& operator =( - const sample& x); + const sample& x) + { + + m_index = x.m_index; + + m_key_value = x.m_key_value; + + return *this; + } /*! * @brief Move assignment. * @param x Reference to the object sample that will be copied. */ eProsima_user_DllExport sample& operator =( - sample&& x) noexcept; + sample&& x) noexcept + { + + m_index = x.m_index; + m_key_value = x.m_key_value; + return *this; + } /*! * @brief Comparison operator. * @param x sample object to compare. */ eProsima_user_DllExport bool operator ==( - const sample& x) const; + const sample& x) const + { + return (m_index == x.m_index && + m_key_value == x.m_key_value); + } /*! * @brief Comparison operator. * @param x sample object to compare. */ eProsima_user_DllExport bool operator !=( - const sample& x) const; + const sample& x) const + { + return !(*this == x); + } /*! * @brief This function sets a value in member index * @param _index New value for member index */ eProsima_user_DllExport void index( - uint8_t _index); + uint8_t _index) + { + m_index = _index; + } /*! * @brief This function returns the value of member index * @return Value of member index */ - eProsima_user_DllExport uint8_t index() const; + eProsima_user_DllExport uint8_t index() const + { + return m_index; + } /*! * @brief This function returns a reference to member index * @return Reference to member index */ - eProsima_user_DllExport uint8_t& index(); + eProsima_user_DllExport uint8_t& index() + { + return m_index; + } /*! @@ -160,19 +178,30 @@ class sample * @param _key_value New value for member key_value */ eProsima_user_DllExport void key_value( - uint8_t _key_value); + uint8_t _key_value) + { + m_key_value = _key_value; + } /*! * @brief This function returns the value of member key_value * @return Value of member key_value */ - eProsima_user_DllExport uint8_t key_value() const; + eProsima_user_DllExport uint8_t key_value() const + { + return m_key_value; + } /*! * @brief This function returns a reference to member key_value * @return Reference to member key_value */ - eProsima_user_DllExport uint8_t& key_value(); + eProsima_user_DllExport uint8_t& key_value() + { + return m_key_value; + } + + private: @@ -181,8 +210,6 @@ class sample }; -#endif // _FAST_DDS_GENERATED_SAMPLE_H_ - +#endif // _FAST_DDS_GENERATED_SAMPLE_HPP_ -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/HistoryKind/sampleCdrAux.hpp b/examples/cpp/dds/HistoryKind/sampleCdrAux.hpp index 18ed5857add..b80dff31248 100644 --- a/examples/cpp/dds/HistoryKind/sampleCdrAux.hpp +++ b/examples/cpp/dds/HistoryKind/sampleCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ #define _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ -#include "sample.h" +#include "sample.hpp" constexpr uint32_t sample_max_cdr_typesize {6UL}; constexpr uint32_t sample_max_key_cdr_typesize {1UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const sample& data); diff --git a/examples/cpp/dds/HistoryKind/sampleCdrAux.ipp b/examples/cpp/dds/HistoryKind/sampleCdrAux.ipp index 11bc4709a6e..17a3d1025fc 100644 --- a/examples/cpp/dds/HistoryKind/sampleCdrAux.ipp +++ b/examples/cpp/dds/HistoryKind/sampleCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/HistoryKind/samplePubSubTypes.cxx b/examples/cpp/dds/HistoryKind/samplePubSubTypes.cxx index 9095d77083a..cae143a08ca 100644 --- a/examples/cpp/dds/HistoryKind/samplePubSubTypes.cxx +++ b/examples/cpp/dds/HistoryKind/samplePubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "samplePubSubTypes.h" +#include #include -#include "samplePubSubTypes.h" #include "sampleCdrAux.hpp" +#include "sampleTypeObjectSupport.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; - - samplePubSubType::samplePubSubType() { setName("sample"); @@ -219,3 +219,11 @@ bool samplePubSubType::getKey( return true; } +void samplePubSubType::register_type_object_representation() const +{ + register_sample_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "sampleCdrAux.ipp" diff --git a/examples/cpp/dds/HistoryKind/samplePubSubTypes.h b/examples/cpp/dds/HistoryKind/samplePubSubTypes.h index 6022f1e76b7..9e59aa58042 100644 --- a/examples/cpp/dds/HistoryKind/samplePubSubTypes.h +++ b/examples/cpp/dds/HistoryKind/samplePubSubTypes.h @@ -29,7 +29,7 @@ #include #include -#include "sample.h" +#include "sample.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type sample defined by the user in the IDL file. * @ingroup sample @@ -90,6 +88,9 @@ class samplePubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/HistoryKind/sampleTypeObjectSupport.cxx b/examples/cpp/dds/HistoryKind/sampleTypeObjectSupport.cxx new file mode 100644 index 00000000000..3719bbf77e6 --- /dev/null +++ b/examples/cpp/dds/HistoryKind/sampleTypeObjectSupport.cxx @@ -0,0 +1,224 @@ +// 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 sampleTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "sampleTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "sample.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_sample_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_sample_type_identifier(); + + }); +} + +void register_sample_type_identifier() +{ + { + StructTypeFlag struct_flags_sample = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_sample; + TypeIdentifierPair type_ids_sample; + QualifiedTypeName type_name_sample = "sample"; + eprosima::fastcdr::optional type_ann_builtin_sample; + eprosima::fastcdr::optional ann_custom_sample; + CompleteTypeDetail detail_sample = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_sample, ann_custom_sample, type_name_sample.to_string()); + CompleteStructHeader header_sample; + header_sample = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_sample); + CompleteStructMemberSeq member_seq_sample; + { + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_sample); + + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_sample.type_identifier1()._d() || TK_NONE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_sample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_sample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_sample.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_sample); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_sample, member_index); + } + { + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_sample); + + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "key_value Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_key_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_key_value; + MemberId member_id_key_value = 0x00000001; + if (EK_COMPLETE == type_ids_sample.type_identifier1()._d() || TK_NONE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_key_value = TypeObjectUtils::build_common_struct_member(member_id_key_value, member_flags_key_value, type_ids_sample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_key_value = TypeObjectUtils::build_common_struct_member(member_id_key_value, member_flags_key_value, type_ids_sample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure key_value member TypeIdentifier inconsistent."); + return; + } + MemberName name_key_value = "key_value"; + eprosima::fastcdr::optional member_ann_builtin_key_value; + ann_custom_sample.reset(); + AppliedAnnotationSeq tmp_ann_custom_key_value; + eprosima::fastcdr::optional unit_key_value; + eprosima::fastcdr::optional min_key_value; + eprosima::fastcdr::optional max_key_value; + eprosima::fastcdr::optional hash_id_key_value; + if (unit_key_value.has_value() || min_key_value.has_value() || max_key_value.has_value() || hash_id_key_value.has_value()) + { + member_ann_builtin_key_value = TypeObjectUtils::build_applied_builtin_member_annotations(unit_key_value, min_key_value, max_key_value, hash_id_key_value); + } + if (!tmp_ann_custom_key_value.empty()) + { + ann_custom_sample = tmp_ann_custom_key_value; + } + CompleteMemberDetail detail_key_value = TypeObjectUtils::build_complete_member_detail(name_key_value, member_ann_builtin_key_value, ann_custom_sample); + CompleteStructMember member_key_value = TypeObjectUtils::build_complete_struct_member(common_key_value, detail_key_value); + TypeObjectUtils::add_complete_struct_member(member_seq_sample, member_key_value); + } + CompleteStructType struct_type_sample = TypeObjectUtils::build_complete_struct_type(struct_flags_sample, header_sample, member_seq_sample); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_sample, type_name_sample.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "sample already registered in TypeObjectRegistry for a different type."); + } + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "sample", type_ids_sample); + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "sample: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/HistoryKind/sampleTypeObjectSupport.hpp b/examples/cpp/dds/HistoryKind/sampleTypeObjectSupport.hpp new file mode 100644 index 00000000000..5ad7f2e5e07 --- /dev/null +++ b/examples/cpp/dds/HistoryKind/sampleTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// 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 sampleTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_sample_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register sample related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_sample_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/HistoryKind/samplev1.cxx b/examples/cpp/dds/HistoryKind/samplev1.cxx deleted file mode 100644 index 3b735befaf8..00000000000 --- a/examples/cpp/dds/HistoryKind/samplev1.cxx +++ /dev/null @@ -1,280 +0,0 @@ -// 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 sample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "sample.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define sample_max_cdr_typesize 6ULL; - - - - -sample::sample() -{ - // octet m_index - m_index = 0; - // octet m_key_value - m_key_value = 0; - -} - -sample::~sample() -{ -} - -sample::sample( - const sample& x) -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - -} - -sample::sample( - sample&& x) noexcept -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - -} - -sample& sample::operator =( - const sample& x) -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - - return *this; -} - -sample& sample::operator =( - sample&& x) noexcept -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - - return *this; -} - -bool sample::operator ==( - const sample& x) const -{ - return (m_index == x.m_index && - m_key_value == x.m_key_value); -} - -bool sample::operator !=( - const sample& x) const -{ - return !(*this == x); -} - -size_t sample::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return sample_max_cdr_typesize; -} - -size_t sample::getCdrSerializedSize( - const sample& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - - -void sample::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_key_value; - -} - -void sample::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_key_value; - - -} - - -bool sample::isKeyDefined() -{ - return true; -} - -void sample::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - - - scdr << m_key_value; - -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void sample::index( - uint8_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint8_t sample::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint8_t& sample::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ -void sample::key_value( - uint8_t _key_value) -{ - m_key_value = _key_value; -} - -/*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ -uint8_t sample::key_value() const -{ - return m_key_value; -} - -/*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ -uint8_t& sample::key_value() -{ - return m_key_value; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/HistoryKind/samplev1.h b/examples/cpp/dds/HistoryKind/samplev1.h deleted file mode 100644 index 6aa21a41e80..00000000000 --- a/examples/cpp/dds/HistoryKind/samplev1.h +++ /dev/null @@ -1,237 +0,0 @@ -// 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 sample.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ -#define _FAST_DDS_GENERATED_SAMPLE_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SAMPLE_SOURCE) -#define SAMPLE_DllAPI __declspec( dllexport ) -#else -#define SAMPLE_DllAPI __declspec( dllimport ) -#endif // SAMPLE_SOURCE -#else -#define SAMPLE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define SAMPLE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure sample defined by the user in the IDL file. - * @ingroup sample - */ -class sample -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport sample(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~sample(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - const sample& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - sample&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - const sample& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - sample&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator ==( - const sample& x) const; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator !=( - const sample& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint8_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint8_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint8_t& index(); - - - /*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ - eProsima_user_DllExport void key_value( - uint8_t _key_value); - - /*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ - eProsima_user_DllExport uint8_t key_value() const; - - /*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ - eProsima_user_DllExport uint8_t& key_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 sample& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint8_t m_index; - uint8_t m_key_value; - -}; - - -#endif // _FAST_DDS_GENERATED_SAMPLE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/Keys/keys.cpp b/examples/cpp/dds/Keys/keys.cpp index d32c03e1513..9faba4e251d 100644 --- a/examples/cpp/dds/Keys/keys.cpp +++ b/examples/cpp/dds/Keys/keys.cpp @@ -141,7 +141,7 @@ class SubListener : public eprosima::fastdds::dds::DataReaderListener DataReader* reader) override { SampleInfo info; - if (reader->take_next_sample(&m_sample, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&m_sample, &info) == RETCODE_OK) { if (info.valid_data) { @@ -365,7 +365,7 @@ void keys() //Read the contents of both histories: std::vector< std::pair> sampleList; std::cout << "The Subscriber holds: " << std::endl; - while (myReader->read_next_sample(&my_sample, &sample_info) == ReturnCode_t::RETCODE_OK) + while (myReader->read_next_sample(&my_sample, &sample_info) == RETCODE_OK) { sampleList.push_back(std::pair(my_sample.index(), my_sample.key_value())); } diff --git a/examples/cpp/dds/Keys/sample.cxx b/examples/cpp/dds/Keys/sample.cxx deleted file mode 100644 index 360d4a1b2b2..00000000000 --- a/examples/cpp/dds/Keys/sample.cxx +++ /dev/null @@ -1,158 +0,0 @@ -// 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 sample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "sample.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -sample::sample() -{ -} - -sample::~sample() -{ -} - -sample::sample( - const sample& x) -{ - m_index = x.m_index; - m_key_value = x.m_key_value; -} - -sample::sample( - sample&& x) noexcept -{ - m_index = x.m_index; - m_key_value = x.m_key_value; -} - -sample& sample::operator =( - const sample& x) -{ - - m_index = x.m_index; - m_key_value = x.m_key_value; - return *this; -} - -sample& sample::operator =( - sample&& x) noexcept -{ - - m_index = x.m_index; - m_key_value = x.m_key_value; - return *this; -} - -bool sample::operator ==( - const sample& x) const -{ - return (m_index == x.m_index && - m_key_value == x.m_key_value); -} - -bool sample::operator !=( - const sample& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void sample::index( - uint8_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint8_t sample::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint8_t& sample::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ -void sample::key_value( - uint8_t _key_value) -{ - m_key_value = _key_value; -} - -/*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ -uint8_t sample::key_value() const -{ - return m_key_value; -} - -/*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ -uint8_t& sample::key_value() -{ - return m_key_value; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "sampleCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/LateJoiners/sample.h b/examples/cpp/dds/Keys/sample.hpp similarity index 69% rename from examples/cpp/dds/LateJoiners/sample.h rename to examples/cpp/dds/Keys/sample.hpp index c050c8527cc..3023a792269 100644 --- a/examples/cpp/dds/LateJoiners/sample.h +++ b/examples/cpp/dds/Keys/sample.hpp @@ -13,32 +13,17 @@ // limitations under the License. /*! - * @file sample.h + * @file sample.hpp * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool fastddsgen. */ -#include -#include "samplev1.h" +#ifndef _FAST_DDS_GENERATED_SAMPLE_HPP_ +#define _FAST_DDS_GENERATED_SAMPLE_HPP_ -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ -#define _FAST_DDS_GENERATED_SAMPLE_H_ - -#include -#include #include -#include -#include -#include - -#include -#include -#include - - +#include #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -64,17 +49,6 @@ #define SAMPLE_DllAPI #endif // _WIN32 -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - /*! * @brief This class represents the structure sample defined by the user in the IDL file. * @ingroup sample @@ -86,73 +60,117 @@ class sample /*! * @brief Default constructor. */ - eProsima_user_DllExport sample(); + eProsima_user_DllExport sample() + { + } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~sample(); + eProsima_user_DllExport ~sample() + { + } /*! * @brief Copy constructor. * @param x Reference to the object sample that will be copied. */ eProsima_user_DllExport sample( - const sample& x); + const sample& x) + { + m_index = x.m_index; + + m_key_value = x.m_key_value; + + } /*! * @brief Move constructor. * @param x Reference to the object sample that will be copied. */ eProsima_user_DllExport sample( - sample&& x) noexcept; + sample&& x) noexcept + { + m_index = x.m_index; + m_key_value = x.m_key_value; + } /*! * @brief Copy assignment. * @param x Reference to the object sample that will be copied. */ eProsima_user_DllExport sample& operator =( - const sample& x); + const sample& x) + { + + m_index = x.m_index; + + m_key_value = x.m_key_value; + + return *this; + } /*! * @brief Move assignment. * @param x Reference to the object sample that will be copied. */ eProsima_user_DllExport sample& operator =( - sample&& x) noexcept; + sample&& x) noexcept + { + + m_index = x.m_index; + m_key_value = x.m_key_value; + return *this; + } /*! * @brief Comparison operator. * @param x sample object to compare. */ eProsima_user_DllExport bool operator ==( - const sample& x) const; + const sample& x) const + { + return (m_index == x.m_index && + m_key_value == x.m_key_value); + } /*! * @brief Comparison operator. * @param x sample object to compare. */ eProsima_user_DllExport bool operator !=( - const sample& x) const; + const sample& x) const + { + return !(*this == x); + } /*! * @brief This function sets a value in member index * @param _index New value for member index */ eProsima_user_DllExport void index( - uint8_t _index); + uint8_t _index) + { + m_index = _index; + } /*! * @brief This function returns the value of member index * @return Value of member index */ - eProsima_user_DllExport uint8_t index() const; + eProsima_user_DllExport uint8_t index() const + { + return m_index; + } /*! * @brief This function returns a reference to member index * @return Reference to member index */ - eProsima_user_DllExport uint8_t& index(); + eProsima_user_DllExport uint8_t& index() + { + return m_index; + } /*! @@ -160,19 +178,30 @@ class sample * @param _key_value New value for member key_value */ eProsima_user_DllExport void key_value( - uint8_t _key_value); + uint8_t _key_value) + { + m_key_value = _key_value; + } /*! * @brief This function returns the value of member key_value * @return Value of member key_value */ - eProsima_user_DllExport uint8_t key_value() const; + eProsima_user_DllExport uint8_t key_value() const + { + return m_key_value; + } /*! * @brief This function returns a reference to member key_value * @return Reference to member key_value */ - eProsima_user_DllExport uint8_t& key_value(); + eProsima_user_DllExport uint8_t& key_value() + { + return m_key_value; + } + + private: @@ -181,8 +210,6 @@ class sample }; -#endif // _FAST_DDS_GENERATED_SAMPLE_H_ - +#endif // _FAST_DDS_GENERATED_SAMPLE_HPP_ -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/Keys/sampleCdrAux.hpp b/examples/cpp/dds/Keys/sampleCdrAux.hpp index 18ed5857add..b80dff31248 100644 --- a/examples/cpp/dds/Keys/sampleCdrAux.hpp +++ b/examples/cpp/dds/Keys/sampleCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ #define _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ -#include "sample.h" +#include "sample.hpp" constexpr uint32_t sample_max_cdr_typesize {6UL}; constexpr uint32_t sample_max_key_cdr_typesize {1UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const sample& data); diff --git a/examples/cpp/dds/Keys/sampleCdrAux.ipp b/examples/cpp/dds/Keys/sampleCdrAux.ipp index 11bc4709a6e..17a3d1025fc 100644 --- a/examples/cpp/dds/Keys/sampleCdrAux.ipp +++ b/examples/cpp/dds/Keys/sampleCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/Keys/samplePubSubTypes.cxx b/examples/cpp/dds/Keys/samplePubSubTypes.cxx index 9095d77083a..cae143a08ca 100644 --- a/examples/cpp/dds/Keys/samplePubSubTypes.cxx +++ b/examples/cpp/dds/Keys/samplePubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "samplePubSubTypes.h" +#include #include -#include "samplePubSubTypes.h" #include "sampleCdrAux.hpp" +#include "sampleTypeObjectSupport.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; - - samplePubSubType::samplePubSubType() { setName("sample"); @@ -219,3 +219,11 @@ bool samplePubSubType::getKey( return true; } +void samplePubSubType::register_type_object_representation() const +{ + register_sample_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "sampleCdrAux.ipp" diff --git a/examples/cpp/dds/Keys/samplePubSubTypes.h b/examples/cpp/dds/Keys/samplePubSubTypes.h index 6022f1e76b7..9e59aa58042 100644 --- a/examples/cpp/dds/Keys/samplePubSubTypes.h +++ b/examples/cpp/dds/Keys/samplePubSubTypes.h @@ -29,7 +29,7 @@ #include #include -#include "sample.h" +#include "sample.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type sample defined by the user in the IDL file. * @ingroup sample @@ -90,6 +88,9 @@ class samplePubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/Keys/sampleTypeObjectSupport.cxx b/examples/cpp/dds/Keys/sampleTypeObjectSupport.cxx new file mode 100644 index 00000000000..3719bbf77e6 --- /dev/null +++ b/examples/cpp/dds/Keys/sampleTypeObjectSupport.cxx @@ -0,0 +1,224 @@ +// 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 sampleTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "sampleTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "sample.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_sample_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_sample_type_identifier(); + + }); +} + +void register_sample_type_identifier() +{ + { + StructTypeFlag struct_flags_sample = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_sample; + TypeIdentifierPair type_ids_sample; + QualifiedTypeName type_name_sample = "sample"; + eprosima::fastcdr::optional type_ann_builtin_sample; + eprosima::fastcdr::optional ann_custom_sample; + CompleteTypeDetail detail_sample = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_sample, ann_custom_sample, type_name_sample.to_string()); + CompleteStructHeader header_sample; + header_sample = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_sample); + CompleteStructMemberSeq member_seq_sample; + { + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_sample); + + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_sample.type_identifier1()._d() || TK_NONE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_sample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_sample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_sample.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_sample); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_sample, member_index); + } + { + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_sample); + + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "key_value Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_key_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_key_value; + MemberId member_id_key_value = 0x00000001; + if (EK_COMPLETE == type_ids_sample.type_identifier1()._d() || TK_NONE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_key_value = TypeObjectUtils::build_common_struct_member(member_id_key_value, member_flags_key_value, type_ids_sample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_key_value = TypeObjectUtils::build_common_struct_member(member_id_key_value, member_flags_key_value, type_ids_sample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure key_value member TypeIdentifier inconsistent."); + return; + } + MemberName name_key_value = "key_value"; + eprosima::fastcdr::optional member_ann_builtin_key_value; + ann_custom_sample.reset(); + AppliedAnnotationSeq tmp_ann_custom_key_value; + eprosima::fastcdr::optional unit_key_value; + eprosima::fastcdr::optional min_key_value; + eprosima::fastcdr::optional max_key_value; + eprosima::fastcdr::optional hash_id_key_value; + if (unit_key_value.has_value() || min_key_value.has_value() || max_key_value.has_value() || hash_id_key_value.has_value()) + { + member_ann_builtin_key_value = TypeObjectUtils::build_applied_builtin_member_annotations(unit_key_value, min_key_value, max_key_value, hash_id_key_value); + } + if (!tmp_ann_custom_key_value.empty()) + { + ann_custom_sample = tmp_ann_custom_key_value; + } + CompleteMemberDetail detail_key_value = TypeObjectUtils::build_complete_member_detail(name_key_value, member_ann_builtin_key_value, ann_custom_sample); + CompleteStructMember member_key_value = TypeObjectUtils::build_complete_struct_member(common_key_value, detail_key_value); + TypeObjectUtils::add_complete_struct_member(member_seq_sample, member_key_value); + } + CompleteStructType struct_type_sample = TypeObjectUtils::build_complete_struct_type(struct_flags_sample, header_sample, member_seq_sample); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_sample, type_name_sample.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "sample already registered in TypeObjectRegistry for a different type."); + } + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "sample", type_ids_sample); + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "sample: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/Keys/sampleTypeObjectSupport.hpp b/examples/cpp/dds/Keys/sampleTypeObjectSupport.hpp new file mode 100644 index 00000000000..5ad7f2e5e07 --- /dev/null +++ b/examples/cpp/dds/Keys/sampleTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// 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 sampleTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_sample_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register sample related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_sample_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/Keys/samplev1.cxx b/examples/cpp/dds/Keys/samplev1.cxx deleted file mode 100644 index 3b735befaf8..00000000000 --- a/examples/cpp/dds/Keys/samplev1.cxx +++ /dev/null @@ -1,280 +0,0 @@ -// 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 sample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "sample.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define sample_max_cdr_typesize 6ULL; - - - - -sample::sample() -{ - // octet m_index - m_index = 0; - // octet m_key_value - m_key_value = 0; - -} - -sample::~sample() -{ -} - -sample::sample( - const sample& x) -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - -} - -sample::sample( - sample&& x) noexcept -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - -} - -sample& sample::operator =( - const sample& x) -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - - return *this; -} - -sample& sample::operator =( - sample&& x) noexcept -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - - return *this; -} - -bool sample::operator ==( - const sample& x) const -{ - return (m_index == x.m_index && - m_key_value == x.m_key_value); -} - -bool sample::operator !=( - const sample& x) const -{ - return !(*this == x); -} - -size_t sample::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return sample_max_cdr_typesize; -} - -size_t sample::getCdrSerializedSize( - const sample& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - - -void sample::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_key_value; - -} - -void sample::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_key_value; - - -} - - -bool sample::isKeyDefined() -{ - return true; -} - -void sample::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - - - scdr << m_key_value; - -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void sample::index( - uint8_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint8_t sample::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint8_t& sample::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ -void sample::key_value( - uint8_t _key_value) -{ - m_key_value = _key_value; -} - -/*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ -uint8_t sample::key_value() const -{ - return m_key_value; -} - -/*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ -uint8_t& sample::key_value() -{ - return m_key_value; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/Keys/samplev1.h b/examples/cpp/dds/Keys/samplev1.h deleted file mode 100644 index 6aa21a41e80..00000000000 --- a/examples/cpp/dds/Keys/samplev1.h +++ /dev/null @@ -1,237 +0,0 @@ -// 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 sample.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ -#define _FAST_DDS_GENERATED_SAMPLE_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SAMPLE_SOURCE) -#define SAMPLE_DllAPI __declspec( dllexport ) -#else -#define SAMPLE_DllAPI __declspec( dllimport ) -#endif // SAMPLE_SOURCE -#else -#define SAMPLE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define SAMPLE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure sample defined by the user in the IDL file. - * @ingroup sample - */ -class sample -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport sample(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~sample(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - const sample& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - sample&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - const sample& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - sample&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator ==( - const sample& x) const; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator !=( - const sample& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint8_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint8_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint8_t& index(); - - - /*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ - eProsima_user_DllExport void key_value( - uint8_t _key_value); - - /*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ - eProsima_user_DllExport uint8_t key_value() const; - - /*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ - eProsima_user_DllExport uint8_t& key_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 sample& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint8_t m_index; - uint8_t m_key_value; - -}; - - -#endif // _FAST_DDS_GENERATED_SAMPLE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/LateJoiners/latejoiners.cpp b/examples/cpp/dds/LateJoiners/latejoiners.cpp index 4566c146b45..4209ea5e835 100644 --- a/examples/cpp/dds/LateJoiners/latejoiners.cpp +++ b/examples/cpp/dds/LateJoiners/latejoiners.cpp @@ -177,13 +177,13 @@ void latejoiners() //Read the contents of both histories: std::cout << "The Transient Local Subscriber holds: " << std::endl; - while (myReader1->read_next_sample(&my_sample, &sample_info) == ReturnCode_t::RETCODE_OK) + while (myReader1->read_next_sample(&my_sample, &sample_info) == RETCODE_OK) { std::cout << std::to_string(my_sample.index()) << " "; } std::cout << std::endl; std::cout << "The Volatile Subscriber holds: " << std::endl; - while (myReader2->read_next_sample(&my_sample, &sample_info) == ReturnCode_t::RETCODE_OK) + while (myReader2->read_next_sample(&my_sample, &sample_info) == RETCODE_OK) { std::cout << std::to_string(my_sample.index()) << " "; } diff --git a/examples/cpp/dds/LateJoiners/sample.cxx b/examples/cpp/dds/LateJoiners/sample.cxx deleted file mode 100644 index 360d4a1b2b2..00000000000 --- a/examples/cpp/dds/LateJoiners/sample.cxx +++ /dev/null @@ -1,158 +0,0 @@ -// 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 sample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "sample.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -sample::sample() -{ -} - -sample::~sample() -{ -} - -sample::sample( - const sample& x) -{ - m_index = x.m_index; - m_key_value = x.m_key_value; -} - -sample::sample( - sample&& x) noexcept -{ - m_index = x.m_index; - m_key_value = x.m_key_value; -} - -sample& sample::operator =( - const sample& x) -{ - - m_index = x.m_index; - m_key_value = x.m_key_value; - return *this; -} - -sample& sample::operator =( - sample&& x) noexcept -{ - - m_index = x.m_index; - m_key_value = x.m_key_value; - return *this; -} - -bool sample::operator ==( - const sample& x) const -{ - return (m_index == x.m_index && - m_key_value == x.m_key_value); -} - -bool sample::operator !=( - const sample& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void sample::index( - uint8_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint8_t sample::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint8_t& sample::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ -void sample::key_value( - uint8_t _key_value) -{ - m_key_value = _key_value; -} - -/*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ -uint8_t sample::key_value() const -{ - return m_key_value; -} - -/*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ -uint8_t& sample::key_value() -{ - return m_key_value; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "sampleCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/Configurability/sample.h b/examples/cpp/dds/LateJoiners/sample.hpp similarity index 69% rename from examples/cpp/dds/Configurability/sample.h rename to examples/cpp/dds/LateJoiners/sample.hpp index c050c8527cc..3023a792269 100644 --- a/examples/cpp/dds/Configurability/sample.h +++ b/examples/cpp/dds/LateJoiners/sample.hpp @@ -13,32 +13,17 @@ // limitations under the License. /*! - * @file sample.h + * @file sample.hpp * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool fastddsgen. */ -#include -#include "samplev1.h" +#ifndef _FAST_DDS_GENERATED_SAMPLE_HPP_ +#define _FAST_DDS_GENERATED_SAMPLE_HPP_ -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ -#define _FAST_DDS_GENERATED_SAMPLE_H_ - -#include -#include #include -#include -#include -#include - -#include -#include -#include - - +#include #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -64,17 +49,6 @@ #define SAMPLE_DllAPI #endif // _WIN32 -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - /*! * @brief This class represents the structure sample defined by the user in the IDL file. * @ingroup sample @@ -86,73 +60,117 @@ class sample /*! * @brief Default constructor. */ - eProsima_user_DllExport sample(); + eProsima_user_DllExport sample() + { + } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~sample(); + eProsima_user_DllExport ~sample() + { + } /*! * @brief Copy constructor. * @param x Reference to the object sample that will be copied. */ eProsima_user_DllExport sample( - const sample& x); + const sample& x) + { + m_index = x.m_index; + + m_key_value = x.m_key_value; + + } /*! * @brief Move constructor. * @param x Reference to the object sample that will be copied. */ eProsima_user_DllExport sample( - sample&& x) noexcept; + sample&& x) noexcept + { + m_index = x.m_index; + m_key_value = x.m_key_value; + } /*! * @brief Copy assignment. * @param x Reference to the object sample that will be copied. */ eProsima_user_DllExport sample& operator =( - const sample& x); + const sample& x) + { + + m_index = x.m_index; + + m_key_value = x.m_key_value; + + return *this; + } /*! * @brief Move assignment. * @param x Reference to the object sample that will be copied. */ eProsima_user_DllExport sample& operator =( - sample&& x) noexcept; + sample&& x) noexcept + { + + m_index = x.m_index; + m_key_value = x.m_key_value; + return *this; + } /*! * @brief Comparison operator. * @param x sample object to compare. */ eProsima_user_DllExport bool operator ==( - const sample& x) const; + const sample& x) const + { + return (m_index == x.m_index && + m_key_value == x.m_key_value); + } /*! * @brief Comparison operator. * @param x sample object to compare. */ eProsima_user_DllExport bool operator !=( - const sample& x) const; + const sample& x) const + { + return !(*this == x); + } /*! * @brief This function sets a value in member index * @param _index New value for member index */ eProsima_user_DllExport void index( - uint8_t _index); + uint8_t _index) + { + m_index = _index; + } /*! * @brief This function returns the value of member index * @return Value of member index */ - eProsima_user_DllExport uint8_t index() const; + eProsima_user_DllExport uint8_t index() const + { + return m_index; + } /*! * @brief This function returns a reference to member index * @return Reference to member index */ - eProsima_user_DllExport uint8_t& index(); + eProsima_user_DllExport uint8_t& index() + { + return m_index; + } /*! @@ -160,19 +178,30 @@ class sample * @param _key_value New value for member key_value */ eProsima_user_DllExport void key_value( - uint8_t _key_value); + uint8_t _key_value) + { + m_key_value = _key_value; + } /*! * @brief This function returns the value of member key_value * @return Value of member key_value */ - eProsima_user_DllExport uint8_t key_value() const; + eProsima_user_DllExport uint8_t key_value() const + { + return m_key_value; + } /*! * @brief This function returns a reference to member key_value * @return Reference to member key_value */ - eProsima_user_DllExport uint8_t& key_value(); + eProsima_user_DllExport uint8_t& key_value() + { + return m_key_value; + } + + private: @@ -181,8 +210,6 @@ class sample }; -#endif // _FAST_DDS_GENERATED_SAMPLE_H_ - +#endif // _FAST_DDS_GENERATED_SAMPLE_HPP_ -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/LateJoiners/sampleCdrAux.hpp b/examples/cpp/dds/LateJoiners/sampleCdrAux.hpp index 18ed5857add..b80dff31248 100644 --- a/examples/cpp/dds/LateJoiners/sampleCdrAux.hpp +++ b/examples/cpp/dds/LateJoiners/sampleCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ #define _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ -#include "sample.h" +#include "sample.hpp" constexpr uint32_t sample_max_cdr_typesize {6UL}; constexpr uint32_t sample_max_key_cdr_typesize {1UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const sample& data); diff --git a/examples/cpp/dds/LateJoiners/sampleCdrAux.ipp b/examples/cpp/dds/LateJoiners/sampleCdrAux.ipp index 11bc4709a6e..17a3d1025fc 100644 --- a/examples/cpp/dds/LateJoiners/sampleCdrAux.ipp +++ b/examples/cpp/dds/LateJoiners/sampleCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/LateJoiners/samplePubSubTypes.cxx b/examples/cpp/dds/LateJoiners/samplePubSubTypes.cxx index 9095d77083a..cae143a08ca 100644 --- a/examples/cpp/dds/LateJoiners/samplePubSubTypes.cxx +++ b/examples/cpp/dds/LateJoiners/samplePubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "samplePubSubTypes.h" +#include #include -#include "samplePubSubTypes.h" #include "sampleCdrAux.hpp" +#include "sampleTypeObjectSupport.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; - - samplePubSubType::samplePubSubType() { setName("sample"); @@ -219,3 +219,11 @@ bool samplePubSubType::getKey( return true; } +void samplePubSubType::register_type_object_representation() const +{ + register_sample_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "sampleCdrAux.ipp" diff --git a/examples/cpp/dds/LateJoiners/samplePubSubTypes.h b/examples/cpp/dds/LateJoiners/samplePubSubTypes.h index 6022f1e76b7..9e59aa58042 100644 --- a/examples/cpp/dds/LateJoiners/samplePubSubTypes.h +++ b/examples/cpp/dds/LateJoiners/samplePubSubTypes.h @@ -29,7 +29,7 @@ #include #include -#include "sample.h" +#include "sample.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type sample defined by the user in the IDL file. * @ingroup sample @@ -90,6 +88,9 @@ class samplePubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/LateJoiners/sampleTypeObjectSupport.cxx b/examples/cpp/dds/LateJoiners/sampleTypeObjectSupport.cxx new file mode 100644 index 00000000000..3719bbf77e6 --- /dev/null +++ b/examples/cpp/dds/LateJoiners/sampleTypeObjectSupport.cxx @@ -0,0 +1,224 @@ +// 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 sampleTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "sampleTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "sample.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_sample_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_sample_type_identifier(); + + }); +} + +void register_sample_type_identifier() +{ + { + StructTypeFlag struct_flags_sample = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_sample; + TypeIdentifierPair type_ids_sample; + QualifiedTypeName type_name_sample = "sample"; + eprosima::fastcdr::optional type_ann_builtin_sample; + eprosima::fastcdr::optional ann_custom_sample; + CompleteTypeDetail detail_sample = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_sample, ann_custom_sample, type_name_sample.to_string()); + CompleteStructHeader header_sample; + header_sample = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_sample); + CompleteStructMemberSeq member_seq_sample; + { + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_sample); + + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_sample.type_identifier1()._d() || TK_NONE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_sample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_sample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_sample.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_sample); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_sample, member_index); + } + { + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_sample); + + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "key_value Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_key_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_key_value; + MemberId member_id_key_value = 0x00000001; + if (EK_COMPLETE == type_ids_sample.type_identifier1()._d() || TK_NONE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_key_value = TypeObjectUtils::build_common_struct_member(member_id_key_value, member_flags_key_value, type_ids_sample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_key_value = TypeObjectUtils::build_common_struct_member(member_id_key_value, member_flags_key_value, type_ids_sample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure key_value member TypeIdentifier inconsistent."); + return; + } + MemberName name_key_value = "key_value"; + eprosima::fastcdr::optional member_ann_builtin_key_value; + ann_custom_sample.reset(); + AppliedAnnotationSeq tmp_ann_custom_key_value; + eprosima::fastcdr::optional unit_key_value; + eprosima::fastcdr::optional min_key_value; + eprosima::fastcdr::optional max_key_value; + eprosima::fastcdr::optional hash_id_key_value; + if (unit_key_value.has_value() || min_key_value.has_value() || max_key_value.has_value() || hash_id_key_value.has_value()) + { + member_ann_builtin_key_value = TypeObjectUtils::build_applied_builtin_member_annotations(unit_key_value, min_key_value, max_key_value, hash_id_key_value); + } + if (!tmp_ann_custom_key_value.empty()) + { + ann_custom_sample = tmp_ann_custom_key_value; + } + CompleteMemberDetail detail_key_value = TypeObjectUtils::build_complete_member_detail(name_key_value, member_ann_builtin_key_value, ann_custom_sample); + CompleteStructMember member_key_value = TypeObjectUtils::build_complete_struct_member(common_key_value, detail_key_value); + TypeObjectUtils::add_complete_struct_member(member_seq_sample, member_key_value); + } + CompleteStructType struct_type_sample = TypeObjectUtils::build_complete_struct_type(struct_flags_sample, header_sample, member_seq_sample); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_sample, type_name_sample.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "sample already registered in TypeObjectRegistry for a different type."); + } + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "sample", type_ids_sample); + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "sample: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/LateJoiners/sampleTypeObjectSupport.hpp b/examples/cpp/dds/LateJoiners/sampleTypeObjectSupport.hpp new file mode 100644 index 00000000000..5ad7f2e5e07 --- /dev/null +++ b/examples/cpp/dds/LateJoiners/sampleTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// 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 sampleTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_sample_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register sample related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_sample_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/LateJoiners/samplev1.cxx b/examples/cpp/dds/LateJoiners/samplev1.cxx deleted file mode 100644 index 3b735befaf8..00000000000 --- a/examples/cpp/dds/LateJoiners/samplev1.cxx +++ /dev/null @@ -1,280 +0,0 @@ -// 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 sample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "sample.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define sample_max_cdr_typesize 6ULL; - - - - -sample::sample() -{ - // octet m_index - m_index = 0; - // octet m_key_value - m_key_value = 0; - -} - -sample::~sample() -{ -} - -sample::sample( - const sample& x) -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - -} - -sample::sample( - sample&& x) noexcept -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - -} - -sample& sample::operator =( - const sample& x) -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - - return *this; -} - -sample& sample::operator =( - sample&& x) noexcept -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - - return *this; -} - -bool sample::operator ==( - const sample& x) const -{ - return (m_index == x.m_index && - m_key_value == x.m_key_value); -} - -bool sample::operator !=( - const sample& x) const -{ - return !(*this == x); -} - -size_t sample::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return sample_max_cdr_typesize; -} - -size_t sample::getCdrSerializedSize( - const sample& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - - -void sample::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_key_value; - -} - -void sample::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_key_value; - - -} - - -bool sample::isKeyDefined() -{ - return true; -} - -void sample::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - - - scdr << m_key_value; - -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void sample::index( - uint8_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint8_t sample::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint8_t& sample::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ -void sample::key_value( - uint8_t _key_value) -{ - m_key_value = _key_value; -} - -/*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ -uint8_t sample::key_value() const -{ - return m_key_value; -} - -/*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ -uint8_t& sample::key_value() -{ - return m_key_value; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/LateJoiners/samplev1.h b/examples/cpp/dds/LateJoiners/samplev1.h deleted file mode 100644 index 6aa21a41e80..00000000000 --- a/examples/cpp/dds/LateJoiners/samplev1.h +++ /dev/null @@ -1,237 +0,0 @@ -// 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 sample.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ -#define _FAST_DDS_GENERATED_SAMPLE_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SAMPLE_SOURCE) -#define SAMPLE_DllAPI __declspec( dllexport ) -#else -#define SAMPLE_DllAPI __declspec( dllimport ) -#endif // SAMPLE_SOURCE -#else -#define SAMPLE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define SAMPLE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure sample defined by the user in the IDL file. - * @ingroup sample - */ -class sample -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport sample(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~sample(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - const sample& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - sample&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - const sample& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - sample&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator ==( - const sample& x) const; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator !=( - const sample& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint8_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint8_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint8_t& index(); - - - /*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ - eProsima_user_DllExport void key_value( - uint8_t _key_value); - - /*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ - eProsima_user_DllExport uint8_t key_value() const; - - /*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ - eProsima_user_DllExport uint8_t& key_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 sample& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint8_t m_index; - uint8_t m_key_value; - -}; - - -#endif // _FAST_DDS_GENERATED_SAMPLE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/LifespanQoSExample/Lifespan.cxx b/examples/cpp/dds/LifespanQoSExample/Lifespan.cxx deleted file mode 100644 index 66c85b61161..00000000000 --- a/examples/cpp/dds/LifespanQoSExample/Lifespan.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// 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 Lifespan.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Lifespan.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -Lifespan::Lifespan() -{ -} - -Lifespan::~Lifespan() -{ -} - -Lifespan::Lifespan( - const Lifespan& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -Lifespan::Lifespan( - Lifespan&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -Lifespan& Lifespan::operator =( - const Lifespan& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -Lifespan& Lifespan::operator =( - Lifespan&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool Lifespan::operator ==( - const Lifespan& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool Lifespan::operator !=( - const Lifespan& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void Lifespan::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t Lifespan::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& Lifespan::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void Lifespan::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void Lifespan::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& Lifespan::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& Lifespan::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "LifespanCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/LifespanQoSExample/Lifespan.h b/examples/cpp/dds/LifespanQoSExample/Lifespan.hpp similarity index 69% rename from examples/cpp/dds/LifespanQoSExample/Lifespan.h rename to examples/cpp/dds/LifespanQoSExample/Lifespan.hpp index 5d6e5da9c5c..2d2668b9996 100644 --- a/examples/cpp/dds/LifespanQoSExample/Lifespan.h +++ b/examples/cpp/dds/LifespanQoSExample/Lifespan.hpp @@ -13,32 +13,19 @@ // limitations under the License. /*! - * @file Lifespan.h + * @file Lifespan.hpp * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool fastddsgen. */ -#include -#include "Lifespanv1.h" +#ifndef _FAST_DDS_GENERATED_LIFESPAN_HPP_ +#define _FAST_DDS_GENERATED_LIFESPAN_HPP_ -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_LIFESPAN_H_ -#define _FAST_DDS_GENERATED_LIFESPAN_H_ - -#include -#include #include -#include #include -#include - +#include #include -#include -#include - - #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -64,17 +51,6 @@ #define LIFESPAN_DllAPI #endif // _WIN32 -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - /*! * @brief This class represents the structure Lifespan defined by the user in the IDL file. * @ingroup Lifespan @@ -86,73 +62,117 @@ class Lifespan /*! * @brief Default constructor. */ - eProsima_user_DllExport Lifespan(); + eProsima_user_DllExport Lifespan() + { + } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~Lifespan(); + eProsima_user_DllExport ~Lifespan() + { + } /*! * @brief Copy constructor. * @param x Reference to the object Lifespan that will be copied. */ eProsima_user_DllExport Lifespan( - const Lifespan& x); + const Lifespan& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } /*! * @brief Move constructor. * @param x Reference to the object Lifespan that will be copied. */ eProsima_user_DllExport Lifespan( - Lifespan&& x) noexcept; + Lifespan&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } /*! * @brief Copy assignment. * @param x Reference to the object Lifespan that will be copied. */ eProsima_user_DllExport Lifespan& operator =( - const Lifespan& x); + const Lifespan& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } /*! * @brief Move assignment. * @param x Reference to the object Lifespan that will be copied. */ eProsima_user_DllExport Lifespan& operator =( - Lifespan&& x) noexcept; + Lifespan&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } /*! * @brief Comparison operator. * @param x Lifespan object to compare. */ eProsima_user_DllExport bool operator ==( - const Lifespan& x) const; + const Lifespan& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } /*! * @brief Comparison operator. * @param x Lifespan object to compare. */ eProsima_user_DllExport bool operator !=( - const Lifespan& x) const; + const Lifespan& x) const + { + return !(*this == x); + } /*! * @brief This function sets a value in member index * @param _index New value for member index */ eProsima_user_DllExport void index( - uint32_t _index); + uint32_t _index) + { + m_index = _index; + } /*! * @brief This function returns the value of member index * @return Value of member index */ - eProsima_user_DllExport uint32_t index() const; + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } /*! * @brief This function returns a reference to member index * @return Reference to member index */ - eProsima_user_DllExport uint32_t& index(); + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } /*! @@ -160,26 +180,40 @@ class Lifespan * @param _message New value to be copied in member message */ eProsima_user_DllExport void message( - const std::string& _message); + const std::string& _message) + { + m_message = _message; + } /*! * @brief This function moves the value in member message * @param _message New value to be moved in member message */ eProsima_user_DllExport void message( - std::string&& _message); + std::string&& _message) + { + m_message = std::move(_message); + } /*! * @brief This function returns a constant reference to member message * @return Constant reference to member message */ - eProsima_user_DllExport const std::string& message() const; + eProsima_user_DllExport const std::string& message() const + { + return m_message; + } /*! * @brief This function returns a reference to member message * @return Reference to member message */ - eProsima_user_DllExport std::string& message(); + eProsima_user_DllExport std::string& message() + { + return m_message; + } + + private: @@ -188,8 +222,6 @@ class Lifespan }; -#endif // _FAST_DDS_GENERATED_LIFESPAN_H_ - +#endif // _FAST_DDS_GENERATED_LIFESPAN_HPP_ -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/LifespanQoSExample/LifespanCdrAux.hpp b/examples/cpp/dds/LifespanQoSExample/LifespanCdrAux.hpp index 770a53f6a14..590d3f48c33 100644 --- a/examples/cpp/dds/LifespanQoSExample/LifespanCdrAux.hpp +++ b/examples/cpp/dds/LifespanQoSExample/LifespanCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_LIFESPANCDRAUX_HPP_ #define _FAST_DDS_GENERATED_LIFESPANCDRAUX_HPP_ -#include "Lifespan.h" +#include "Lifespan.hpp" constexpr uint32_t Lifespan_max_cdr_typesize {268UL}; constexpr uint32_t Lifespan_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const Lifespan& data); diff --git a/examples/cpp/dds/LifespanQoSExample/LifespanCdrAux.ipp b/examples/cpp/dds/LifespanQoSExample/LifespanCdrAux.ipp index 59e8f99cfd7..b890d727220 100644 --- a/examples/cpp/dds/LifespanQoSExample/LifespanCdrAux.ipp +++ b/examples/cpp/dds/LifespanQoSExample/LifespanCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/LifespanQoSExample/LifespanPubSubTypes.cxx b/examples/cpp/dds/LifespanQoSExample/LifespanPubSubTypes.cxx index 05b7ea5970c..bddbe31e7d4 100644 --- a/examples/cpp/dds/LifespanQoSExample/LifespanPubSubTypes.cxx +++ b/examples/cpp/dds/LifespanQoSExample/LifespanPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "LifespanPubSubTypes.h" +#include #include -#include "LifespanPubSubTypes.h" #include "LifespanCdrAux.hpp" +#include "LifespanTypeObjectSupport.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; - - LifespanPubSubType::LifespanPubSubType() { setName("Lifespan"); @@ -219,3 +219,11 @@ bool LifespanPubSubType::getKey( return true; } +void LifespanPubSubType::register_type_object_representation() const +{ + register_Lifespan_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "LifespanCdrAux.ipp" diff --git a/examples/cpp/dds/LifespanQoSExample/LifespanPubSubTypes.h b/examples/cpp/dds/LifespanQoSExample/LifespanPubSubTypes.h index df78166fba9..8c936d6dc6f 100644 --- a/examples/cpp/dds/LifespanQoSExample/LifespanPubSubTypes.h +++ b/examples/cpp/dds/LifespanQoSExample/LifespanPubSubTypes.h @@ -29,7 +29,7 @@ #include #include -#include "Lifespan.h" +#include "Lifespan.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type Lifespan defined by the user in the IDL file. * @ingroup Lifespan @@ -90,6 +88,9 @@ class LifespanPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/LifespanQoSExample/LifespanPublisher.h b/examples/cpp/dds/LifespanQoSExample/LifespanPublisher.h index cb0db6fab53..a737941258e 100644 --- a/examples/cpp/dds/LifespanQoSExample/LifespanPublisher.h +++ b/examples/cpp/dds/LifespanQoSExample/LifespanPublisher.h @@ -20,7 +20,7 @@ #ifndef HELLOWORLDPUBLISHER_H_ #define HELLOWORLDPUBLISHER_H_ -#include "Lifespan.h" +#include "Lifespan.hpp" #include "LifespanPubSubTypes.h" #include diff --git a/examples/cpp/dds/LifespanQoSExample/LifespanSubscriber.cpp b/examples/cpp/dds/LifespanQoSExample/LifespanSubscriber.cpp index 737f92b99f2..e7d9b96571f 100644 --- a/examples/cpp/dds/LifespanQoSExample/LifespanSubscriber.cpp +++ b/examples/cpp/dds/LifespanQoSExample/LifespanSubscriber.cpp @@ -130,7 +130,7 @@ void LifespanSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->read_next_sample(&hello, &info) == ReturnCode_t::RETCODE_OK) + if (reader->read_next_sample(&hello, &info) == RETCODE_OK) { if (info.valid_data) { @@ -160,7 +160,7 @@ void LifespanSubscriber::run( for ( uint32_t i = 0; i < listener.n_samples; i++ ) { - if (reader_->take_next_sample((void*) &data, &info) == ReturnCode_t::RETCODE_OK) + if (reader_->take_next_sample((void*) &data, &info) == RETCODE_OK) { std::cout << "Message " << data.message() << " " << data.index() << " read from history" << std::endl; } diff --git a/examples/cpp/dds/LifespanQoSExample/LifespanSubscriber.h b/examples/cpp/dds/LifespanQoSExample/LifespanSubscriber.h index 64434c34bc9..2ba5f0392b9 100644 --- a/examples/cpp/dds/LifespanQoSExample/LifespanSubscriber.h +++ b/examples/cpp/dds/LifespanQoSExample/LifespanSubscriber.h @@ -20,8 +20,8 @@ #ifndef HELLOWORLDSUBSCRIBER_H_ #define HELLOWORLDSUBSCRIBER_H_ +#include "Lifespan.hpp" #include "LifespanPubSubTypes.h" -#include "Lifespan.h" #include #include diff --git a/examples/cpp/dds/LifespanQoSExample/LifespanTypeObjectSupport.cxx b/examples/cpp/dds/LifespanQoSExample/LifespanTypeObjectSupport.cxx new file mode 100644 index 00000000000..52d6afa027c --- /dev/null +++ b/examples/cpp/dds/LifespanQoSExample/LifespanTypeObjectSupport.cxx @@ -0,0 +1,248 @@ +// 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 LifespanTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "LifespanTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Lifespan.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_Lifespan_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_Lifespan_type_identifier(); + + }); +} + +void register_Lifespan_type_identifier() +{ + { + StructTypeFlag struct_flags_Lifespan = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Lifespan; + TypeIdentifierPair type_ids_Lifespan; + QualifiedTypeName type_name_Lifespan = "Lifespan"; + eprosima::fastcdr::optional type_ann_builtin_Lifespan; + eprosima::fastcdr::optional ann_custom_Lifespan; + CompleteTypeDetail detail_Lifespan = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Lifespan, ann_custom_Lifespan, type_name_Lifespan.to_string()); + CompleteStructHeader header_Lifespan; + header_Lifespan = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Lifespan); + CompleteStructMemberSeq member_seq_Lifespan; + { + return_code_Lifespan = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Lifespan); + + if (return_code_Lifespan != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_Lifespan.type_identifier1()._d() || TK_NONE == type_ids_Lifespan.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Lifespan.type_identifier1()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Lifespan.type_identifier1()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Lifespan.type_identifier1()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Lifespan.type_identifier1()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Lifespan.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Lifespan.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Lifespan.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Lifespan.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Lifespan.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Lifespan.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_Lifespan.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Lifespan.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Lifespan.type_identifier2()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Lifespan.type_identifier2()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Lifespan.type_identifier2()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Lifespan.type_identifier2()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Lifespan.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Lifespan.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Lifespan.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Lifespan.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Lifespan.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Lifespan.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_Lifespan.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_Lifespan.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_Lifespan); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_Lifespan, member_index); + } + { + return_code_Lifespan = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_Lifespan); + + if (return_code_Lifespan != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_Lifespan = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_Lifespan); + if (return_code_Lifespan != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_Lifespan.type_identifier1()._d() || TK_NONE == type_ids_Lifespan.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Lifespan.type_identifier1()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Lifespan.type_identifier1()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Lifespan.type_identifier1()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Lifespan.type_identifier1()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Lifespan.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Lifespan.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Lifespan.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Lifespan.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Lifespan.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Lifespan.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_Lifespan.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Lifespan.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Lifespan.type_identifier2()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Lifespan.type_identifier2()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Lifespan.type_identifier2()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Lifespan.type_identifier2()._d() && + EK_COMPLETE == type_ids_Lifespan.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Lifespan.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Lifespan.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Lifespan.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Lifespan.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Lifespan.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Lifespan.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_Lifespan.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_Lifespan.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_Lifespan); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_Lifespan, member_message); + } + CompleteStructType struct_type_Lifespan = TypeObjectUtils::build_complete_struct_type(struct_flags_Lifespan, header_Lifespan, member_seq_Lifespan); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Lifespan, type_name_Lifespan.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Lifespan already registered in TypeObjectRegistry for a different type."); + } + return_code_Lifespan = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Lifespan", type_ids_Lifespan); + if (return_code_Lifespan != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Lifespan: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/LifespanQoSExample/LifespanTypeObjectSupport.hpp b/examples/cpp/dds/LifespanQoSExample/LifespanTypeObjectSupport.hpp new file mode 100644 index 00000000000..c0b2e0b9327 --- /dev/null +++ b/examples/cpp/dds/LifespanQoSExample/LifespanTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// 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 LifespanTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_LIFESPAN_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_LIFESPAN_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_Lifespan_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register Lifespan related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_Lifespan_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_LIFESPAN_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/LifespanQoSExample/Lifespanv1.cxx b/examples/cpp/dds/LifespanQoSExample/Lifespanv1.cxx deleted file mode 100644 index 81eaa4dd19b..00000000000 --- a/examples/cpp/dds/LifespanQoSExample/Lifespanv1.cxx +++ /dev/null @@ -1,286 +0,0 @@ -// 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 Lifespan.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Lifespan.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define Lifespan_max_cdr_typesize 268ULL; - - - - -Lifespan::Lifespan() -{ - // unsigned long m_index - m_index = 0; - // /type_d() m_message - - -} - -Lifespan::~Lifespan() -{ -} - -Lifespan::Lifespan( - const Lifespan& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -Lifespan::Lifespan( - Lifespan&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -Lifespan& Lifespan::operator =( - const Lifespan& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -Lifespan& Lifespan::operator =( - Lifespan&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool Lifespan::operator ==( - const Lifespan& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool Lifespan::operator !=( - const Lifespan& x) const -{ - return !(*this == x); -} - -size_t Lifespan::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return Lifespan_max_cdr_typesize; -} - -size_t Lifespan::getCdrSerializedSize( - const Lifespan& 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 Lifespan::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_message.c_str(); - -} - -void Lifespan::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_message; - - -} - - -bool Lifespan::isKeyDefined() -{ - return false; -} - -void Lifespan::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void Lifespan::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t Lifespan::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& Lifespan::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void Lifespan::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void Lifespan::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& Lifespan::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& Lifespan::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/LifespanQoSExample/Lifespanv1.h b/examples/cpp/dds/LifespanQoSExample/Lifespanv1.h deleted file mode 100644 index 879cfe4d3a0..00000000000 --- a/examples/cpp/dds/LifespanQoSExample/Lifespanv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// 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 Lifespan.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_LIFESPAN_H_ -#define _FAST_DDS_GENERATED_LIFESPAN_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(LIFESPAN_SOURCE) -#define LIFESPAN_DllAPI __declspec( dllexport ) -#else -#define LIFESPAN_DllAPI __declspec( dllimport ) -#endif // LIFESPAN_SOURCE -#else -#define LIFESPAN_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define LIFESPAN_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure Lifespan defined by the user in the IDL file. - * @ingroup Lifespan - */ -class Lifespan -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Lifespan(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Lifespan(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object Lifespan that will be copied. - */ - eProsima_user_DllExport Lifespan( - const Lifespan& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object Lifespan that will be copied. - */ - eProsima_user_DllExport Lifespan( - Lifespan&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object Lifespan that will be copied. - */ - eProsima_user_DllExport Lifespan& operator =( - const Lifespan& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object Lifespan that will be copied. - */ - eProsima_user_DllExport Lifespan& operator =( - Lifespan&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x Lifespan object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Lifespan& x) const; - - /*! - * @brief Comparison operator. - * @param x Lifespan object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Lifespan& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - 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 - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - 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 Lifespan& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint32_t m_index; - std::string m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_LIFESPAN_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/LivelinessQoS/LivelinessPublisher.h b/examples/cpp/dds/LivelinessQoS/LivelinessPublisher.h index e98202b7033..9b8eb9d5f3e 100644 --- a/examples/cpp/dds/LivelinessQoS/LivelinessPublisher.h +++ b/examples/cpp/dds/LivelinessQoS/LivelinessPublisher.h @@ -22,15 +22,15 @@ #include +#include "TopicPubSubTypes.h" +#include "Topic.hpp" + #include #include #include #include #include -#include "Topic.h" -#include "TopicPubSubTypes.h" - class LivelinessPublisher { public: diff --git a/examples/cpp/dds/LivelinessQoS/LivelinessSubscriber.cpp b/examples/cpp/dds/LivelinessQoS/LivelinessSubscriber.cpp index 816db593b5a..e18664904ad 100644 --- a/examples/cpp/dds/LivelinessQoS/LivelinessSubscriber.cpp +++ b/examples/cpp/dds/LivelinessQoS/LivelinessSubscriber.cpp @@ -138,7 +138,7 @@ void LivelinessSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(&topic, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&topic, &info) == RETCODE_OK) { if (info.valid_data) { diff --git a/examples/cpp/dds/LivelinessQoS/LivelinessSubscriber.h b/examples/cpp/dds/LivelinessQoS/LivelinessSubscriber.h index 5f10a008e11..9106595f451 100644 --- a/examples/cpp/dds/LivelinessQoS/LivelinessSubscriber.h +++ b/examples/cpp/dds/LivelinessQoS/LivelinessSubscriber.h @@ -20,6 +20,9 @@ #ifndef LIVELINESSSUBSCRIBER_H_ #define LIVELINESSSUBSCRIBER_H_ +#include "TopicPubSubTypes.h" +#include "Topic.hpp" + #include #include #include @@ -28,9 +31,6 @@ #include #include -#include "TopicPubSubTypes.h" -#include "Topic.h" - class LivelinessSubscriber { public: diff --git a/examples/cpp/dds/LivelinessQoS/Topic.cxx b/examples/cpp/dds/LivelinessQoS/Topic.cxx deleted file mode 100644 index ca86d176ba1..00000000000 --- a/examples/cpp/dds/LivelinessQoS/Topic.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// 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 Topic.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Topic.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -Topic::Topic() -{ -} - -Topic::~Topic() -{ -} - -Topic::Topic( - const Topic& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -Topic::Topic( - Topic&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -Topic& Topic::operator =( - const Topic& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -Topic& Topic::operator =( - Topic&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool Topic::operator ==( - const Topic& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool Topic::operator !=( - const Topic& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void Topic::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t Topic::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& Topic::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void Topic::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void Topic::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& Topic::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& Topic::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "TopicCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/CustomListenerExample/Topic.h b/examples/cpp/dds/LivelinessQoS/Topic.hpp similarity index 69% rename from examples/cpp/dds/CustomListenerExample/Topic.h rename to examples/cpp/dds/LivelinessQoS/Topic.hpp index 2596f317a1e..8f86884c2b8 100644 --- a/examples/cpp/dds/CustomListenerExample/Topic.h +++ b/examples/cpp/dds/LivelinessQoS/Topic.hpp @@ -13,32 +13,19 @@ // limitations under the License. /*! - * @file Topic.h + * @file Topic.hpp * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool fastddsgen. */ -#include -#include "Topicv1.h" +#ifndef _FAST_DDS_GENERATED_TOPIC_HPP_ +#define _FAST_DDS_GENERATED_TOPIC_HPP_ -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_TOPIC_H_ -#define _FAST_DDS_GENERATED_TOPIC_H_ - -#include -#include #include -#include #include -#include - +#include #include -#include -#include - - #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -64,17 +51,6 @@ #define TOPIC_DllAPI #endif // _WIN32 -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - /*! * @brief This class represents the structure Topic defined by the user in the IDL file. * @ingroup Topic @@ -86,73 +62,117 @@ class Topic /*! * @brief Default constructor. */ - eProsima_user_DllExport Topic(); + eProsima_user_DllExport Topic() + { + } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~Topic(); + eProsima_user_DllExport ~Topic() + { + } /*! * @brief Copy constructor. * @param x Reference to the object Topic that will be copied. */ eProsima_user_DllExport Topic( - const Topic& x); + const Topic& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } /*! * @brief Move constructor. * @param x Reference to the object Topic that will be copied. */ eProsima_user_DllExport Topic( - Topic&& x) noexcept; + Topic&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } /*! * @brief Copy assignment. * @param x Reference to the object Topic that will be copied. */ eProsima_user_DllExport Topic& operator =( - const Topic& x); + const Topic& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } /*! * @brief Move assignment. * @param x Reference to the object Topic that will be copied. */ eProsima_user_DllExport Topic& operator =( - Topic&& x) noexcept; + Topic&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } /*! * @brief Comparison operator. * @param x Topic object to compare. */ eProsima_user_DllExport bool operator ==( - const Topic& x) const; + const Topic& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } /*! * @brief Comparison operator. * @param x Topic object to compare. */ eProsima_user_DllExport bool operator !=( - const Topic& x) const; + const Topic& x) const + { + return !(*this == x); + } /*! * @brief This function sets a value in member index * @param _index New value for member index */ eProsima_user_DllExport void index( - uint32_t _index); + uint32_t _index) + { + m_index = _index; + } /*! * @brief This function returns the value of member index * @return Value of member index */ - eProsima_user_DllExport uint32_t index() const; + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } /*! * @brief This function returns a reference to member index * @return Reference to member index */ - eProsima_user_DllExport uint32_t& index(); + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } /*! @@ -160,26 +180,40 @@ class Topic * @param _message New value to be copied in member message */ eProsima_user_DllExport void message( - const std::string& _message); + const std::string& _message) + { + m_message = _message; + } /*! * @brief This function moves the value in member message * @param _message New value to be moved in member message */ eProsima_user_DllExport void message( - std::string&& _message); + std::string&& _message) + { + m_message = std::move(_message); + } /*! * @brief This function returns a constant reference to member message * @return Constant reference to member message */ - eProsima_user_DllExport const std::string& message() const; + eProsima_user_DllExport const std::string& message() const + { + return m_message; + } /*! * @brief This function returns a reference to member message * @return Reference to member message */ - eProsima_user_DllExport std::string& message(); + eProsima_user_DllExport std::string& message() + { + return m_message; + } + + private: @@ -188,8 +222,6 @@ class Topic }; -#endif // _FAST_DDS_GENERATED_TOPIC_H_ - +#endif // _FAST_DDS_GENERATED_TOPIC_HPP_ -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/LivelinessQoS/TopicCdrAux.hpp b/examples/cpp/dds/LivelinessQoS/TopicCdrAux.hpp index 619cdbbb7b8..7b60c44c7b4 100644 --- a/examples/cpp/dds/LivelinessQoS/TopicCdrAux.hpp +++ b/examples/cpp/dds/LivelinessQoS/TopicCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_TOPICCDRAUX_HPP_ #define _FAST_DDS_GENERATED_TOPICCDRAUX_HPP_ -#include "Topic.h" +#include "Topic.hpp" constexpr uint32_t Topic_max_cdr_typesize {268UL}; constexpr uint32_t Topic_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const Topic& data); diff --git a/examples/cpp/dds/LivelinessQoS/TopicCdrAux.ipp b/examples/cpp/dds/LivelinessQoS/TopicCdrAux.ipp index ac5a8c39ef9..37570c8a6b2 100644 --- a/examples/cpp/dds/LivelinessQoS/TopicCdrAux.ipp +++ b/examples/cpp/dds/LivelinessQoS/TopicCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/LivelinessQoS/TopicPubSubTypes.cxx b/examples/cpp/dds/LivelinessQoS/TopicPubSubTypes.cxx index ce688064a0e..8d6d0b195c9 100644 --- a/examples/cpp/dds/LivelinessQoS/TopicPubSubTypes.cxx +++ b/examples/cpp/dds/LivelinessQoS/TopicPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "TopicPubSubTypes.h" +#include #include -#include "TopicPubSubTypes.h" #include "TopicCdrAux.hpp" +#include "TopicTypeObjectSupport.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; - - TopicPubSubType::TopicPubSubType() { setName("Topic"); @@ -219,3 +219,11 @@ bool TopicPubSubType::getKey( return true; } +void TopicPubSubType::register_type_object_representation() const +{ + register_Topic_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "TopicCdrAux.ipp" diff --git a/examples/cpp/dds/LivelinessQoS/TopicPubSubTypes.h b/examples/cpp/dds/LivelinessQoS/TopicPubSubTypes.h index 0e584d6086a..0b37b3746f3 100644 --- a/examples/cpp/dds/LivelinessQoS/TopicPubSubTypes.h +++ b/examples/cpp/dds/LivelinessQoS/TopicPubSubTypes.h @@ -29,7 +29,7 @@ #include #include -#include "Topic.h" +#include "Topic.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type Topic defined by the user in the IDL file. * @ingroup Topic @@ -90,6 +88,9 @@ class TopicPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/LivelinessQoS/TopicTypeObjectSupport.cxx b/examples/cpp/dds/LivelinessQoS/TopicTypeObjectSupport.cxx new file mode 100644 index 00000000000..067fd08a822 --- /dev/null +++ b/examples/cpp/dds/LivelinessQoS/TopicTypeObjectSupport.cxx @@ -0,0 +1,248 @@ +// 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 TopicTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "TopicTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Topic.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_Topic_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_Topic_type_identifier(); + + }); +} + +void register_Topic_type_identifier() +{ + { + StructTypeFlag struct_flags_Topic = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_Topic; + TypeIdentifierPair type_ids_Topic; + QualifiedTypeName type_name_Topic = "Topic"; + eprosima::fastcdr::optional type_ann_builtin_Topic; + eprosima::fastcdr::optional ann_custom_Topic; + CompleteTypeDetail detail_Topic = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Topic, ann_custom_Topic, type_name_Topic.to_string()); + CompleteStructHeader header_Topic; + header_Topic = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Topic); + CompleteStructMemberSeq member_seq_Topic; + { + return_code_Topic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_Topic); + + if (return_code_Topic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_Topic.type_identifier1()._d() || TK_NONE == type_ids_Topic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Topic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Topic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_Topic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Topic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Topic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Topic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_Topic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_Topic.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_Topic); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_Topic, member_index); + } + { + return_code_Topic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_Topic); + + if (return_code_Topic != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_Topic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_Topic); + if (return_code_Topic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_Topic.type_identifier1()._d() || TK_NONE == type_ids_Topic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Topic.type_identifier1()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Topic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Topic.type_identifier1()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_Topic.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_Topic.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_Topic.type_identifier2()._d() && + EK_COMPLETE == type_ids_Topic.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_Topic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_Topic.type_identifier2()._d() && + (EK_COMPLETE == type_ids_Topic.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_Topic.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_Topic.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_Topic.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_Topic); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_Topic, member_message); + } + CompleteStructType struct_type_Topic = TypeObjectUtils::build_complete_struct_type(struct_flags_Topic, header_Topic, member_seq_Topic); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Topic, type_name_Topic.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Topic already registered in TypeObjectRegistry for a different type."); + } + return_code_Topic = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "Topic", type_ids_Topic); + if (return_code_Topic != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Topic: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/LivelinessQoS/TopicTypeObjectSupport.hpp b/examples/cpp/dds/LivelinessQoS/TopicTypeObjectSupport.hpp new file mode 100644 index 00000000000..f0576f9b948 --- /dev/null +++ b/examples/cpp/dds/LivelinessQoS/TopicTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// 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 TopicTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_TOPIC_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_TOPIC_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_Topic_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register Topic related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_Topic_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_TOPIC_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/LivelinessQoS/Topicv1.cxx b/examples/cpp/dds/LivelinessQoS/Topicv1.cxx deleted file mode 100644 index a3e85584242..00000000000 --- a/examples/cpp/dds/LivelinessQoS/Topicv1.cxx +++ /dev/null @@ -1,286 +0,0 @@ -// 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 Topic.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Topic.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define Topic_max_cdr_typesize 268ULL; - - - - -Topic::Topic() -{ - // unsigned long m_index - m_index = 0; - // /type_d() m_message - - -} - -Topic::~Topic() -{ -} - -Topic::Topic( - const Topic& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -Topic::Topic( - Topic&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -Topic& Topic::operator =( - const Topic& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -Topic& Topic::operator =( - Topic&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool Topic::operator ==( - const Topic& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool Topic::operator !=( - const Topic& x) const -{ - return !(*this == x); -} - -size_t Topic::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return Topic_max_cdr_typesize; -} - -size_t Topic::getCdrSerializedSize( - const Topic& 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 Topic::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_message.c_str(); - -} - -void Topic::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_message; - - -} - - -bool Topic::isKeyDefined() -{ - return false; -} - -void Topic::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void Topic::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t Topic::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& Topic::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void Topic::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void Topic::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& Topic::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& Topic::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/LivelinessQoS/Topicv1.h b/examples/cpp/dds/LivelinessQoS/Topicv1.h deleted file mode 100644 index 1e9d07ab2b4..00000000000 --- a/examples/cpp/dds/LivelinessQoS/Topicv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// 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 Topic.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_TOPIC_H_ -#define _FAST_DDS_GENERATED_TOPIC_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TOPIC_SOURCE) -#define TOPIC_DllAPI __declspec( dllexport ) -#else -#define TOPIC_DllAPI __declspec( dllimport ) -#endif // TOPIC_SOURCE -#else -#define TOPIC_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TOPIC_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure Topic defined by the user in the IDL file. - * @ingroup Topic - */ -class Topic -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport Topic(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~Topic(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic( - const Topic& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic( - Topic&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic& operator =( - const Topic& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object Topic that will be copied. - */ - eProsima_user_DllExport Topic& operator =( - Topic&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x Topic object to compare. - */ - eProsima_user_DllExport bool operator ==( - const Topic& x) const; - - /*! - * @brief Comparison operator. - * @param x Topic object to compare. - */ - eProsima_user_DllExport bool operator !=( - const Topic& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - 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 - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - 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 Topic& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint32_t m_index; - std::string m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_TOPIC_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.cxx b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.cxx deleted file mode 100644 index c566d2aa145..00000000000 --- a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.cxx +++ /dev/null @@ -1,202 +0,0 @@ -// 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 OwnershipStrength.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "OwnershipStrength.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -ExampleMessage::ExampleMessage() -{ -} - -ExampleMessage::~ExampleMessage() -{ -} - -ExampleMessage::ExampleMessage( - const ExampleMessage& x) -{ - m_index = x.m_index; - m_ownershipStrength = x.m_ownershipStrength; - m_message = x.m_message; -} - -ExampleMessage::ExampleMessage( - ExampleMessage&& x) noexcept -{ - m_index = x.m_index; - m_ownershipStrength = x.m_ownershipStrength; - m_message = std::move(x.m_message); -} - -ExampleMessage& ExampleMessage::operator =( - const ExampleMessage& x) -{ - - m_index = x.m_index; - m_ownershipStrength = x.m_ownershipStrength; - m_message = x.m_message; - return *this; -} - -ExampleMessage& ExampleMessage::operator =( - ExampleMessage&& x) noexcept -{ - - m_index = x.m_index; - m_ownershipStrength = x.m_ownershipStrength; - m_message = std::move(x.m_message); - return *this; -} - -bool ExampleMessage::operator ==( - const ExampleMessage& x) const -{ - return (m_index == x.m_index && - m_ownershipStrength == x.m_ownershipStrength && - m_message == x.m_message); -} - -bool ExampleMessage::operator !=( - const ExampleMessage& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void ExampleMessage::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t ExampleMessage::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& ExampleMessage::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member ownershipStrength - * @param _ownershipStrength New value for member ownershipStrength - */ -void ExampleMessage::ownershipStrength( - uint32_t _ownershipStrength) -{ - m_ownershipStrength = _ownershipStrength; -} - -/*! - * @brief This function returns the value of member ownershipStrength - * @return Value of member ownershipStrength - */ -uint32_t ExampleMessage::ownershipStrength() const -{ - return m_ownershipStrength; -} - -/*! - * @brief This function returns a reference to member ownershipStrength - * @return Reference to member ownershipStrength - */ -uint32_t& ExampleMessage::ownershipStrength() -{ - return m_ownershipStrength; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void ExampleMessage::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void ExampleMessage::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& ExampleMessage::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& ExampleMessage::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "OwnershipStrengthCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.h b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.hpp similarity index 65% rename from examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.h rename to examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.hpp index 2ce1eddefa3..7b2459abfca 100644 --- a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.h +++ b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrength.hpp @@ -13,32 +13,19 @@ // limitations under the License. /*! - * @file OwnershipStrength.h + * @file OwnershipStrength.hpp * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool fastddsgen. */ -#include -#include "OwnershipStrengthv1.h" +#ifndef _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_HPP_ +#define _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_HPP_ -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_H_ -#define _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_H_ - -#include -#include #include -#include #include -#include - +#include #include -#include -#include - - #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -64,17 +51,6 @@ #define OWNERSHIPSTRENGTH_DllAPI #endif // _WIN32 -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - /*! * @brief This class represents the structure ExampleMessage defined by the user in the IDL file. * @ingroup OwnershipStrength @@ -86,73 +62,124 @@ class ExampleMessage /*! * @brief Default constructor. */ - eProsima_user_DllExport ExampleMessage(); + eProsima_user_DllExport ExampleMessage() + { + } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~ExampleMessage(); + eProsima_user_DllExport ~ExampleMessage() + { + } /*! * @brief Copy constructor. * @param x Reference to the object ExampleMessage that will be copied. */ eProsima_user_DllExport ExampleMessage( - const ExampleMessage& x); + const ExampleMessage& x) + { + m_index = x.m_index; + + m_ownershipStrength = x.m_ownershipStrength; + + m_message = x.m_message; + + } /*! * @brief Move constructor. * @param x Reference to the object ExampleMessage that will be copied. */ eProsima_user_DllExport ExampleMessage( - ExampleMessage&& x) noexcept; + ExampleMessage&& x) noexcept + { + m_index = x.m_index; + m_ownershipStrength = x.m_ownershipStrength; + m_message = std::move(x.m_message); + } /*! * @brief Copy assignment. * @param x Reference to the object ExampleMessage that will be copied. */ eProsima_user_DllExport ExampleMessage& operator =( - const ExampleMessage& x); + const ExampleMessage& x) + { + + m_index = x.m_index; + + m_ownershipStrength = x.m_ownershipStrength; + + m_message = x.m_message; + + return *this; + } /*! * @brief Move assignment. * @param x Reference to the object ExampleMessage that will be copied. */ eProsima_user_DllExport ExampleMessage& operator =( - ExampleMessage&& x) noexcept; + ExampleMessage&& x) noexcept + { + + m_index = x.m_index; + m_ownershipStrength = x.m_ownershipStrength; + m_message = std::move(x.m_message); + return *this; + } /*! * @brief Comparison operator. * @param x ExampleMessage object to compare. */ eProsima_user_DllExport bool operator ==( - const ExampleMessage& x) const; + const ExampleMessage& x) const + { + return (m_index == x.m_index && + m_ownershipStrength == x.m_ownershipStrength && + m_message == x.m_message); + } /*! * @brief Comparison operator. * @param x ExampleMessage object to compare. */ eProsima_user_DllExport bool operator !=( - const ExampleMessage& x) const; + const ExampleMessage& x) const + { + return !(*this == x); + } /*! * @brief This function sets a value in member index * @param _index New value for member index */ eProsima_user_DllExport void index( - uint32_t _index); + uint32_t _index) + { + m_index = _index; + } /*! * @brief This function returns the value of member index * @return Value of member index */ - eProsima_user_DllExport uint32_t index() const; + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } /*! * @brief This function returns a reference to member index * @return Reference to member index */ - eProsima_user_DllExport uint32_t& index(); + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } /*! @@ -160,19 +187,28 @@ class ExampleMessage * @param _ownershipStrength New value for member ownershipStrength */ eProsima_user_DllExport void ownershipStrength( - uint32_t _ownershipStrength); + uint32_t _ownershipStrength) + { + m_ownershipStrength = _ownershipStrength; + } /*! * @brief This function returns the value of member ownershipStrength * @return Value of member ownershipStrength */ - eProsima_user_DllExport uint32_t ownershipStrength() const; + eProsima_user_DllExport uint32_t ownershipStrength() const + { + return m_ownershipStrength; + } /*! * @brief This function returns a reference to member ownershipStrength * @return Reference to member ownershipStrength */ - eProsima_user_DllExport uint32_t& ownershipStrength(); + eProsima_user_DllExport uint32_t& ownershipStrength() + { + return m_ownershipStrength; + } /*! @@ -180,26 +216,40 @@ class ExampleMessage * @param _message New value to be copied in member message */ eProsima_user_DllExport void message( - const std::string& _message); + const std::string& _message) + { + m_message = _message; + } /*! * @brief This function moves the value in member message * @param _message New value to be moved in member message */ eProsima_user_DllExport void message( - std::string&& _message); + std::string&& _message) + { + m_message = std::move(_message); + } /*! * @brief This function returns a constant reference to member message * @return Constant reference to member message */ - eProsima_user_DllExport const std::string& message() const; + eProsima_user_DllExport const std::string& message() const + { + return m_message; + } /*! * @brief This function returns a reference to member message * @return Reference to member message */ - eProsima_user_DllExport std::string& message(); + eProsima_user_DllExport std::string& message() + { + return m_message; + } + + private: @@ -209,8 +259,6 @@ class ExampleMessage }; -#endif // _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_H_ - +#endif // _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_HPP_ -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthCdrAux.hpp b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthCdrAux.hpp index d0eed4b0f5f..b13a1e7de3e 100644 --- a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthCdrAux.hpp +++ b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_OWNERSHIPSTRENGTHCDRAUX_HPP_ #define _FAST_DDS_GENERATED_OWNERSHIPSTRENGTHCDRAUX_HPP_ -#include "OwnershipStrength.h" +#include "OwnershipStrength.hpp" constexpr uint32_t ExampleMessage_max_cdr_typesize {272UL}; constexpr uint32_t ExampleMessage_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const ExampleMessage& data); diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthCdrAux.ipp b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthCdrAux.ipp index 5adb5bdd0a1..d4beca7dd09 100644 --- a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthCdrAux.ipp +++ b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthPubSubTypes.cxx b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthPubSubTypes.cxx index 279bcd498c4..ea56a8eeb1a 100644 --- a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthPubSubTypes.cxx +++ b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "OwnershipStrengthPubSubTypes.h" +#include #include -#include "OwnershipStrengthPubSubTypes.h" #include "OwnershipStrengthCdrAux.hpp" +#include "OwnershipStrengthTypeObjectSupport.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; - - ExampleMessagePubSubType::ExampleMessagePubSubType() { setName("ExampleMessage"); @@ -219,3 +219,11 @@ bool ExampleMessagePubSubType::getKey( return true; } +void ExampleMessagePubSubType::register_type_object_representation() const +{ + register_OwnershipStrength_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "OwnershipStrengthCdrAux.ipp" diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthPubSubTypes.h b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthPubSubTypes.h index 51894058896..02d1733e97d 100644 --- a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthPubSubTypes.h +++ b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthPubSubTypes.h @@ -29,7 +29,7 @@ #include #include -#include "OwnershipStrength.h" +#include "OwnershipStrength.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type ExampleMessage defined by the user in the IDL file. * @ingroup OwnershipStrength @@ -90,6 +88,9 @@ class ExampleMessagePubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthSubscriber.cxx b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthSubscriber.cxx index 96ff1b66d07..ca8ae3cedb9 100644 --- a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthSubscriber.cxx +++ b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthSubscriber.cxx @@ -174,7 +174,7 @@ void OwnershipStrengthSubscriber::SubListener::on_data_available( { SampleInfo info; ExampleMessage st; - if (reader->take_next_sample(&st, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&st, &info) == RETCODE_OK) { if (info.valid_data && m_hierarchy.IsMessageStrong(st, info)) { diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthTypeObjectSupport.cxx b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthTypeObjectSupport.cxx new file mode 100644 index 00000000000..2af3cdeeeff --- /dev/null +++ b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthTypeObjectSupport.cxx @@ -0,0 +1,312 @@ +// 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 OwnershipStrengthTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "OwnershipStrengthTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "OwnershipStrength.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_OwnershipStrength_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_ExampleMessage_type_identifier(); + + }); +} + +void register_ExampleMessage_type_identifier() +{ + { + StructTypeFlag struct_flags_ExampleMessage = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_ExampleMessage; + TypeIdentifierPair type_ids_ExampleMessage; + QualifiedTypeName type_name_ExampleMessage = "ExampleMessage"; + eprosima::fastcdr::optional type_ann_builtin_ExampleMessage; + eprosima::fastcdr::optional ann_custom_ExampleMessage; + CompleteTypeDetail detail_ExampleMessage = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_ExampleMessage, ann_custom_ExampleMessage, type_name_ExampleMessage.to_string()); + CompleteStructHeader header_ExampleMessage; + header_ExampleMessage = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_ExampleMessage); + CompleteStructMemberSeq member_seq_ExampleMessage; + { + return_code_ExampleMessage = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_ExampleMessage); + + if (return_code_ExampleMessage != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_ExampleMessage.type_identifier1()._d() || TK_NONE == type_ids_ExampleMessage.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ExampleMessage.type_identifier1()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ExampleMessage.type_identifier1()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ExampleMessage.type_identifier1()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ExampleMessage.type_identifier1()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ExampleMessage.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ExampleMessage.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_ExampleMessage.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ExampleMessage.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ExampleMessage.type_identifier2()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ExampleMessage.type_identifier2()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ExampleMessage.type_identifier2()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ExampleMessage.type_identifier2()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ExampleMessage.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ExampleMessage.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_ExampleMessage.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_ExampleMessage.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_ExampleMessage); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_ExampleMessage, member_index); + } + { + return_code_ExampleMessage = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_ExampleMessage); + + if (return_code_ExampleMessage != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "ownershipStrength Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_ownershipStrength = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_ownershipStrength; + MemberId member_id_ownershipStrength = 0x00000001; + if (EK_COMPLETE == type_ids_ExampleMessage.type_identifier1()._d() || TK_NONE == type_ids_ExampleMessage.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ExampleMessage.type_identifier1()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ExampleMessage.type_identifier1()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ExampleMessage.type_identifier1()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ExampleMessage.type_identifier1()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ExampleMessage.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ExampleMessage.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_ownershipStrength = TypeObjectUtils::build_common_struct_member(member_id_ownershipStrength, member_flags_ownershipStrength, type_ids_ExampleMessage.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ExampleMessage.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ExampleMessage.type_identifier2()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ExampleMessage.type_identifier2()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ExampleMessage.type_identifier2()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ExampleMessage.type_identifier2()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ExampleMessage.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ExampleMessage.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_ownershipStrength = TypeObjectUtils::build_common_struct_member(member_id_ownershipStrength, member_flags_ownershipStrength, type_ids_ExampleMessage.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure ownershipStrength member TypeIdentifier inconsistent."); + return; + } + MemberName name_ownershipStrength = "ownershipStrength"; + eprosima::fastcdr::optional member_ann_builtin_ownershipStrength; + ann_custom_ExampleMessage.reset(); + CompleteMemberDetail detail_ownershipStrength = TypeObjectUtils::build_complete_member_detail(name_ownershipStrength, member_ann_builtin_ownershipStrength, ann_custom_ExampleMessage); + CompleteStructMember member_ownershipStrength = TypeObjectUtils::build_complete_struct_member(common_ownershipStrength, detail_ownershipStrength); + TypeObjectUtils::add_complete_struct_member(member_seq_ExampleMessage, member_ownershipStrength); + } + { + return_code_ExampleMessage = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_ExampleMessage); + + if (return_code_ExampleMessage != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_ExampleMessage = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_ExampleMessage); + if (return_code_ExampleMessage != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000002; + if (EK_COMPLETE == type_ids_ExampleMessage.type_identifier1()._d() || TK_NONE == type_ids_ExampleMessage.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ExampleMessage.type_identifier1()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ExampleMessage.type_identifier1()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ExampleMessage.type_identifier1()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ExampleMessage.type_identifier1()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ExampleMessage.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ExampleMessage.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ExampleMessage.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_ExampleMessage.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ExampleMessage.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ExampleMessage.type_identifier2()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ExampleMessage.type_identifier2()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ExampleMessage.type_identifier2()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ExampleMessage.type_identifier2()._d() && + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ExampleMessage.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ExampleMessage.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ExampleMessage.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_ExampleMessage.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_ExampleMessage.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_ExampleMessage); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_ExampleMessage, member_message); + } + CompleteStructType struct_type_ExampleMessage = TypeObjectUtils::build_complete_struct_type(struct_flags_ExampleMessage, header_ExampleMessage, member_seq_ExampleMessage); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_ExampleMessage, type_name_ExampleMessage.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "ExampleMessage already registered in TypeObjectRegistry for a different type."); + } + return_code_ExampleMessage = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "ExampleMessage", type_ids_ExampleMessage); + if (return_code_ExampleMessage != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "ExampleMessage: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthTypeObjectSupport.hpp b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthTypeObjectSupport.hpp new file mode 100644 index 00000000000..e16f4b42995 --- /dev/null +++ b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// 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 OwnershipStrengthTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_OwnershipStrength_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register ExampleMessage related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_ExampleMessage_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthv1.cxx b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthv1.cxx deleted file mode 100644 index b98d38c3f26..00000000000 --- a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthv1.cxx +++ /dev/null @@ -1,339 +0,0 @@ -// 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 OwnershipStrength.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "OwnershipStrength.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define ExampleMessage_max_cdr_typesize 272ULL; - - - - -ExampleMessage::ExampleMessage() -{ - // unsigned long m_index - m_index = 0; - // unsigned long m_ownershipStrength - m_ownershipStrength = 0; - // /type_d() m_message - - -} - -ExampleMessage::~ExampleMessage() -{ -} - -ExampleMessage::ExampleMessage( - const ExampleMessage& x) -{ - m_index = x.m_index; - - - m_ownershipStrength = x.m_ownershipStrength; - - - m_message = x.m_message; - -} - -ExampleMessage::ExampleMessage( - ExampleMessage&& x) noexcept -{ - m_index = x.m_index; - - - m_ownershipStrength = x.m_ownershipStrength; - - - m_message = std::move(x.m_message); - -} - -ExampleMessage& ExampleMessage::operator =( - const ExampleMessage& x) -{ - m_index = x.m_index; - - - m_ownershipStrength = x.m_ownershipStrength; - - - m_message = x.m_message; - - return *this; -} - -ExampleMessage& ExampleMessage::operator =( - ExampleMessage&& x) noexcept -{ - m_index = x.m_index; - - - m_ownershipStrength = x.m_ownershipStrength; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool ExampleMessage::operator ==( - const ExampleMessage& x) const -{ - return (m_index == x.m_index && - m_ownershipStrength == x.m_ownershipStrength && - m_message == x.m_message); -} - -bool ExampleMessage::operator !=( - const ExampleMessage& x) const -{ - return !(*this == x); -} - -size_t ExampleMessage::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ExampleMessage_max_cdr_typesize; -} - -size_t ExampleMessage::getCdrSerializedSize( - const ExampleMessage& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void ExampleMessage::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_ownershipStrength; - - scdr << m_message.c_str(); - -} - -void ExampleMessage::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_ownershipStrength; - - - - dcdr >> m_message; - - -} - - -bool ExampleMessage::isKeyDefined() -{ - return false; -} - -void ExampleMessage::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void ExampleMessage::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t ExampleMessage::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& ExampleMessage::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member ownershipStrength - * @param _ownershipStrength New value for member ownershipStrength - */ -void ExampleMessage::ownershipStrength( - uint32_t _ownershipStrength) -{ - m_ownershipStrength = _ownershipStrength; -} - -/*! - * @brief This function returns the value of member ownershipStrength - * @return Value of member ownershipStrength - */ -uint32_t ExampleMessage::ownershipStrength() const -{ - return m_ownershipStrength; -} - -/*! - * @brief This function returns a reference to member ownershipStrength - * @return Reference to member ownershipStrength - */ -uint32_t& ExampleMessage::ownershipStrength() -{ - return m_ownershipStrength; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void ExampleMessage::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void ExampleMessage::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& ExampleMessage::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& ExampleMessage::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthv1.h b/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthv1.h deleted file mode 100644 index 3506cd7f2f0..00000000000 --- a/examples/cpp/dds/OwnershipStrengthQoSExample/OwnershipStrengthv1.h +++ /dev/null @@ -1,265 +0,0 @@ -// 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 OwnershipStrength.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_H_ -#define _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(OWNERSHIPSTRENGTH_SOURCE) -#define OWNERSHIPSTRENGTH_DllAPI __declspec( dllexport ) -#else -#define OWNERSHIPSTRENGTH_DllAPI __declspec( dllimport ) -#endif // OWNERSHIPSTRENGTH_SOURCE -#else -#define OWNERSHIPSTRENGTH_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define OWNERSHIPSTRENGTH_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure ExampleMessage defined by the user in the IDL file. - * @ingroup OwnershipStrength - */ -class ExampleMessage -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ExampleMessage(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ExampleMessage(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ExampleMessage that will be copied. - */ - eProsima_user_DllExport ExampleMessage( - const ExampleMessage& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ExampleMessage that will be copied. - */ - eProsima_user_DllExport ExampleMessage( - ExampleMessage&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ExampleMessage that will be copied. - */ - eProsima_user_DllExport ExampleMessage& operator =( - const ExampleMessage& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ExampleMessage that will be copied. - */ - eProsima_user_DllExport ExampleMessage& operator =( - ExampleMessage&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ExampleMessage object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ExampleMessage& x) const; - - /*! - * @brief Comparison operator. - * @param x ExampleMessage object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ExampleMessage& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint32_t& index(); - - - /*! - * @brief This function sets a value in member ownershipStrength - * @param _ownershipStrength New value for member ownershipStrength - */ - eProsima_user_DllExport void ownershipStrength( - uint32_t _ownershipStrength); - - /*! - * @brief This function returns the value of member ownershipStrength - * @return Value of member ownershipStrength - */ - eProsima_user_DllExport uint32_t ownershipStrength() const; - - /*! - * @brief This function returns a reference to member ownershipStrength - * @return Reference to member ownershipStrength - */ - eProsima_user_DllExport uint32_t& ownershipStrength(); - - - /*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - 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 ExampleMessage& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint32_t m_index; - uint32_t m_ownershipStrength; - std::string m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_OWNERSHIPSTRENGTH_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/RequestReplyExample/CMakeLists.txt b/examples/cpp/dds/RequestReplyExample/CMakeLists.txt index 4dcb45ea8c4..a3efdf02707 100644 --- a/examples/cpp/dds/RequestReplyExample/CMakeLists.txt +++ b/examples/cpp/dds/RequestReplyExample/CMakeLists.txt @@ -36,9 +36,8 @@ endif() message(STATUS "Configuring Request-Reply example...") set(DDS_REQUEST_REPLY_EXAMPLE_COMMON_SOURCES - Calculator.cxx - Calculatorv1.cxx CalculatorPubSubTypes.cxx + CalculatorTypeObjectSupport.cxx ) set( DDS_REQUEST_REPLY_EXAMPLE_CLIENT_SOURCES CalculatorClient.cpp diff --git a/examples/cpp/dds/RequestReplyExample/Calculator.cxx b/examples/cpp/dds/RequestReplyExample/Calculator.cxx deleted file mode 100644 index 664663c6180..00000000000 --- a/examples/cpp/dds/RequestReplyExample/Calculator.cxx +++ /dev/null @@ -1,271 +0,0 @@ -// 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 Calculator.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Calculator.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -RequestType::RequestType() -{ -} - -RequestType::~RequestType() -{ -} - -RequestType::RequestType( - const RequestType& x) -{ - m_operation = x.m_operation; - m_x = x.m_x; - m_y = x.m_y; -} - -RequestType::RequestType( - RequestType&& x) noexcept -{ - m_operation = x.m_operation; - m_x = x.m_x; - m_y = x.m_y; -} - -RequestType& RequestType::operator =( - const RequestType& x) -{ - - m_operation = x.m_operation; - m_x = x.m_x; - m_y = x.m_y; - return *this; -} - -RequestType& RequestType::operator =( - RequestType&& x) noexcept -{ - - m_operation = x.m_operation; - m_x = x.m_x; - m_y = x.m_y; - return *this; -} - -bool RequestType::operator ==( - const RequestType& x) const -{ - return (m_operation == x.m_operation && - m_x == x.m_x && - m_y == x.m_y); -} - -bool RequestType::operator !=( - const RequestType& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member operation - * @param _operation New value for member operation - */ -void RequestType::operation( - OperationType _operation) -{ - m_operation = _operation; -} - -/*! - * @brief This function returns the value of member operation - * @return Value of member operation - */ -OperationType RequestType::operation() const -{ - return m_operation; -} - -/*! - * @brief This function returns a reference to member operation - * @return Reference to member operation - */ -OperationType& RequestType::operation() -{ - return m_operation; -} - - -/*! - * @brief This function sets a value in member x - * @param _x New value for member x - */ -void RequestType::x( - int32_t _x) -{ - m_x = _x; -} - -/*! - * @brief This function returns the value of member x - * @return Value of member x - */ -int32_t RequestType::x() const -{ - return m_x; -} - -/*! - * @brief This function returns a reference to member x - * @return Reference to member x - */ -int32_t& RequestType::x() -{ - return m_x; -} - - -/*! - * @brief This function sets a value in member y - * @param _y New value for member y - */ -void RequestType::y( - int32_t _y) -{ - m_y = _y; -} - -/*! - * @brief This function returns the value of member y - * @return Value of member y - */ -int32_t RequestType::y() const -{ - return m_y; -} - -/*! - * @brief This function returns a reference to member y - * @return Reference to member y - */ -int32_t& RequestType::y() -{ - return m_y; -} - - - - -ReplyType::ReplyType() -{ -} - -ReplyType::~ReplyType() -{ -} - -ReplyType::ReplyType( - const ReplyType& x) -{ - m_z = x.m_z; -} - -ReplyType::ReplyType( - ReplyType&& x) noexcept -{ - m_z = x.m_z; -} - -ReplyType& ReplyType::operator =( - const ReplyType& x) -{ - - m_z = x.m_z; - return *this; -} - -ReplyType& ReplyType::operator =( - ReplyType&& x) noexcept -{ - - m_z = x.m_z; - return *this; -} - -bool ReplyType::operator ==( - const ReplyType& x) const -{ - return (m_z == x.m_z); -} - -bool ReplyType::operator !=( - const ReplyType& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member z - * @param _z New value for member z - */ -void ReplyType::z( - int64_t _z) -{ - m_z = _z; -} - -/*! - * @brief This function returns the value of member z - * @return Value of member z - */ -int64_t ReplyType::z() const -{ - return m_z; -} - -/*! - * @brief This function returns a reference to member z - * @return Reference to member z - */ -int64_t& ReplyType::z() -{ - return m_z; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "CalculatorCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/RequestReplyExample/Calculator.h b/examples/cpp/dds/RequestReplyExample/Calculator.hpp similarity index 67% rename from examples/cpp/dds/RequestReplyExample/Calculator.h rename to examples/cpp/dds/RequestReplyExample/Calculator.hpp index 945af396175..f6404b6bfdd 100644 --- a/examples/cpp/dds/RequestReplyExample/Calculator.h +++ b/examples/cpp/dds/RequestReplyExample/Calculator.hpp @@ -13,32 +13,17 @@ // limitations under the License. /*! - * @file Calculator.h + * @file Calculator.hpp * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool fastddsgen. */ -#include -#include "Calculatorv1.h" +#ifndef _FAST_DDS_GENERATED_CALCULATOR_HPP_ +#define _FAST_DDS_GENERATED_CALCULATOR_HPP_ -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_CALCULATOR_H_ -#define _FAST_DDS_GENERATED_CALCULATOR_H_ - -#include -#include #include -#include -#include -#include - -#include -#include -#include - - +#include #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -64,28 +49,17 @@ #define CALCULATOR_DllAPI #endif // _WIN32 -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - /*! * @brief This class represents the enumeration OperationType defined by the user in the IDL file. * @ingroup Calculator */ -enum OperationType : uint32_t +enum class OperationType : uint32_t { ADDITION, SUBTRACTION, MULTIPLICATION, DIVISION }; - - /*! * @brief This class represents the structure RequestType defined by the user in the IDL file. * @ingroup Calculator @@ -97,73 +71,124 @@ class RequestType /*! * @brief Default constructor. */ - eProsima_user_DllExport RequestType(); + eProsima_user_DllExport RequestType() + { + } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~RequestType(); + eProsima_user_DllExport ~RequestType() + { + } /*! * @brief Copy constructor. * @param x Reference to the object RequestType that will be copied. */ eProsima_user_DllExport RequestType( - const RequestType& x); + const RequestType& x) + { + m_operation = x.m_operation; + + m_x = x.m_x; + + m_y = x.m_y; + + } /*! * @brief Move constructor. * @param x Reference to the object RequestType that will be copied. */ eProsima_user_DllExport RequestType( - RequestType&& x) noexcept; + RequestType&& x) noexcept + { + m_operation = x.m_operation; + m_x = x.m_x; + m_y = x.m_y; + } /*! * @brief Copy assignment. * @param x Reference to the object RequestType that will be copied. */ eProsima_user_DllExport RequestType& operator =( - const RequestType& x); + const RequestType& x) + { + + m_operation = x.m_operation; + + m_x = x.m_x; + + m_y = x.m_y; + + return *this; + } /*! * @brief Move assignment. * @param x Reference to the object RequestType that will be copied. */ eProsima_user_DllExport RequestType& operator =( - RequestType&& x) noexcept; + RequestType&& x) noexcept + { + + m_operation = x.m_operation; + m_x = x.m_x; + m_y = x.m_y; + return *this; + } /*! * @brief Comparison operator. * @param x RequestType object to compare. */ eProsima_user_DllExport bool operator ==( - const RequestType& x) const; + const RequestType& x) const + { + return (m_operation == x.m_operation && + m_x == x.m_x && + m_y == x.m_y); + } /*! * @brief Comparison operator. * @param x RequestType object to compare. */ eProsima_user_DllExport bool operator !=( - const RequestType& x) const; + const RequestType& x) const + { + return !(*this == x); + } /*! * @brief This function sets a value in member operation * @param _operation New value for member operation */ eProsima_user_DllExport void operation( - OperationType _operation); + OperationType _operation) + { + m_operation = _operation; + } /*! * @brief This function returns the value of member operation * @return Value of member operation */ - eProsima_user_DllExport OperationType operation() const; + eProsima_user_DllExport OperationType operation() const + { + return m_operation; + } /*! * @brief This function returns a reference to member operation * @return Reference to member operation */ - eProsima_user_DllExport OperationType& operation(); + eProsima_user_DllExport OperationType& operation() + { + return m_operation; + } /*! @@ -171,19 +196,28 @@ class RequestType * @param _x New value for member x */ eProsima_user_DllExport void x( - int32_t _x); + int32_t _x) + { + m_x = _x; + } /*! * @brief This function returns the value of member x * @return Value of member x */ - eProsima_user_DllExport int32_t x() const; + eProsima_user_DllExport int32_t x() const + { + return m_x; + } /*! * @brief This function returns a reference to member x * @return Reference to member x */ - eProsima_user_DllExport int32_t& x(); + eProsima_user_DllExport int32_t& x() + { + return m_x; + } /*! @@ -191,29 +225,38 @@ class RequestType * @param _y New value for member y */ eProsima_user_DllExport void y( - int32_t _y); + int32_t _y) + { + m_y = _y; + } /*! * @brief This function returns the value of member y * @return Value of member y */ - eProsima_user_DllExport int32_t y() const; + eProsima_user_DllExport int32_t y() const + { + return m_y; + } /*! * @brief This function returns a reference to member y * @return Reference to member y */ - eProsima_user_DllExport int32_t& y(); + eProsima_user_DllExport int32_t& y() + { + return m_y; + } + + private: - OperationType m_operation{::ADDITION}; + OperationType m_operation{OperationType::ADDITION}; int32_t m_x{0}; int32_t m_y{0}; }; - - /*! * @brief This class represents the structure ReplyType defined by the user in the IDL file. * @ingroup Calculator @@ -225,73 +268,112 @@ class ReplyType /*! * @brief Default constructor. */ - eProsima_user_DllExport ReplyType(); + eProsima_user_DllExport ReplyType() + { + } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~ReplyType(); + eProsima_user_DllExport ~ReplyType() + { + } /*! * @brief Copy constructor. * @param x Reference to the object ReplyType that will be copied. */ eProsima_user_DllExport ReplyType( - const ReplyType& x); + const ReplyType& x) + { + m_z = x.m_z; + + } /*! * @brief Move constructor. * @param x Reference to the object ReplyType that will be copied. */ eProsima_user_DllExport ReplyType( - ReplyType&& x) noexcept; + ReplyType&& x) noexcept + { + m_z = x.m_z; + } /*! * @brief Copy assignment. * @param x Reference to the object ReplyType that will be copied. */ eProsima_user_DllExport ReplyType& operator =( - const ReplyType& x); + const ReplyType& x) + { + + m_z = x.m_z; + + return *this; + } /*! * @brief Move assignment. * @param x Reference to the object ReplyType that will be copied. */ eProsima_user_DllExport ReplyType& operator =( - ReplyType&& x) noexcept; + ReplyType&& x) noexcept + { + + m_z = x.m_z; + return *this; + } /*! * @brief Comparison operator. * @param x ReplyType object to compare. */ eProsima_user_DllExport bool operator ==( - const ReplyType& x) const; + const ReplyType& x) const + { + return (m_z == x.m_z); + } /*! * @brief Comparison operator. * @param x ReplyType object to compare. */ eProsima_user_DllExport bool operator !=( - const ReplyType& x) const; + const ReplyType& x) const + { + return !(*this == x); + } /*! * @brief This function sets a value in member z * @param _z New value for member z */ eProsima_user_DllExport void z( - int64_t _z); + int64_t _z) + { + m_z = _z; + } /*! * @brief This function returns the value of member z * @return Value of member z */ - eProsima_user_DllExport int64_t z() const; + eProsima_user_DllExport int64_t z() const + { + return m_z; + } /*! * @brief This function returns a reference to member z * @return Reference to member z */ - eProsima_user_DllExport int64_t& z(); + eProsima_user_DllExport int64_t& z() + { + return m_z; + } + + private: @@ -299,8 +381,6 @@ class ReplyType }; -#endif // _FAST_DDS_GENERATED_CALCULATOR_H_ - +#endif // _FAST_DDS_GENERATED_CALCULATOR_HPP_ -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/RequestReplyExample/CalculatorCdrAux.hpp b/examples/cpp/dds/RequestReplyExample/CalculatorCdrAux.hpp index ca610452fdb..203f46ff5ec 100644 --- a/examples/cpp/dds/RequestReplyExample/CalculatorCdrAux.hpp +++ b/examples/cpp/dds/RequestReplyExample/CalculatorCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_CALCULATORCDRAUX_HPP_ #define _FAST_DDS_GENERATED_CALCULATORCDRAUX_HPP_ -#include "Calculator.h" +#include "Calculator.hpp" constexpr uint32_t ReplyType_max_cdr_typesize {16UL}; constexpr uint32_t ReplyType_max_key_cdr_typesize {0UL}; @@ -37,14 +37,10 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const RequestType& data); - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const ReplyType& data); diff --git a/examples/cpp/dds/RequestReplyExample/CalculatorCdrAux.ipp b/examples/cpp/dds/RequestReplyExample/CalculatorCdrAux.ipp index 4930387fbbd..011ade654b9 100644 --- a/examples/cpp/dds/RequestReplyExample/CalculatorCdrAux.ipp +++ b/examples/cpp/dds/RequestReplyExample/CalculatorCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, @@ -128,8 +126,6 @@ void serialize_key( } - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/RequestReplyExample/CalculatorPubSubTypes.cxx b/examples/cpp/dds/RequestReplyExample/CalculatorPubSubTypes.cxx index e928e28c98d..8c8a2588d31 100644 --- a/examples/cpp/dds/RequestReplyExample/CalculatorPubSubTypes.cxx +++ b/examples/cpp/dds/RequestReplyExample/CalculatorPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "CalculatorPubSubTypes.h" +#include #include -#include "CalculatorPubSubTypes.h" #include "CalculatorCdrAux.hpp" +#include "CalculatorTypeObjectSupport.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; - - RequestTypePubSubType::RequestTypePubSubType() { setName("RequestType"); @@ -219,7 +219,10 @@ bool RequestTypePubSubType::getKey( return true; } - +void RequestTypePubSubType::register_type_object_representation() const +{ + register_Calculator_type_objects(); +} ReplyTypePubSubType::ReplyTypePubSubType() { @@ -409,3 +412,11 @@ bool ReplyTypePubSubType::getKey( return true; } +void ReplyTypePubSubType::register_type_object_representation() const +{ + register_Calculator_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "CalculatorCdrAux.ipp" diff --git a/examples/cpp/dds/RequestReplyExample/CalculatorPubSubTypes.h b/examples/cpp/dds/RequestReplyExample/CalculatorPubSubTypes.h index d49b73aa252..eac5b5c2a6e 100644 --- a/examples/cpp/dds/RequestReplyExample/CalculatorPubSubTypes.h +++ b/examples/cpp/dds/RequestReplyExample/CalculatorPubSubTypes.h @@ -29,7 +29,7 @@ #include #include -#include "Calculator.h" +#include "Calculator.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type RequestType defined by the user in the IDL file. * @ingroup Calculator @@ -90,6 +88,9 @@ class RequestTypePubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { @@ -128,8 +129,6 @@ class RequestTypePubSubType : public eprosima::fastdds::dds::TopicDataType }; - - /*! * @brief This class represents the TopicDataType of the type ReplyType defined by the user in the IDL file. * @ingroup Calculator @@ -180,6 +179,9 @@ class ReplyTypePubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/RequestReplyExample/CalculatorTypeObjectSupport.cxx b/examples/cpp/dds/RequestReplyExample/CalculatorTypeObjectSupport.cxx new file mode 100644 index 00000000000..5d358352dc6 --- /dev/null +++ b/examples/cpp/dds/RequestReplyExample/CalculatorTypeObjectSupport.cxx @@ -0,0 +1,436 @@ +// 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 CalculatorTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "CalculatorTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Calculator.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_Calculator_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_RequestType_type_identifier(); + + register_ReplyType_type_identifier(); + + }); +} + +void register_RequestType_type_identifier() +{ + { + StructTypeFlag struct_flags_RequestType = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_RequestType; + TypeIdentifierPair type_ids_RequestType; + QualifiedTypeName type_name_RequestType = "RequestType"; + eprosima::fastcdr::optional type_ann_builtin_RequestType; + eprosima::fastcdr::optional ann_custom_RequestType; + CompleteTypeDetail detail_RequestType = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_RequestType, ann_custom_RequestType, type_name_RequestType.to_string()); + CompleteStructHeader header_RequestType; + header_RequestType = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_RequestType); + CompleteStructMemberSeq member_seq_RequestType; + { + return_code_RequestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "OperationType", type_ids_RequestType); + + if (return_code_RequestType != eprosima::fastdds::dds::RETCODE_OK) + { + EnumTypeFlag enum_flags_OperationType = 0; + BitBound bit_bound_OperationType = 32; + CommonEnumeratedHeader common_OperationType = TypeObjectUtils::build_common_enumerated_header(bit_bound_OperationType); + QualifiedTypeName type_name_OperationType = "OperationType"; + eprosima::fastcdr::optional type_ann_builtin_OperationType; + eprosima::fastcdr::optional ann_custom_OperationType; + CompleteTypeDetail detail_OperationType = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_OperationType, ann_custom_OperationType, type_name_OperationType.to_string()); + CompleteEnumeratedHeader header_OperationType = TypeObjectUtils::build_complete_enumerated_header(common_OperationType, detail_OperationType); + CompleteEnumeratedLiteralSeq literal_seq_OperationType; + { + EnumeratedLiteralFlag flags_ADDITION = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_ADDITION = TypeObjectUtils::build_common_enumerated_literal(0, flags_ADDITION); + eprosima::fastcdr::optional member_ann_builtin_ADDITION; + ann_custom_OperationType.reset(); + MemberName name_ADDITION = "ADDITION"; + CompleteMemberDetail detail_ADDITION = TypeObjectUtils::build_complete_member_detail(name_ADDITION, member_ann_builtin_ADDITION, ann_custom_OperationType); + CompleteEnumeratedLiteral literal_ADDITION = TypeObjectUtils::build_complete_enumerated_literal(common_ADDITION, detail_ADDITION); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_OperationType, literal_ADDITION); + } + { + EnumeratedLiteralFlag flags_SUBTRACTION = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_SUBTRACTION = TypeObjectUtils::build_common_enumerated_literal(1, flags_SUBTRACTION); + eprosima::fastcdr::optional member_ann_builtin_SUBTRACTION; + ann_custom_OperationType.reset(); + MemberName name_SUBTRACTION = "SUBTRACTION"; + CompleteMemberDetail detail_SUBTRACTION = TypeObjectUtils::build_complete_member_detail(name_SUBTRACTION, member_ann_builtin_SUBTRACTION, ann_custom_OperationType); + CompleteEnumeratedLiteral literal_SUBTRACTION = TypeObjectUtils::build_complete_enumerated_literal(common_SUBTRACTION, detail_SUBTRACTION); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_OperationType, literal_SUBTRACTION); + } + { + EnumeratedLiteralFlag flags_MULTIPLICATION = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_MULTIPLICATION = TypeObjectUtils::build_common_enumerated_literal(2, flags_MULTIPLICATION); + eprosima::fastcdr::optional member_ann_builtin_MULTIPLICATION; + ann_custom_OperationType.reset(); + MemberName name_MULTIPLICATION = "MULTIPLICATION"; + CompleteMemberDetail detail_MULTIPLICATION = TypeObjectUtils::build_complete_member_detail(name_MULTIPLICATION, member_ann_builtin_MULTIPLICATION, ann_custom_OperationType); + CompleteEnumeratedLiteral literal_MULTIPLICATION = TypeObjectUtils::build_complete_enumerated_literal(common_MULTIPLICATION, detail_MULTIPLICATION); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_OperationType, literal_MULTIPLICATION); + } + { + EnumeratedLiteralFlag flags_DIVISION = TypeObjectUtils::build_enumerated_literal_flag(false); + CommonEnumeratedLiteral common_DIVISION = TypeObjectUtils::build_common_enumerated_literal(3, flags_DIVISION); + eprosima::fastcdr::optional member_ann_builtin_DIVISION; + ann_custom_OperationType.reset(); + MemberName name_DIVISION = "DIVISION"; + CompleteMemberDetail detail_DIVISION = TypeObjectUtils::build_complete_member_detail(name_DIVISION, member_ann_builtin_DIVISION, ann_custom_OperationType); + CompleteEnumeratedLiteral literal_DIVISION = TypeObjectUtils::build_complete_enumerated_literal(common_DIVISION, detail_DIVISION); + TypeObjectUtils::add_complete_enumerated_literal(literal_seq_OperationType, literal_DIVISION); + } + CompleteEnumeratedType enumerated_type_OperationType = TypeObjectUtils::build_complete_enumerated_type(enum_flags_OperationType, header_OperationType, + literal_seq_OperationType); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_enumerated_type_object(enumerated_type_OperationType, type_name_OperationType.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "OperationType already registered in TypeObjectRegistry for a different type."); + } + return_code_RequestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "OperationType", type_ids_RequestType); + if (return_code_RequestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "OperationType: Given Enum TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_operation = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_operation; + MemberId member_id_operation = 0x00000000; + if (EK_COMPLETE == type_ids_RequestType.type_identifier1()._d() || TK_NONE == type_ids_RequestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_RequestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_RequestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_RequestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_RequestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_RequestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_RequestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_RequestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_RequestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_RequestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_RequestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_operation = TypeObjectUtils::build_common_struct_member(member_id_operation, member_flags_operation, type_ids_RequestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_RequestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_RequestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_RequestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_RequestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_RequestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_RequestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_RequestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_RequestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_RequestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_RequestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_RequestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_operation = TypeObjectUtils::build_common_struct_member(member_id_operation, member_flags_operation, type_ids_RequestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure operation member TypeIdentifier inconsistent."); + return; + } + MemberName name_operation = "operation"; + eprosima::fastcdr::optional member_ann_builtin_operation; + ann_custom_RequestType.reset(); + CompleteMemberDetail detail_operation = TypeObjectUtils::build_complete_member_detail(name_operation, member_ann_builtin_operation, ann_custom_RequestType); + CompleteStructMember member_operation = TypeObjectUtils::build_complete_struct_member(common_operation, detail_operation); + TypeObjectUtils::add_complete_struct_member(member_seq_RequestType, member_operation); + } + { + return_code_RequestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_RequestType); + + if (return_code_RequestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "x Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_x = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_x; + MemberId member_id_x = 0x00000001; + if (EK_COMPLETE == type_ids_RequestType.type_identifier1()._d() || TK_NONE == type_ids_RequestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_RequestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_RequestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_RequestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_RequestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_RequestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_RequestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_RequestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_RequestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_RequestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_RequestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_x = TypeObjectUtils::build_common_struct_member(member_id_x, member_flags_x, type_ids_RequestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_RequestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_RequestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_RequestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_RequestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_RequestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_RequestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_RequestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_RequestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_RequestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_RequestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_RequestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_x = TypeObjectUtils::build_common_struct_member(member_id_x, member_flags_x, type_ids_RequestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure x member TypeIdentifier inconsistent."); + return; + } + MemberName name_x = "x"; + eprosima::fastcdr::optional member_ann_builtin_x; + ann_custom_RequestType.reset(); + CompleteMemberDetail detail_x = TypeObjectUtils::build_complete_member_detail(name_x, member_ann_builtin_x, ann_custom_RequestType); + CompleteStructMember member_x = TypeObjectUtils::build_complete_struct_member(common_x, detail_x); + TypeObjectUtils::add_complete_struct_member(member_seq_RequestType, member_x); + } + { + return_code_RequestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_RequestType); + + if (return_code_RequestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "y Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_y = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_y; + MemberId member_id_y = 0x00000002; + if (EK_COMPLETE == type_ids_RequestType.type_identifier1()._d() || TK_NONE == type_ids_RequestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_RequestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_RequestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_RequestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_RequestType.type_identifier1()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_RequestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_RequestType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_RequestType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_RequestType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_RequestType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_RequestType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_y = TypeObjectUtils::build_common_struct_member(member_id_y, member_flags_y, type_ids_RequestType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_RequestType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_RequestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_RequestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_RequestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_RequestType.type_identifier2()._d() && + EK_COMPLETE == type_ids_RequestType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_RequestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_RequestType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_RequestType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_RequestType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_RequestType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_RequestType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_y = TypeObjectUtils::build_common_struct_member(member_id_y, member_flags_y, type_ids_RequestType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure y member TypeIdentifier inconsistent."); + return; + } + MemberName name_y = "y"; + eprosima::fastcdr::optional member_ann_builtin_y; + ann_custom_RequestType.reset(); + CompleteMemberDetail detail_y = TypeObjectUtils::build_complete_member_detail(name_y, member_ann_builtin_y, ann_custom_RequestType); + CompleteStructMember member_y = TypeObjectUtils::build_complete_struct_member(common_y, detail_y); + TypeObjectUtils::add_complete_struct_member(member_seq_RequestType, member_y); + } + CompleteStructType struct_type_RequestType = TypeObjectUtils::build_complete_struct_type(struct_flags_RequestType, header_RequestType, member_seq_RequestType); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_RequestType, type_name_RequestType.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "RequestType already registered in TypeObjectRegistry for a different type."); + } + return_code_RequestType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "RequestType", type_ids_RequestType); + if (return_code_RequestType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "RequestType: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} +void register_ReplyType_type_identifier() +{ + { + StructTypeFlag struct_flags_ReplyType = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_ReplyType; + TypeIdentifierPair type_ids_ReplyType; + QualifiedTypeName type_name_ReplyType = "ReplyType"; + eprosima::fastcdr::optional type_ann_builtin_ReplyType; + eprosima::fastcdr::optional ann_custom_ReplyType; + CompleteTypeDetail detail_ReplyType = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_ReplyType, ann_custom_ReplyType, type_name_ReplyType.to_string()); + CompleteStructHeader header_ReplyType; + header_ReplyType = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_ReplyType); + CompleteStructMemberSeq member_seq_ReplyType; + { + return_code_ReplyType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int64_t", type_ids_ReplyType); + + if (return_code_ReplyType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "z Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_z = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_z; + MemberId member_id_z = 0x00000000; + if (EK_COMPLETE == type_ids_ReplyType.type_identifier1()._d() || TK_NONE == type_ids_ReplyType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ReplyType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ReplyType.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ReplyType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ReplyType.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ReplyType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ReplyType.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ReplyType.type_identifier1()._d() && + EK_COMPLETE == type_ids_ReplyType.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ReplyType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ReplyType.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ReplyType.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ReplyType.type_identifier1()._d() && + (EK_COMPLETE == type_ids_ReplyType.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ReplyType.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_z = TypeObjectUtils::build_common_struct_member(member_id_z, member_flags_z, type_ids_ReplyType.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_ReplyType.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_ReplyType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ReplyType.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_ReplyType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ReplyType.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_ReplyType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ReplyType.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_ReplyType.type_identifier2()._d() && + EK_COMPLETE == type_ids_ReplyType.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_ReplyType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ReplyType.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ReplyType.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_ReplyType.type_identifier2()._d() && + (EK_COMPLETE == type_ids_ReplyType.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_ReplyType.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_z = TypeObjectUtils::build_common_struct_member(member_id_z, member_flags_z, type_ids_ReplyType.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure z member TypeIdentifier inconsistent."); + return; + } + MemberName name_z = "z"; + eprosima::fastcdr::optional member_ann_builtin_z; + ann_custom_ReplyType.reset(); + CompleteMemberDetail detail_z = TypeObjectUtils::build_complete_member_detail(name_z, member_ann_builtin_z, ann_custom_ReplyType); + CompleteStructMember member_z = TypeObjectUtils::build_complete_struct_member(common_z, detail_z); + TypeObjectUtils::add_complete_struct_member(member_seq_ReplyType, member_z); + } + CompleteStructType struct_type_ReplyType = TypeObjectUtils::build_complete_struct_type(struct_flags_ReplyType, header_ReplyType, member_seq_ReplyType); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_ReplyType, type_name_ReplyType.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "ReplyType already registered in TypeObjectRegistry for a different type."); + } + return_code_ReplyType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "ReplyType", type_ids_ReplyType); + if (return_code_ReplyType != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "ReplyType: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/RequestReplyExample/CalculatorTypeObjectSupport.hpp b/examples/cpp/dds/RequestReplyExample/CalculatorTypeObjectSupport.hpp new file mode 100644 index 00000000000..fa71b03f7d9 --- /dev/null +++ b/examples/cpp/dds/RequestReplyExample/CalculatorTypeObjectSupport.hpp @@ -0,0 +1,61 @@ +// 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 CalculatorTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_CALCULATOR_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_CALCULATOR_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_Calculator_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register RequestType related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_RequestType_type_identifier(); +/** + * @brief Register ReplyType related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_ReplyType_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_CALCULATOR_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/RequestReplyExample/Calculatorv1.cxx b/examples/cpp/dds/RequestReplyExample/Calculatorv1.cxx deleted file mode 100644 index 50874dc3bc9..00000000000 --- a/examples/cpp/dds/RequestReplyExample/Calculatorv1.cxx +++ /dev/null @@ -1,467 +0,0 @@ -// 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 Calculator.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Calculator.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define ReplyType_max_cdr_typesize 16ULL; -#define RequestType_max_cdr_typesize 16ULL; - - - - -RequestType::RequestType() -{ - // OperationType m_operation - m_operation = ::ADDITION; - // long m_x - m_x = 0; - // long m_y - m_y = 0; - -} - -RequestType::~RequestType() -{ -} - -RequestType::RequestType( - const RequestType& x) -{ - m_operation = x.m_operation; - - - m_x = x.m_x; - - - m_y = x.m_y; - -} - -RequestType::RequestType( - RequestType&& x) noexcept -{ - m_operation = x.m_operation; - - - m_x = x.m_x; - - - m_y = x.m_y; - -} - -RequestType& RequestType::operator =( - const RequestType& x) -{ - m_operation = x.m_operation; - - - m_x = x.m_x; - - - m_y = x.m_y; - - return *this; -} - -RequestType& RequestType::operator =( - RequestType&& x) noexcept -{ - m_operation = x.m_operation; - - - m_x = x.m_x; - - - m_y = x.m_y; - - return *this; -} - -bool RequestType::operator ==( - const RequestType& x) const -{ - return (m_operation == x.m_operation && - m_x == x.m_x && - m_y == x.m_y); -} - -bool RequestType::operator !=( - const RequestType& x) const -{ - return !(*this == x); -} - -size_t RequestType::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return RequestType_max_cdr_typesize; -} - -size_t RequestType::getCdrSerializedSize( - const RequestType& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void RequestType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << (uint32_t)m_operation; - - scdr << m_x; - - scdr << m_y; - -} - -void RequestType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_operation = (OperationType)enum_value; - } - - - - dcdr >> m_x; - - - - dcdr >> m_y; - - -} - - -bool RequestType::isKeyDefined() -{ - return false; -} - -void RequestType::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member operation - * @param _operation New value for member operation - */ -void RequestType::operation( - OperationType _operation) -{ - m_operation = _operation; -} - -/*! - * @brief This function returns the value of member operation - * @return Value of member operation - */ -OperationType RequestType::operation() const -{ - return m_operation; -} - -/*! - * @brief This function returns a reference to member operation - * @return Reference to member operation - */ -OperationType& RequestType::operation() -{ - return m_operation; -} - - -/*! - * @brief This function sets a value in member x - * @param _x New value for member x - */ -void RequestType::x( - int32_t _x) -{ - m_x = _x; -} - -/*! - * @brief This function returns the value of member x - * @return Value of member x - */ -int32_t RequestType::x() const -{ - return m_x; -} - -/*! - * @brief This function returns a reference to member x - * @return Reference to member x - */ -int32_t& RequestType::x() -{ - return m_x; -} - - -/*! - * @brief This function sets a value in member y - * @param _y New value for member y - */ -void RequestType::y( - int32_t _y) -{ - m_y = _y; -} - -/*! - * @brief This function returns the value of member y - * @return Value of member y - */ -int32_t RequestType::y() const -{ - return m_y; -} - -/*! - * @brief This function returns a reference to member y - * @return Reference to member y - */ -int32_t& RequestType::y() -{ - return m_y; -} - - - - - -ReplyType::ReplyType() -{ - // long long m_z - m_z = 0; - -} - -ReplyType::~ReplyType() -{ -} - -ReplyType::ReplyType( - const ReplyType& x) -{ - m_z = x.m_z; - -} - -ReplyType::ReplyType( - ReplyType&& x) noexcept -{ - m_z = x.m_z; - -} - -ReplyType& ReplyType::operator =( - const ReplyType& x) -{ - m_z = x.m_z; - - return *this; -} - -ReplyType& ReplyType::operator =( - ReplyType&& x) noexcept -{ - m_z = x.m_z; - - return *this; -} - -bool ReplyType::operator ==( - const ReplyType& x) const -{ - return (m_z == x.m_z); -} - -bool ReplyType::operator !=( - const ReplyType& x) const -{ - return !(*this == x); -} - -size_t ReplyType::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ReplyType_max_cdr_typesize; -} - -size_t ReplyType::getCdrSerializedSize( - const ReplyType& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - - return current_alignment - initial_alignment; -} - - -void ReplyType::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_z; - -} - -void ReplyType::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_z; - - -} - - -bool ReplyType::isKeyDefined() -{ - return false; -} - -void ReplyType::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member z - * @param _z New value for member z - */ -void ReplyType::z( - int64_t _z) -{ - m_z = _z; -} - -/*! - * @brief This function returns the value of member z - * @return Value of member z - */ -int64_t ReplyType::z() const -{ - return m_z; -} - -/*! - * @brief This function returns a reference to member z - * @return Reference to member z - */ -int64_t& ReplyType::z() -{ - return m_z; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/RequestReplyExample/Calculatorv1.h b/examples/cpp/dds/RequestReplyExample/Calculatorv1.h deleted file mode 100644 index a8422f526f8..00000000000 --- a/examples/cpp/dds/RequestReplyExample/Calculatorv1.h +++ /dev/null @@ -1,408 +0,0 @@ -// 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 Calculator.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_CALCULATOR_H_ -#define _FAST_DDS_GENERATED_CALCULATOR_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(CALCULATOR_SOURCE) -#define CALCULATOR_DllAPI __declspec( dllexport ) -#else -#define CALCULATOR_DllAPI __declspec( dllimport ) -#endif // CALCULATOR_SOURCE -#else -#define CALCULATOR_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define CALCULATOR_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -/*! - * @brief This class represents the enumeration OperationType defined by the user in the IDL file. - * @ingroup Calculator - */ -enum OperationType : uint32_t -{ - ADDITION, - SUBTRACTION, - MULTIPLICATION, - DIVISION -}; - - -/*! - * @brief This class represents the structure RequestType defined by the user in the IDL file. - * @ingroup Calculator - */ -class RequestType -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport RequestType(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~RequestType(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object RequestType that will be copied. - */ - eProsima_user_DllExport RequestType( - const RequestType& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object RequestType that will be copied. - */ - eProsima_user_DllExport RequestType( - RequestType&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object RequestType that will be copied. - */ - eProsima_user_DllExport RequestType& operator =( - const RequestType& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object RequestType that will be copied. - */ - eProsima_user_DllExport RequestType& operator =( - RequestType&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x RequestType object to compare. - */ - eProsima_user_DllExport bool operator ==( - const RequestType& x) const; - - /*! - * @brief Comparison operator. - * @param x RequestType object to compare. - */ - eProsima_user_DllExport bool operator !=( - const RequestType& x) const; - - /*! - * @brief This function sets a value in member operation - * @param _operation New value for member operation - */ - eProsima_user_DllExport void operation( - OperationType _operation); - - /*! - * @brief This function returns the value of member operation - * @return Value of member operation - */ - eProsima_user_DllExport OperationType operation() const; - - /*! - * @brief This function returns a reference to member operation - * @return Reference to member operation - */ - eProsima_user_DllExport OperationType& operation(); - - - /*! - * @brief This function sets a value in member x - * @param _x New value for member x - */ - eProsima_user_DllExport void x( - int32_t _x); - - /*! - * @brief This function returns the value of member x - * @return Value of member x - */ - eProsima_user_DllExport int32_t x() const; - - /*! - * @brief This function returns a reference to member x - * @return Reference to member x - */ - eProsima_user_DllExport int32_t& x(); - - - /*! - * @brief This function sets a value in member y - * @param _y New value for member y - */ - eProsima_user_DllExport void y( - int32_t _y); - - /*! - * @brief This function returns the value of member y - * @return Value of member y - */ - eProsima_user_DllExport int32_t y() const; - - /*! - * @brief This function returns a reference to member y - * @return Reference to member y - */ - eProsima_user_DllExport int32_t& y(); - - - /*! - * @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 RequestType& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - OperationType m_operation; - int32_t m_x; - int32_t m_y; - -}; - - - -/*! - * @brief This class represents the structure ReplyType defined by the user in the IDL file. - * @ingroup Calculator - */ -class ReplyType -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ReplyType(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ReplyType(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ReplyType that will be copied. - */ - eProsima_user_DllExport ReplyType( - const ReplyType& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ReplyType that will be copied. - */ - eProsima_user_DllExport ReplyType( - ReplyType&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ReplyType that will be copied. - */ - eProsima_user_DllExport ReplyType& operator =( - const ReplyType& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ReplyType that will be copied. - */ - eProsima_user_DllExport ReplyType& operator =( - ReplyType&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ReplyType object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ReplyType& x) const; - - /*! - * @brief Comparison operator. - * @param x ReplyType object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ReplyType& x) const; - - /*! - * @brief This function sets a value in member z - * @param _z New value for member z - */ - eProsima_user_DllExport void z( - int64_t _z); - - /*! - * @brief This function returns the value of member z - * @return Value of member z - */ - eProsima_user_DllExport int64_t z() const; - - /*! - * @brief This function returns a reference to member z - * @return Reference to member z - */ - eProsima_user_DllExport int64_t& z(); - - - /*! - * @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 ReplyType& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - int64_t m_z; - -}; - - -#endif // _FAST_DDS_GENERATED_CALCULATOR_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/SampleConfig_Controller/sample.cxx b/examples/cpp/dds/SampleConfig_Controller/sample.cxx deleted file mode 100644 index 360d4a1b2b2..00000000000 --- a/examples/cpp/dds/SampleConfig_Controller/sample.cxx +++ /dev/null @@ -1,158 +0,0 @@ -// 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 sample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "sample.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -sample::sample() -{ -} - -sample::~sample() -{ -} - -sample::sample( - const sample& x) -{ - m_index = x.m_index; - m_key_value = x.m_key_value; -} - -sample::sample( - sample&& x) noexcept -{ - m_index = x.m_index; - m_key_value = x.m_key_value; -} - -sample& sample::operator =( - const sample& x) -{ - - m_index = x.m_index; - m_key_value = x.m_key_value; - return *this; -} - -sample& sample::operator =( - sample&& x) noexcept -{ - - m_index = x.m_index; - m_key_value = x.m_key_value; - return *this; -} - -bool sample::operator ==( - const sample& x) const -{ - return (m_index == x.m_index && - m_key_value == x.m_key_value); -} - -bool sample::operator !=( - const sample& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void sample::index( - uint8_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint8_t sample::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint8_t& sample::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ -void sample::key_value( - uint8_t _key_value) -{ - m_key_value = _key_value; -} - -/*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ -uint8_t sample::key_value() const -{ - return m_key_value; -} - -/*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ -uint8_t& sample::key_value() -{ - return m_key_value; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "sampleCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/SampleConfig_Controller/sample.h b/examples/cpp/dds/SampleConfig_Controller/sample.h deleted file mode 100644 index c050c8527cc..00000000000 --- a/examples/cpp/dds/SampleConfig_Controller/sample.h +++ /dev/null @@ -1,188 +0,0 @@ -// 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 sample.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "samplev1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ -#define _FAST_DDS_GENERATED_SAMPLE_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SAMPLE_SOURCE) -#define SAMPLE_DllAPI __declspec( dllexport ) -#else -#define SAMPLE_DllAPI __declspec( dllimport ) -#endif // SAMPLE_SOURCE -#else -#define SAMPLE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define SAMPLE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure sample defined by the user in the IDL file. - * @ingroup sample - */ -class sample -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport sample(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~sample(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - const sample& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - sample&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - const sample& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - sample&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator ==( - const sample& x) const; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator !=( - const sample& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint8_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint8_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint8_t& index(); - - - /*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ - eProsima_user_DllExport void key_value( - uint8_t _key_value); - - /*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ - eProsima_user_DllExport uint8_t key_value() const; - - /*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ - eProsima_user_DllExport uint8_t& key_value(); - -private: - - uint8_t m_index{0}; - uint8_t m_key_value{0}; - -}; - -#endif // _FAST_DDS_GENERATED_SAMPLE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/SampleConfig_Controller/sample.hpp b/examples/cpp/dds/SampleConfig_Controller/sample.hpp new file mode 100644 index 00000000000..3023a792269 --- /dev/null +++ b/examples/cpp/dds/SampleConfig_Controller/sample.hpp @@ -0,0 +1,215 @@ +// 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 sample.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_SAMPLE_HPP_ +#define _FAST_DDS_GENERATED_SAMPLE_HPP_ + +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SAMPLE_SOURCE) +#define SAMPLE_DllAPI __declspec( dllexport ) +#else +#define SAMPLE_DllAPI __declspec( dllimport ) +#endif // SAMPLE_SOURCE +#else +#define SAMPLE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SAMPLE_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure sample defined by the user in the IDL file. + * @ingroup sample + */ +class sample +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport sample() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~sample() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + const sample& x) + { + m_index = x.m_index; + + m_key_value = x.m_key_value; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + sample&& x) noexcept + { + m_index = x.m_index; + m_key_value = x.m_key_value; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + const sample& x) + { + + m_index = x.m_index; + + m_key_value = x.m_key_value; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + sample&& x) noexcept + { + + m_index = x.m_index; + m_key_value = x.m_key_value; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator ==( + const sample& x) const + { + return (m_index == x.m_index && + m_key_value == x.m_key_value); + } + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator !=( + const sample& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint8_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint8_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint8_t& index() + { + return m_index; + } + + + /*! + * @brief This function sets a value in member key_value + * @param _key_value New value for member key_value + */ + eProsima_user_DllExport void key_value( + uint8_t _key_value) + { + m_key_value = _key_value; + } + + /*! + * @brief This function returns the value of member key_value + * @return Value of member key_value + */ + eProsima_user_DllExport uint8_t key_value() const + { + return m_key_value; + } + + /*! + * @brief This function returns a reference to member key_value + * @return Reference to member key_value + */ + eProsima_user_DllExport uint8_t& key_value() + { + return m_key_value; + } + + + +private: + + uint8_t m_index{0}; + uint8_t m_key_value{0}; + +}; + +#endif // _FAST_DDS_GENERATED_SAMPLE_HPP_ + + diff --git a/examples/cpp/dds/SampleConfig_Controller/sampleCdrAux.hpp b/examples/cpp/dds/SampleConfig_Controller/sampleCdrAux.hpp index 18ed5857add..b80dff31248 100644 --- a/examples/cpp/dds/SampleConfig_Controller/sampleCdrAux.hpp +++ b/examples/cpp/dds/SampleConfig_Controller/sampleCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ #define _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ -#include "sample.h" +#include "sample.hpp" constexpr uint32_t sample_max_cdr_typesize {6UL}; constexpr uint32_t sample_max_key_cdr_typesize {1UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const sample& data); diff --git a/examples/cpp/dds/SampleConfig_Controller/sampleCdrAux.ipp b/examples/cpp/dds/SampleConfig_Controller/sampleCdrAux.ipp index 11bc4709a6e..17a3d1025fc 100644 --- a/examples/cpp/dds/SampleConfig_Controller/sampleCdrAux.ipp +++ b/examples/cpp/dds/SampleConfig_Controller/sampleCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/SampleConfig_Controller/samplePubSubTypes.cxx b/examples/cpp/dds/SampleConfig_Controller/samplePubSubTypes.cxx index 9095d77083a..cae143a08ca 100644 --- a/examples/cpp/dds/SampleConfig_Controller/samplePubSubTypes.cxx +++ b/examples/cpp/dds/SampleConfig_Controller/samplePubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "samplePubSubTypes.h" +#include #include -#include "samplePubSubTypes.h" #include "sampleCdrAux.hpp" +#include "sampleTypeObjectSupport.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; - - samplePubSubType::samplePubSubType() { setName("sample"); @@ -219,3 +219,11 @@ bool samplePubSubType::getKey( return true; } +void samplePubSubType::register_type_object_representation() const +{ + register_sample_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "sampleCdrAux.ipp" diff --git a/examples/cpp/dds/SampleConfig_Controller/samplePubSubTypes.h b/examples/cpp/dds/SampleConfig_Controller/samplePubSubTypes.h index 6022f1e76b7..9e59aa58042 100644 --- a/examples/cpp/dds/SampleConfig_Controller/samplePubSubTypes.h +++ b/examples/cpp/dds/SampleConfig_Controller/samplePubSubTypes.h @@ -29,7 +29,7 @@ #include #include -#include "sample.h" +#include "sample.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type sample defined by the user in the IDL file. * @ingroup sample @@ -90,6 +88,9 @@ class samplePubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/SampleConfig_Controller/sampleTypeObjectSupport.cxx b/examples/cpp/dds/SampleConfig_Controller/sampleTypeObjectSupport.cxx new file mode 100644 index 00000000000..3719bbf77e6 --- /dev/null +++ b/examples/cpp/dds/SampleConfig_Controller/sampleTypeObjectSupport.cxx @@ -0,0 +1,224 @@ +// 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 sampleTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "sampleTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "sample.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_sample_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_sample_type_identifier(); + + }); +} + +void register_sample_type_identifier() +{ + { + StructTypeFlag struct_flags_sample = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_sample; + TypeIdentifierPair type_ids_sample; + QualifiedTypeName type_name_sample = "sample"; + eprosima::fastcdr::optional type_ann_builtin_sample; + eprosima::fastcdr::optional ann_custom_sample; + CompleteTypeDetail detail_sample = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_sample, ann_custom_sample, type_name_sample.to_string()); + CompleteStructHeader header_sample; + header_sample = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_sample); + CompleteStructMemberSeq member_seq_sample; + { + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_sample); + + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_sample.type_identifier1()._d() || TK_NONE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_sample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_sample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_sample.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_sample); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_sample, member_index); + } + { + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_sample); + + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "key_value Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_key_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_key_value; + MemberId member_id_key_value = 0x00000001; + if (EK_COMPLETE == type_ids_sample.type_identifier1()._d() || TK_NONE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_key_value = TypeObjectUtils::build_common_struct_member(member_id_key_value, member_flags_key_value, type_ids_sample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_key_value = TypeObjectUtils::build_common_struct_member(member_id_key_value, member_flags_key_value, type_ids_sample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure key_value member TypeIdentifier inconsistent."); + return; + } + MemberName name_key_value = "key_value"; + eprosima::fastcdr::optional member_ann_builtin_key_value; + ann_custom_sample.reset(); + AppliedAnnotationSeq tmp_ann_custom_key_value; + eprosima::fastcdr::optional unit_key_value; + eprosima::fastcdr::optional min_key_value; + eprosima::fastcdr::optional max_key_value; + eprosima::fastcdr::optional hash_id_key_value; + if (unit_key_value.has_value() || min_key_value.has_value() || max_key_value.has_value() || hash_id_key_value.has_value()) + { + member_ann_builtin_key_value = TypeObjectUtils::build_applied_builtin_member_annotations(unit_key_value, min_key_value, max_key_value, hash_id_key_value); + } + if (!tmp_ann_custom_key_value.empty()) + { + ann_custom_sample = tmp_ann_custom_key_value; + } + CompleteMemberDetail detail_key_value = TypeObjectUtils::build_complete_member_detail(name_key_value, member_ann_builtin_key_value, ann_custom_sample); + CompleteStructMember member_key_value = TypeObjectUtils::build_complete_struct_member(common_key_value, detail_key_value); + TypeObjectUtils::add_complete_struct_member(member_seq_sample, member_key_value); + } + CompleteStructType struct_type_sample = TypeObjectUtils::build_complete_struct_type(struct_flags_sample, header_sample, member_seq_sample); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_sample, type_name_sample.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "sample already registered in TypeObjectRegistry for a different type."); + } + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "sample", type_ids_sample); + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "sample: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/SampleConfig_Controller/sampleTypeObjectSupport.hpp b/examples/cpp/dds/SampleConfig_Controller/sampleTypeObjectSupport.hpp new file mode 100644 index 00000000000..5ad7f2e5e07 --- /dev/null +++ b/examples/cpp/dds/SampleConfig_Controller/sampleTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// 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 sampleTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_sample_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register sample related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_sample_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/SampleConfig_Controller/sampleconfig_safest.cpp b/examples/cpp/dds/SampleConfig_Controller/sampleconfig_safest.cpp index 9d3580e9a88..80fa6a39ab8 100644 --- a/examples/cpp/dds/SampleConfig_Controller/sampleconfig_safest.cpp +++ b/examples/cpp/dds/SampleConfig_Controller/sampleconfig_safest.cpp @@ -151,7 +151,7 @@ void safest() //Read the contents of both histories: std::cout << "The Reliable Subscriber holds: " << std::endl; - while (myReader->read_next_sample(&my_sample, &sample_info) == ReturnCode_t::RETCODE_OK) + while (myReader->read_next_sample(&my_sample, &sample_info) == RETCODE_OK) { std::cout << std::to_string(my_sample.index()) << " (key " << static_cast(my_sample.key_value()) << ")" << std::endl; diff --git a/examples/cpp/dds/SampleConfig_Controller/samplev1.cxx b/examples/cpp/dds/SampleConfig_Controller/samplev1.cxx deleted file mode 100644 index 3b735befaf8..00000000000 --- a/examples/cpp/dds/SampleConfig_Controller/samplev1.cxx +++ /dev/null @@ -1,280 +0,0 @@ -// 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 sample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "sample.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define sample_max_cdr_typesize 6ULL; - - - - -sample::sample() -{ - // octet m_index - m_index = 0; - // octet m_key_value - m_key_value = 0; - -} - -sample::~sample() -{ -} - -sample::sample( - const sample& x) -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - -} - -sample::sample( - sample&& x) noexcept -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - -} - -sample& sample::operator =( - const sample& x) -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - - return *this; -} - -sample& sample::operator =( - sample&& x) noexcept -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - - return *this; -} - -bool sample::operator ==( - const sample& x) const -{ - return (m_index == x.m_index && - m_key_value == x.m_key_value); -} - -bool sample::operator !=( - const sample& x) const -{ - return !(*this == x); -} - -size_t sample::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return sample_max_cdr_typesize; -} - -size_t sample::getCdrSerializedSize( - const sample& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - - -void sample::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_key_value; - -} - -void sample::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_key_value; - - -} - - -bool sample::isKeyDefined() -{ - return true; -} - -void sample::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - - - scdr << m_key_value; - -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void sample::index( - uint8_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint8_t sample::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint8_t& sample::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ -void sample::key_value( - uint8_t _key_value) -{ - m_key_value = _key_value; -} - -/*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ -uint8_t sample::key_value() const -{ - return m_key_value; -} - -/*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ -uint8_t& sample::key_value() -{ - return m_key_value; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/SampleConfig_Controller/samplev1.h b/examples/cpp/dds/SampleConfig_Controller/samplev1.h deleted file mode 100644 index 6aa21a41e80..00000000000 --- a/examples/cpp/dds/SampleConfig_Controller/samplev1.h +++ /dev/null @@ -1,237 +0,0 @@ -// 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 sample.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ -#define _FAST_DDS_GENERATED_SAMPLE_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SAMPLE_SOURCE) -#define SAMPLE_DllAPI __declspec( dllexport ) -#else -#define SAMPLE_DllAPI __declspec( dllimport ) -#endif // SAMPLE_SOURCE -#else -#define SAMPLE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define SAMPLE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure sample defined by the user in the IDL file. - * @ingroup sample - */ -class sample -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport sample(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~sample(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - const sample& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - sample&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - const sample& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - sample&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator ==( - const sample& x) const; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator !=( - const sample& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint8_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint8_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint8_t& index(); - - - /*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ - eProsima_user_DllExport void key_value( - uint8_t _key_value); - - /*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ - eProsima_user_DllExport uint8_t key_value() const; - - /*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ - eProsima_user_DllExport uint8_t& key_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 sample& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint8_t m_index; - uint8_t m_key_value; - -}; - - -#endif // _FAST_DDS_GENERATED_SAMPLE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/SampleConfig_Events/sample.cxx b/examples/cpp/dds/SampleConfig_Events/sample.cxx deleted file mode 100644 index 360d4a1b2b2..00000000000 --- a/examples/cpp/dds/SampleConfig_Events/sample.cxx +++ /dev/null @@ -1,158 +0,0 @@ -// 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 sample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "sample.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -sample::sample() -{ -} - -sample::~sample() -{ -} - -sample::sample( - const sample& x) -{ - m_index = x.m_index; - m_key_value = x.m_key_value; -} - -sample::sample( - sample&& x) noexcept -{ - m_index = x.m_index; - m_key_value = x.m_key_value; -} - -sample& sample::operator =( - const sample& x) -{ - - m_index = x.m_index; - m_key_value = x.m_key_value; - return *this; -} - -sample& sample::operator =( - sample&& x) noexcept -{ - - m_index = x.m_index; - m_key_value = x.m_key_value; - return *this; -} - -bool sample::operator ==( - const sample& x) const -{ - return (m_index == x.m_index && - m_key_value == x.m_key_value); -} - -bool sample::operator !=( - const sample& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void sample::index( - uint8_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint8_t sample::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint8_t& sample::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ -void sample::key_value( - uint8_t _key_value) -{ - m_key_value = _key_value; -} - -/*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ -uint8_t sample::key_value() const -{ - return m_key_value; -} - -/*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ -uint8_t& sample::key_value() -{ - return m_key_value; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "sampleCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/SampleConfig_Events/sample.h b/examples/cpp/dds/SampleConfig_Events/sample.h deleted file mode 100644 index c050c8527cc..00000000000 --- a/examples/cpp/dds/SampleConfig_Events/sample.h +++ /dev/null @@ -1,188 +0,0 @@ -// 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 sample.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "samplev1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ -#define _FAST_DDS_GENERATED_SAMPLE_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SAMPLE_SOURCE) -#define SAMPLE_DllAPI __declspec( dllexport ) -#else -#define SAMPLE_DllAPI __declspec( dllimport ) -#endif // SAMPLE_SOURCE -#else -#define SAMPLE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define SAMPLE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure sample defined by the user in the IDL file. - * @ingroup sample - */ -class sample -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport sample(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~sample(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - const sample& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - sample&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - const sample& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - sample&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator ==( - const sample& x) const; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator !=( - const sample& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint8_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint8_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint8_t& index(); - - - /*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ - eProsima_user_DllExport void key_value( - uint8_t _key_value); - - /*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ - eProsima_user_DllExport uint8_t key_value() const; - - /*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ - eProsima_user_DllExport uint8_t& key_value(); - -private: - - uint8_t m_index{0}; - uint8_t m_key_value{0}; - -}; - -#endif // _FAST_DDS_GENERATED_SAMPLE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/SampleConfig_Events/sample.hpp b/examples/cpp/dds/SampleConfig_Events/sample.hpp new file mode 100644 index 00000000000..3023a792269 --- /dev/null +++ b/examples/cpp/dds/SampleConfig_Events/sample.hpp @@ -0,0 +1,215 @@ +// 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 sample.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_SAMPLE_HPP_ +#define _FAST_DDS_GENERATED_SAMPLE_HPP_ + +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SAMPLE_SOURCE) +#define SAMPLE_DllAPI __declspec( dllexport ) +#else +#define SAMPLE_DllAPI __declspec( dllimport ) +#endif // SAMPLE_SOURCE +#else +#define SAMPLE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SAMPLE_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure sample defined by the user in the IDL file. + * @ingroup sample + */ +class sample +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport sample() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~sample() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + const sample& x) + { + m_index = x.m_index; + + m_key_value = x.m_key_value; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + sample&& x) noexcept + { + m_index = x.m_index; + m_key_value = x.m_key_value; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + const sample& x) + { + + m_index = x.m_index; + + m_key_value = x.m_key_value; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + sample&& x) noexcept + { + + m_index = x.m_index; + m_key_value = x.m_key_value; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator ==( + const sample& x) const + { + return (m_index == x.m_index && + m_key_value == x.m_key_value); + } + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator !=( + const sample& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint8_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint8_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint8_t& index() + { + return m_index; + } + + + /*! + * @brief This function sets a value in member key_value + * @param _key_value New value for member key_value + */ + eProsima_user_DllExport void key_value( + uint8_t _key_value) + { + m_key_value = _key_value; + } + + /*! + * @brief This function returns the value of member key_value + * @return Value of member key_value + */ + eProsima_user_DllExport uint8_t key_value() const + { + return m_key_value; + } + + /*! + * @brief This function returns a reference to member key_value + * @return Reference to member key_value + */ + eProsima_user_DllExport uint8_t& key_value() + { + return m_key_value; + } + + + +private: + + uint8_t m_index{0}; + uint8_t m_key_value{0}; + +}; + +#endif // _FAST_DDS_GENERATED_SAMPLE_HPP_ + + diff --git a/examples/cpp/dds/SampleConfig_Events/sampleCdrAux.hpp b/examples/cpp/dds/SampleConfig_Events/sampleCdrAux.hpp index 18ed5857add..b80dff31248 100644 --- a/examples/cpp/dds/SampleConfig_Events/sampleCdrAux.hpp +++ b/examples/cpp/dds/SampleConfig_Events/sampleCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ #define _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ -#include "sample.h" +#include "sample.hpp" constexpr uint32_t sample_max_cdr_typesize {6UL}; constexpr uint32_t sample_max_key_cdr_typesize {1UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const sample& data); diff --git a/examples/cpp/dds/SampleConfig_Events/sampleCdrAux.ipp b/examples/cpp/dds/SampleConfig_Events/sampleCdrAux.ipp index 11bc4709a6e..17a3d1025fc 100644 --- a/examples/cpp/dds/SampleConfig_Events/sampleCdrAux.ipp +++ b/examples/cpp/dds/SampleConfig_Events/sampleCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/SampleConfig_Events/samplePubSubTypes.cxx b/examples/cpp/dds/SampleConfig_Events/samplePubSubTypes.cxx index 9095d77083a..cae143a08ca 100644 --- a/examples/cpp/dds/SampleConfig_Events/samplePubSubTypes.cxx +++ b/examples/cpp/dds/SampleConfig_Events/samplePubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "samplePubSubTypes.h" +#include #include -#include "samplePubSubTypes.h" #include "sampleCdrAux.hpp" +#include "sampleTypeObjectSupport.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; - - samplePubSubType::samplePubSubType() { setName("sample"); @@ -219,3 +219,11 @@ bool samplePubSubType::getKey( return true; } +void samplePubSubType::register_type_object_representation() const +{ + register_sample_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "sampleCdrAux.ipp" diff --git a/examples/cpp/dds/SampleConfig_Events/samplePubSubTypes.h b/examples/cpp/dds/SampleConfig_Events/samplePubSubTypes.h index 6022f1e76b7..9e59aa58042 100644 --- a/examples/cpp/dds/SampleConfig_Events/samplePubSubTypes.h +++ b/examples/cpp/dds/SampleConfig_Events/samplePubSubTypes.h @@ -29,7 +29,7 @@ #include #include -#include "sample.h" +#include "sample.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type sample defined by the user in the IDL file. * @ingroup sample @@ -90,6 +88,9 @@ class samplePubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/SampleConfig_Events/sampleTypeObjectSupport.cxx b/examples/cpp/dds/SampleConfig_Events/sampleTypeObjectSupport.cxx new file mode 100644 index 00000000000..3719bbf77e6 --- /dev/null +++ b/examples/cpp/dds/SampleConfig_Events/sampleTypeObjectSupport.cxx @@ -0,0 +1,224 @@ +// 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 sampleTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "sampleTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "sample.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_sample_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_sample_type_identifier(); + + }); +} + +void register_sample_type_identifier() +{ + { + StructTypeFlag struct_flags_sample = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_sample; + TypeIdentifierPair type_ids_sample; + QualifiedTypeName type_name_sample = "sample"; + eprosima::fastcdr::optional type_ann_builtin_sample; + eprosima::fastcdr::optional ann_custom_sample; + CompleteTypeDetail detail_sample = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_sample, ann_custom_sample, type_name_sample.to_string()); + CompleteStructHeader header_sample; + header_sample = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_sample); + CompleteStructMemberSeq member_seq_sample; + { + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_sample); + + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_sample.type_identifier1()._d() || TK_NONE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_sample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_sample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_sample.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_sample); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_sample, member_index); + } + { + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_sample); + + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "key_value Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_key_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_key_value; + MemberId member_id_key_value = 0x00000001; + if (EK_COMPLETE == type_ids_sample.type_identifier1()._d() || TK_NONE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_key_value = TypeObjectUtils::build_common_struct_member(member_id_key_value, member_flags_key_value, type_ids_sample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_key_value = TypeObjectUtils::build_common_struct_member(member_id_key_value, member_flags_key_value, type_ids_sample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure key_value member TypeIdentifier inconsistent."); + return; + } + MemberName name_key_value = "key_value"; + eprosima::fastcdr::optional member_ann_builtin_key_value; + ann_custom_sample.reset(); + AppliedAnnotationSeq tmp_ann_custom_key_value; + eprosima::fastcdr::optional unit_key_value; + eprosima::fastcdr::optional min_key_value; + eprosima::fastcdr::optional max_key_value; + eprosima::fastcdr::optional hash_id_key_value; + if (unit_key_value.has_value() || min_key_value.has_value() || max_key_value.has_value() || hash_id_key_value.has_value()) + { + member_ann_builtin_key_value = TypeObjectUtils::build_applied_builtin_member_annotations(unit_key_value, min_key_value, max_key_value, hash_id_key_value); + } + if (!tmp_ann_custom_key_value.empty()) + { + ann_custom_sample = tmp_ann_custom_key_value; + } + CompleteMemberDetail detail_key_value = TypeObjectUtils::build_complete_member_detail(name_key_value, member_ann_builtin_key_value, ann_custom_sample); + CompleteStructMember member_key_value = TypeObjectUtils::build_complete_struct_member(common_key_value, detail_key_value); + TypeObjectUtils::add_complete_struct_member(member_seq_sample, member_key_value); + } + CompleteStructType struct_type_sample = TypeObjectUtils::build_complete_struct_type(struct_flags_sample, header_sample, member_seq_sample); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_sample, type_name_sample.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "sample already registered in TypeObjectRegistry for a different type."); + } + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "sample", type_ids_sample); + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "sample: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/SampleConfig_Events/sampleTypeObjectSupport.hpp b/examples/cpp/dds/SampleConfig_Events/sampleTypeObjectSupport.hpp new file mode 100644 index 00000000000..5ad7f2e5e07 --- /dev/null +++ b/examples/cpp/dds/SampleConfig_Events/sampleTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// 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 sampleTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_sample_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register sample related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_sample_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/SampleConfig_Events/sampleconfig_triggers.cpp b/examples/cpp/dds/SampleConfig_Events/sampleconfig_triggers.cpp index 97641f71866..72059ffa468 100644 --- a/examples/cpp/dds/SampleConfig_Events/sampleconfig_triggers.cpp +++ b/examples/cpp/dds/SampleConfig_Events/sampleconfig_triggers.cpp @@ -156,7 +156,7 @@ void triggers() //Read the contents of both histories: std::cout << "The Subscriber holds: " << std::endl; - while (myReader->take_next_sample(&my_sample, &sample_info) == ReturnCode_t::RETCODE_OK) + while (myReader->take_next_sample(&my_sample, &sample_info) == RETCODE_OK) { std::cout << std::to_string(my_sample.index()) << " "; } diff --git a/examples/cpp/dds/SampleConfig_Events/samplev1.cxx b/examples/cpp/dds/SampleConfig_Events/samplev1.cxx deleted file mode 100644 index 3b735befaf8..00000000000 --- a/examples/cpp/dds/SampleConfig_Events/samplev1.cxx +++ /dev/null @@ -1,280 +0,0 @@ -// 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 sample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "sample.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define sample_max_cdr_typesize 6ULL; - - - - -sample::sample() -{ - // octet m_index - m_index = 0; - // octet m_key_value - m_key_value = 0; - -} - -sample::~sample() -{ -} - -sample::sample( - const sample& x) -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - -} - -sample::sample( - sample&& x) noexcept -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - -} - -sample& sample::operator =( - const sample& x) -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - - return *this; -} - -sample& sample::operator =( - sample&& x) noexcept -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - - return *this; -} - -bool sample::operator ==( - const sample& x) const -{ - return (m_index == x.m_index && - m_key_value == x.m_key_value); -} - -bool sample::operator !=( - const sample& x) const -{ - return !(*this == x); -} - -size_t sample::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return sample_max_cdr_typesize; -} - -size_t sample::getCdrSerializedSize( - const sample& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - - -void sample::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_key_value; - -} - -void sample::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_key_value; - - -} - - -bool sample::isKeyDefined() -{ - return true; -} - -void sample::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - - - scdr << m_key_value; - -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void sample::index( - uint8_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint8_t sample::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint8_t& sample::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ -void sample::key_value( - uint8_t _key_value) -{ - m_key_value = _key_value; -} - -/*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ -uint8_t sample::key_value() const -{ - return m_key_value; -} - -/*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ -uint8_t& sample::key_value() -{ - return m_key_value; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/SampleConfig_Events/samplev1.h b/examples/cpp/dds/SampleConfig_Events/samplev1.h deleted file mode 100644 index 6aa21a41e80..00000000000 --- a/examples/cpp/dds/SampleConfig_Events/samplev1.h +++ /dev/null @@ -1,237 +0,0 @@ -// 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 sample.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ -#define _FAST_DDS_GENERATED_SAMPLE_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SAMPLE_SOURCE) -#define SAMPLE_DllAPI __declspec( dllexport ) -#else -#define SAMPLE_DllAPI __declspec( dllimport ) -#endif // SAMPLE_SOURCE -#else -#define SAMPLE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define SAMPLE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure sample defined by the user in the IDL file. - * @ingroup sample - */ -class sample -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport sample(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~sample(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - const sample& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - sample&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - const sample& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - sample&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator ==( - const sample& x) const; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator !=( - const sample& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint8_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint8_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint8_t& index(); - - - /*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ - eProsima_user_DllExport void key_value( - uint8_t _key_value); - - /*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ - eProsima_user_DllExport uint8_t key_value() const; - - /*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ - eProsima_user_DllExport uint8_t& key_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 sample& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint8_t m_index; - uint8_t m_key_value; - -}; - - -#endif // _FAST_DDS_GENERATED_SAMPLE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/SampleConfig_Multimedia/sample.cxx b/examples/cpp/dds/SampleConfig_Multimedia/sample.cxx deleted file mode 100644 index 360d4a1b2b2..00000000000 --- a/examples/cpp/dds/SampleConfig_Multimedia/sample.cxx +++ /dev/null @@ -1,158 +0,0 @@ -// 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 sample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "sample.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -sample::sample() -{ -} - -sample::~sample() -{ -} - -sample::sample( - const sample& x) -{ - m_index = x.m_index; - m_key_value = x.m_key_value; -} - -sample::sample( - sample&& x) noexcept -{ - m_index = x.m_index; - m_key_value = x.m_key_value; -} - -sample& sample::operator =( - const sample& x) -{ - - m_index = x.m_index; - m_key_value = x.m_key_value; - return *this; -} - -sample& sample::operator =( - sample&& x) noexcept -{ - - m_index = x.m_index; - m_key_value = x.m_key_value; - return *this; -} - -bool sample::operator ==( - const sample& x) const -{ - return (m_index == x.m_index && - m_key_value == x.m_key_value); -} - -bool sample::operator !=( - const sample& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void sample::index( - uint8_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint8_t sample::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint8_t& sample::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ -void sample::key_value( - uint8_t _key_value) -{ - m_key_value = _key_value; -} - -/*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ -uint8_t sample::key_value() const -{ - return m_key_value; -} - -/*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ -uint8_t& sample::key_value() -{ - return m_key_value; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "sampleCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/SampleConfig_Multimedia/sample.h b/examples/cpp/dds/SampleConfig_Multimedia/sample.h deleted file mode 100644 index c050c8527cc..00000000000 --- a/examples/cpp/dds/SampleConfig_Multimedia/sample.h +++ /dev/null @@ -1,188 +0,0 @@ -// 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 sample.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "samplev1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ -#define _FAST_DDS_GENERATED_SAMPLE_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SAMPLE_SOURCE) -#define SAMPLE_DllAPI __declspec( dllexport ) -#else -#define SAMPLE_DllAPI __declspec( dllimport ) -#endif // SAMPLE_SOURCE -#else -#define SAMPLE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define SAMPLE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure sample defined by the user in the IDL file. - * @ingroup sample - */ -class sample -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport sample(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~sample(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - const sample& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - sample&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - const sample& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - sample&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator ==( - const sample& x) const; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator !=( - const sample& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint8_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint8_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint8_t& index(); - - - /*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ - eProsima_user_DllExport void key_value( - uint8_t _key_value); - - /*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ - eProsima_user_DllExport uint8_t key_value() const; - - /*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ - eProsima_user_DllExport uint8_t& key_value(); - -private: - - uint8_t m_index{0}; - uint8_t m_key_value{0}; - -}; - -#endif // _FAST_DDS_GENERATED_SAMPLE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/SampleConfig_Multimedia/sample.hpp b/examples/cpp/dds/SampleConfig_Multimedia/sample.hpp new file mode 100644 index 00000000000..3023a792269 --- /dev/null +++ b/examples/cpp/dds/SampleConfig_Multimedia/sample.hpp @@ -0,0 +1,215 @@ +// 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 sample.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_SAMPLE_HPP_ +#define _FAST_DDS_GENERATED_SAMPLE_HPP_ + +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(SAMPLE_SOURCE) +#define SAMPLE_DllAPI __declspec( dllexport ) +#else +#define SAMPLE_DllAPI __declspec( dllimport ) +#endif // SAMPLE_SOURCE +#else +#define SAMPLE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define SAMPLE_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure sample defined by the user in the IDL file. + * @ingroup sample + */ +class sample +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport sample() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~sample() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + const sample& x) + { + m_index = x.m_index; + + m_key_value = x.m_key_value; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample( + sample&& x) noexcept + { + m_index = x.m_index; + m_key_value = x.m_key_value; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + const sample& x) + { + + m_index = x.m_index; + + m_key_value = x.m_key_value; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object sample that will be copied. + */ + eProsima_user_DllExport sample& operator =( + sample&& x) noexcept + { + + m_index = x.m_index; + m_key_value = x.m_key_value; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator ==( + const sample& x) const + { + return (m_index == x.m_index && + m_key_value == x.m_key_value); + } + + /*! + * @brief Comparison operator. + * @param x sample object to compare. + */ + eProsima_user_DllExport bool operator !=( + const sample& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint8_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint8_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint8_t& index() + { + return m_index; + } + + + /*! + * @brief This function sets a value in member key_value + * @param _key_value New value for member key_value + */ + eProsima_user_DllExport void key_value( + uint8_t _key_value) + { + m_key_value = _key_value; + } + + /*! + * @brief This function returns the value of member key_value + * @return Value of member key_value + */ + eProsima_user_DllExport uint8_t key_value() const + { + return m_key_value; + } + + /*! + * @brief This function returns a reference to member key_value + * @return Reference to member key_value + */ + eProsima_user_DllExport uint8_t& key_value() + { + return m_key_value; + } + + + +private: + + uint8_t m_index{0}; + uint8_t m_key_value{0}; + +}; + +#endif // _FAST_DDS_GENERATED_SAMPLE_HPP_ + + diff --git a/examples/cpp/dds/SampleConfig_Multimedia/sampleCdrAux.hpp b/examples/cpp/dds/SampleConfig_Multimedia/sampleCdrAux.hpp index 18ed5857add..b80dff31248 100644 --- a/examples/cpp/dds/SampleConfig_Multimedia/sampleCdrAux.hpp +++ b/examples/cpp/dds/SampleConfig_Multimedia/sampleCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ #define _FAST_DDS_GENERATED_SAMPLECDRAUX_HPP_ -#include "sample.h" +#include "sample.hpp" constexpr uint32_t sample_max_cdr_typesize {6UL}; constexpr uint32_t sample_max_key_cdr_typesize {1UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const sample& data); diff --git a/examples/cpp/dds/SampleConfig_Multimedia/sampleCdrAux.ipp b/examples/cpp/dds/SampleConfig_Multimedia/sampleCdrAux.ipp index 11bc4709a6e..17a3d1025fc 100644 --- a/examples/cpp/dds/SampleConfig_Multimedia/sampleCdrAux.ipp +++ b/examples/cpp/dds/SampleConfig_Multimedia/sampleCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/SampleConfig_Multimedia/samplePubSubTypes.cxx b/examples/cpp/dds/SampleConfig_Multimedia/samplePubSubTypes.cxx index 9095d77083a..cae143a08ca 100644 --- a/examples/cpp/dds/SampleConfig_Multimedia/samplePubSubTypes.cxx +++ b/examples/cpp/dds/SampleConfig_Multimedia/samplePubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "samplePubSubTypes.h" +#include #include -#include "samplePubSubTypes.h" #include "sampleCdrAux.hpp" +#include "sampleTypeObjectSupport.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; - - samplePubSubType::samplePubSubType() { setName("sample"); @@ -219,3 +219,11 @@ bool samplePubSubType::getKey( return true; } +void samplePubSubType::register_type_object_representation() const +{ + register_sample_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "sampleCdrAux.ipp" diff --git a/examples/cpp/dds/SampleConfig_Multimedia/samplePubSubTypes.h b/examples/cpp/dds/SampleConfig_Multimedia/samplePubSubTypes.h index 6022f1e76b7..9e59aa58042 100644 --- a/examples/cpp/dds/SampleConfig_Multimedia/samplePubSubTypes.h +++ b/examples/cpp/dds/SampleConfig_Multimedia/samplePubSubTypes.h @@ -29,7 +29,7 @@ #include #include -#include "sample.h" +#include "sample.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type sample defined by the user in the IDL file. * @ingroup sample @@ -90,6 +88,9 @@ class samplePubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/SampleConfig_Multimedia/sampleTypeObjectSupport.cxx b/examples/cpp/dds/SampleConfig_Multimedia/sampleTypeObjectSupport.cxx new file mode 100644 index 00000000000..3719bbf77e6 --- /dev/null +++ b/examples/cpp/dds/SampleConfig_Multimedia/sampleTypeObjectSupport.cxx @@ -0,0 +1,224 @@ +// 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 sampleTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "sampleTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "sample.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_sample_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_sample_type_identifier(); + + }); +} + +void register_sample_type_identifier() +{ + { + StructTypeFlag struct_flags_sample = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_sample; + TypeIdentifierPair type_ids_sample; + QualifiedTypeName type_name_sample = "sample"; + eprosima::fastcdr::optional type_ann_builtin_sample; + eprosima::fastcdr::optional ann_custom_sample; + CompleteTypeDetail detail_sample = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_sample, ann_custom_sample, type_name_sample.to_string()); + CompleteStructHeader header_sample; + header_sample = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_sample); + CompleteStructMemberSeq member_seq_sample; + { + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_sample); + + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_sample.type_identifier1()._d() || TK_NONE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_sample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_sample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_sample.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_sample); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_sample, member_index); + } + { + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_byte", type_ids_sample); + + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "key_value Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_key_value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, true, false); + CommonStructMember common_key_value; + MemberId member_id_key_value = 0x00000001; + if (EK_COMPLETE == type_ids_sample.type_identifier1()._d() || TK_NONE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier1()._d() && + EK_COMPLETE == type_ids_sample.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier1()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_key_value = TypeObjectUtils::build_common_struct_member(member_id_key_value, member_flags_key_value, type_ids_sample.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_sample.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_sample.type_identifier2()._d() && + EK_COMPLETE == type_ids_sample.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_sample.type_identifier2()._d() && + (EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_sample.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_key_value = TypeObjectUtils::build_common_struct_member(member_id_key_value, member_flags_key_value, type_ids_sample.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure key_value member TypeIdentifier inconsistent."); + return; + } + MemberName name_key_value = "key_value"; + eprosima::fastcdr::optional member_ann_builtin_key_value; + ann_custom_sample.reset(); + AppliedAnnotationSeq tmp_ann_custom_key_value; + eprosima::fastcdr::optional unit_key_value; + eprosima::fastcdr::optional min_key_value; + eprosima::fastcdr::optional max_key_value; + eprosima::fastcdr::optional hash_id_key_value; + if (unit_key_value.has_value() || min_key_value.has_value() || max_key_value.has_value() || hash_id_key_value.has_value()) + { + member_ann_builtin_key_value = TypeObjectUtils::build_applied_builtin_member_annotations(unit_key_value, min_key_value, max_key_value, hash_id_key_value); + } + if (!tmp_ann_custom_key_value.empty()) + { + ann_custom_sample = tmp_ann_custom_key_value; + } + CompleteMemberDetail detail_key_value = TypeObjectUtils::build_complete_member_detail(name_key_value, member_ann_builtin_key_value, ann_custom_sample); + CompleteStructMember member_key_value = TypeObjectUtils::build_complete_struct_member(common_key_value, detail_key_value); + TypeObjectUtils::add_complete_struct_member(member_seq_sample, member_key_value); + } + CompleteStructType struct_type_sample = TypeObjectUtils::build_complete_struct_type(struct_flags_sample, header_sample, member_seq_sample); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_sample, type_name_sample.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "sample already registered in TypeObjectRegistry for a different type."); + } + return_code_sample = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "sample", type_ids_sample); + if (return_code_sample != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "sample: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/SampleConfig_Multimedia/sampleTypeObjectSupport.hpp b/examples/cpp/dds/SampleConfig_Multimedia/sampleTypeObjectSupport.hpp new file mode 100644 index 00000000000..5ad7f2e5e07 --- /dev/null +++ b/examples/cpp/dds/SampleConfig_Multimedia/sampleTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// 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 sampleTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_sample_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register sample related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_sample_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_SAMPLE_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/SampleConfig_Multimedia/sampleconfig_fastest.cpp b/examples/cpp/dds/SampleConfig_Multimedia/sampleconfig_fastest.cpp index 65e979b8bb7..f503f0daa63 100644 --- a/examples/cpp/dds/SampleConfig_Multimedia/sampleconfig_fastest.cpp +++ b/examples/cpp/dds/SampleConfig_Multimedia/sampleconfig_fastest.cpp @@ -149,7 +149,7 @@ void fastest() //Read the contents of both histories: std::cout << "The Reliable Subscriber (with a history depth of 5) holds: " << std::endl; - while (myReader->read_next_sample(&my_sample, &sample_info) == ReturnCode_t::RETCODE_OK) + while (myReader->read_next_sample(&my_sample, &sample_info) == RETCODE_OK) { std::cout << std::to_string(my_sample.index()) << " "; } diff --git a/examples/cpp/dds/SampleConfig_Multimedia/samplev1.cxx b/examples/cpp/dds/SampleConfig_Multimedia/samplev1.cxx deleted file mode 100644 index 3b735befaf8..00000000000 --- a/examples/cpp/dds/SampleConfig_Multimedia/samplev1.cxx +++ /dev/null @@ -1,280 +0,0 @@ -// 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 sample.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "sample.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define sample_max_cdr_typesize 6ULL; - - - - -sample::sample() -{ - // octet m_index - m_index = 0; - // octet m_key_value - m_key_value = 0; - -} - -sample::~sample() -{ -} - -sample::sample( - const sample& x) -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - -} - -sample::sample( - sample&& x) noexcept -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - -} - -sample& sample::operator =( - const sample& x) -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - - return *this; -} - -sample& sample::operator =( - sample&& x) noexcept -{ - m_index = x.m_index; - - - m_key_value = x.m_key_value; - - return *this; -} - -bool sample::operator ==( - const sample& x) const -{ - return (m_index == x.m_index && - m_key_value == x.m_key_value); -} - -bool sample::operator !=( - const sample& x) const -{ - return !(*this == x); -} - -size_t sample::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return sample_max_cdr_typesize; -} - -size_t sample::getCdrSerializedSize( - const sample& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - return current_alignment - initial_alignment; -} - - -void sample::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_key_value; - -} - -void sample::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_key_value; - - -} - - -bool sample::isKeyDefined() -{ - return true; -} - -void sample::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; - - - scdr << m_key_value; - -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void sample::index( - uint8_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint8_t sample::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint8_t& sample::index() -{ - return m_index; -} - - -/*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ -void sample::key_value( - uint8_t _key_value) -{ - m_key_value = _key_value; -} - -/*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ -uint8_t sample::key_value() const -{ - return m_key_value; -} - -/*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ -uint8_t& sample::key_value() -{ - return m_key_value; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/SampleConfig_Multimedia/samplev1.h b/examples/cpp/dds/SampleConfig_Multimedia/samplev1.h deleted file mode 100644 index 6aa21a41e80..00000000000 --- a/examples/cpp/dds/SampleConfig_Multimedia/samplev1.h +++ /dev/null @@ -1,237 +0,0 @@ -// 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 sample.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_SAMPLE_H_ -#define _FAST_DDS_GENERATED_SAMPLE_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(SAMPLE_SOURCE) -#define SAMPLE_DllAPI __declspec( dllexport ) -#else -#define SAMPLE_DllAPI __declspec( dllimport ) -#endif // SAMPLE_SOURCE -#else -#define SAMPLE_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define SAMPLE_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure sample defined by the user in the IDL file. - * @ingroup sample - */ -class sample -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport sample(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~sample(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - const sample& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample( - sample&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - const sample& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object sample that will be copied. - */ - eProsima_user_DllExport sample& operator =( - sample&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator ==( - const sample& x) const; - - /*! - * @brief Comparison operator. - * @param x sample object to compare. - */ - eProsima_user_DllExport bool operator !=( - const sample& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint8_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint8_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - eProsima_user_DllExport uint8_t& index(); - - - /*! - * @brief This function sets a value in member key_value - * @param _key_value New value for member key_value - */ - eProsima_user_DllExport void key_value( - uint8_t _key_value); - - /*! - * @brief This function returns the value of member key_value - * @return Value of member key_value - */ - eProsima_user_DllExport uint8_t key_value() const; - - /*! - * @brief This function returns a reference to member key_value - * @return Reference to member key_value - */ - eProsima_user_DllExport uint8_t& key_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 sample& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint8_t m_index; - uint8_t m_key_value; - -}; - - -#endif // _FAST_DDS_GENERATED_SAMPLE_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.cxx b/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.cxx deleted file mode 100644 index 4b415d67769..00000000000 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// 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 HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -HelloWorld::HelloWorld() -{ -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -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 - */ -void HelloWorld::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& HelloWorld::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "HelloWorldCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.h b/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.h deleted file mode 100644 index 5cd0ddba511..00000000000 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.h +++ /dev/null @@ -1,195 +0,0 @@ -// 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 HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "HelloWorldv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -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 - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - 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 - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - -private: - - uint32_t m_index{0}; - std::string m_message; - -}; - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.hpp b/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.hpp new file mode 100644 index 00000000000..971fea8d920 --- /dev/null +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorld.hpp @@ -0,0 +1,227 @@ +// 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 HelloWorld.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_HPP_ + +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HELLOWORLD_SOURCE) +#define HELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define HELLOWORLD_DllAPI __declspec( dllimport ) +#endif // HELLOWORLD_SOURCE +#else +#define HELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HELLOWORLD_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure HelloWorld defined by the user in the IDL file. + * @ingroup HelloWorld + */ +class HelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HelloWorld() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HelloWorld() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + const HelloWorld& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + HelloWorld&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + const HelloWorld& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + HelloWorld&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HelloWorld& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HelloWorld& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message) + { + m_message = _message; + } + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message) + { + m_message = std::move(_message); + } + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const + { + return m_message; + } + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message() + { + return m_message; + } + + + +private: + + uint32_t m_index{0}; + std::string m_message; + +}; + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_HPP_ + + diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldCdrAux.hpp b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldCdrAux.hpp index 9f346d306be..6feb8a9da15 100644 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldCdrAux.hpp +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ #define _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ -#include "HelloWorld.h" +#include "HelloWorld.hpp" constexpr uint32_t HelloWorld_max_cdr_typesize {268UL}; constexpr uint32_t HelloWorld_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloWorld& data); diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldCdrAux.ipp b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldCdrAux.ipp index 42e91f3cc38..97df3fe9d9e 100644 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldCdrAux.ipp +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPubSubTypes.cxx b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPubSubTypes.cxx index 85cb477896e..db018e69782 100644 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "HelloWorldPubSubTypes.h" +#include #include -#include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" +#include "HelloWorldTypeObjectSupport.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"); @@ -219,3 +219,11 @@ bool HelloWorldPubSubType::getKey( return true; } +void HelloWorldPubSubType::register_type_object_representation() const +{ + register_HelloWorld_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "HelloWorldCdrAux.ipp" diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPubSubTypes.h b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPubSubTypes.h index 545c68b12b2..a9b4ac119e0 100644 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPubSubTypes.h +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPubSubTypes.h @@ -29,7 +29,7 @@ #include #include -#include "HelloWorld.h" +#include "HelloWorld.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -90,6 +88,9 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPublisher.h b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPublisher.h index ca01551f3c3..220e10338ce 100644 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPublisher.h +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldPublisher.h @@ -29,7 +29,7 @@ #include #include -#include "HelloWorld.h" +#include "HelloWorld.hpp" class HelloWorldPublisher { diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldSubscriber.cpp b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldSubscriber.cpp index 175eb640873..5d505897f4d 100644 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldSubscriber.cpp +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldSubscriber.cpp @@ -143,7 +143,7 @@ void HelloWorldSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&hello_, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldSubscriber.h b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldSubscriber.h index 1c5c45faa0d..0d5cb38bfae 100644 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldSubscriber.h +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldSubscriber.h @@ -28,7 +28,7 @@ #include #include -#include "HelloWorld.h" +#include "HelloWorld.hpp" class HelloWorldSubscriber { diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldTypeObjectSupport.cxx b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldTypeObjectSupport.cxx new file mode 100644 index 00000000000..bfae95694f4 --- /dev/null +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldTypeObjectSupport.cxx @@ -0,0 +1,248 @@ +// 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 HelloWorldTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "HelloWorldTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "HelloWorld.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_HelloWorld_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_HelloWorld_type_identifier(); + + }); +} + +void register_HelloWorld_type_identifier() +{ + { + StructTypeFlag struct_flags_HelloWorld = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_HelloWorld; + TypeIdentifierPair type_ids_HelloWorld; + QualifiedTypeName type_name_HelloWorld = "HelloWorld"; + eprosima::fastcdr::optional type_ann_builtin_HelloWorld; + eprosima::fastcdr::optional ann_custom_HelloWorld; + CompleteTypeDetail detail_HelloWorld = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_HelloWorld, ann_custom_HelloWorld, type_name_HelloWorld.to_string()); + CompleteStructHeader header_HelloWorld; + header_HelloWorld = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_HelloWorld); + CompleteStructMemberSeq member_seq_HelloWorld; + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_HelloWorld); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_index); + } + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_HelloWorld); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_message); + } + CompleteStructType struct_type_HelloWorld = TypeObjectUtils::build_complete_struct_type(struct_flags_HelloWorld, header_HelloWorld, member_seq_HelloWorld); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_HelloWorld, type_name_HelloWorld.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld already registered in TypeObjectRegistry for a different type."); + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "HelloWorld", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldTypeObjectSupport.hpp b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldTypeObjectSupport.hpp new file mode 100644 index 00000000000..8650fc061e0 --- /dev/null +++ b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// 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 HelloWorldTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_HelloWorld_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register HelloWorld related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_HelloWorld_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldv1.cxx b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldv1.cxx deleted file mode 100644 index 90e82ea88a7..00000000000 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldv1.cxx +++ /dev/null @@ -1,286 +0,0 @@ -// 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 HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define HelloWorld_max_cdr_typesize 268ULL; - - - - -HelloWorld::HelloWorld() -{ - // unsigned long m_index - m_index = 0; - // /type_d() m_message - - -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - 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; - - -} - - -bool HelloWorld::isKeyDefined() -{ - return false; -} - -void HelloWorld::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -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 - */ -void HelloWorld::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& HelloWorld::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldv1.h b/examples/cpp/dds/SecureHelloWorldExample/HelloWorldv1.h deleted file mode 100644 index 8c7406a074a..00000000000 --- a/examples/cpp/dds/SecureHelloWorldExample/HelloWorldv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// 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 HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloWorld defined by the user in the IDL file. - * @ingroup HelloWorld - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - 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 - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - 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 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; - std::string m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.cxx b/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.cxx deleted file mode 100644 index 4b415d67769..00000000000 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// 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 HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -HelloWorld::HelloWorld() -{ -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -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 - */ -void HelloWorld::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& HelloWorld::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "HelloWorldCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.h b/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.h deleted file mode 100644 index 5cd0ddba511..00000000000 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.h +++ /dev/null @@ -1,195 +0,0 @@ -// 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 HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "HelloWorldv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -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 - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - 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 - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::string& message(); - -private: - - uint32_t m_index{0}; - std::string m_message; - -}; - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.hpp b/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.hpp new file mode 100644 index 00000000000..971fea8d920 --- /dev/null +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorld.hpp @@ -0,0 +1,227 @@ +// 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 HelloWorld.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_HPP_ + +#include +#include +#include +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(HELLOWORLD_SOURCE) +#define HELLOWORLD_DllAPI __declspec( dllexport ) +#else +#define HELLOWORLD_DllAPI __declspec( dllimport ) +#endif // HELLOWORLD_SOURCE +#else +#define HELLOWORLD_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define HELLOWORLD_DllAPI +#endif // _WIN32 + +/*! + * @brief This class represents the structure HelloWorld defined by the user in the IDL file. + * @ingroup HelloWorld + */ +class HelloWorld +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport HelloWorld() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~HelloWorld() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + const HelloWorld& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld( + HelloWorld&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + const HelloWorld& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object HelloWorld that will be copied. + */ + eProsima_user_DllExport HelloWorld& operator =( + HelloWorld&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator ==( + const HelloWorld& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } + + /*! + * @brief Comparison operator. + * @param x HelloWorld object to compare. + */ + eProsima_user_DllExport bool operator !=( + const HelloWorld& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member index + * @param _index New value for member index + */ + eProsima_user_DllExport void index( + uint32_t _index) + { + m_index = _index; + } + + /*! + * @brief This function returns the value of member index + * @return Value of member index + */ + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } + + /*! + * @brief This function returns a reference to member index + * @return Reference to member index + */ + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } + + + /*! + * @brief This function copies the value in member message + * @param _message New value to be copied in member message + */ + eProsima_user_DllExport void message( + const std::string& _message) + { + m_message = _message; + } + + /*! + * @brief This function moves the value in member message + * @param _message New value to be moved in member message + */ + eProsima_user_DllExport void message( + std::string&& _message) + { + m_message = std::move(_message); + } + + /*! + * @brief This function returns a constant reference to member message + * @return Constant reference to member message + */ + eProsima_user_DllExport const std::string& message() const + { + return m_message; + } + + /*! + * @brief This function returns a reference to member message + * @return Reference to member message + */ + eProsima_user_DllExport std::string& message() + { + return m_message; + } + + + +private: + + uint32_t m_index{0}; + std::string m_message; + +}; + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_HPP_ + + diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldCdrAux.hpp b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldCdrAux.hpp index 9f346d306be..6feb8a9da15 100644 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldCdrAux.hpp +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ #define _FAST_DDS_GENERATED_HELLOWORLDCDRAUX_HPP_ -#include "HelloWorld.h" +#include "HelloWorld.hpp" constexpr uint32_t HelloWorld_max_cdr_typesize {268UL}; constexpr uint32_t HelloWorld_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const HelloWorld& data); diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldCdrAux.ipp b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldCdrAux.ipp index 42e91f3cc38..97df3fe9d9e 100644 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldCdrAux.ipp +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPubSubTypes.cxx b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPubSubTypes.cxx index 85cb477896e..db018e69782 100644 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "HelloWorldPubSubTypes.h" +#include #include -#include "HelloWorldPubSubTypes.h" #include "HelloWorldCdrAux.hpp" +#include "HelloWorldTypeObjectSupport.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"); @@ -219,3 +219,11 @@ bool HelloWorldPubSubType::getKey( return true; } +void HelloWorldPubSubType::register_type_object_representation() const +{ + register_HelloWorld_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "HelloWorldCdrAux.ipp" diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPubSubTypes.h b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPubSubTypes.h index 545c68b12b2..a9b4ac119e0 100644 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPubSubTypes.h +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPubSubTypes.h @@ -29,7 +29,7 @@ #include #include -#include "HelloWorld.h" +#include "HelloWorld.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - /*! * @brief This class represents the TopicDataType of the type HelloWorld defined by the user in the IDL file. * @ingroup HelloWorld @@ -90,6 +88,9 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPublisher.h b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPublisher.h index 6f37d220749..ec1b5312bcc 100644 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPublisher.h +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldPublisher.h @@ -26,8 +26,7 @@ #include #include - -#include "HelloWorld.h" +#include "HelloWorld.hpp" class HelloWorldPublisher { diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldSubscriber.cpp b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldSubscriber.cpp index 278d65536c4..7b38e634fd5 100644 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldSubscriber.cpp +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldSubscriber.cpp @@ -128,7 +128,7 @@ void HelloWorldSubscriber::SubListener::on_data_available( DataReader* reader) { SampleInfo info; - if (reader->take_next_sample(&hello_, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&hello_, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldSubscriber.h b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldSubscriber.h index 6d45aadc167..5395d10e642 100644 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldSubscriber.h +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldSubscriber.h @@ -27,7 +27,7 @@ #include #include -#include "HelloWorld.h" +#include "HelloWorld.hpp" class HelloWorldSubscriber { diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldTypeObjectSupport.cxx b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldTypeObjectSupport.cxx new file mode 100644 index 00000000000..bfae95694f4 --- /dev/null +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldTypeObjectSupport.cxx @@ -0,0 +1,248 @@ +// 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 HelloWorldTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "HelloWorldTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "HelloWorld.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_HelloWorld_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_HelloWorld_type_identifier(); + + }); +} + +void register_HelloWorld_type_identifier() +{ + { + StructTypeFlag struct_flags_HelloWorld = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED, + false, false); + ReturnCode_t return_code_HelloWorld; + TypeIdentifierPair type_ids_HelloWorld; + QualifiedTypeName type_name_HelloWorld = "HelloWorld"; + eprosima::fastcdr::optional type_ann_builtin_HelloWorld; + eprosima::fastcdr::optional ann_custom_HelloWorld; + CompleteTypeDetail detail_HelloWorld = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_HelloWorld, ann_custom_HelloWorld, type_name_HelloWorld.to_string()); + CompleteStructHeader header_HelloWorld; + header_HelloWorld = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_HelloWorld); + CompleteStructMemberSeq member_seq_HelloWorld; + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_HelloWorld); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_index); + } + { + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_HelloWorld); + + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + std::string type_id_kind_anonymous_string_unbounded("TI_STRING8_SMALL"); + if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_SMALL") + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else if (type_id_kind_anonymous_string_unbounded == "TI_STRING8_LARGE") + { + LBound bound = 255; + StringLTypeDefn string_ldefn = TypeObjectUtils::build_string_l_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_string_type_identifier(string_ldefn, + "anonymous_string_unbounded")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Unknown String kind."); + return; + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_HelloWorld.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_HelloWorld); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_message); + } + CompleteStructType struct_type_HelloWorld = TypeObjectUtils::build_complete_struct_type(struct_flags_HelloWorld, header_HelloWorld, member_seq_HelloWorld); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_HelloWorld, type_name_HelloWorld.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld already registered in TypeObjectRegistry for a different type."); + } + return_code_HelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "HelloWorld", type_ids_HelloWorld); + if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "HelloWorld: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldTypeObjectSupport.hpp b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldTypeObjectSupport.hpp new file mode 100644 index 00000000000..8650fc061e0 --- /dev/null +++ b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// 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 HelloWorldTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_HelloWorld_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register HelloWorld related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_HelloWorld_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldv1.cxx b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldv1.cxx deleted file mode 100644 index 90e82ea88a7..00000000000 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldv1.cxx +++ /dev/null @@ -1,286 +0,0 @@ -// 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 HelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "HelloWorld.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define HelloWorld_max_cdr_typesize 268ULL; - - - - -HelloWorld::HelloWorld() -{ - // unsigned long m_index - m_index = 0; - // /type_d() m_message - - -} - -HelloWorld::~HelloWorld() -{ -} - -HelloWorld::HelloWorld( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -HelloWorld::HelloWorld( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -HelloWorld& HelloWorld::operator =( - const HelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -HelloWorld& HelloWorld::operator =( - HelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool HelloWorld::operator ==( - const HelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool HelloWorld::operator !=( - const HelloWorld& x) const -{ - 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; - - -} - - -bool HelloWorld::isKeyDefined() -{ - return false; -} - -void HelloWorld::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void HelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t HelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -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 - */ -void HelloWorld::message( - const std::string& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void HelloWorld::message( - std::string&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::string& HelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::string& HelloWorld::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldv1.h b/examples/cpp/dds/StaticHelloWorldExample/HelloWorldv1.h deleted file mode 100644 index 8c7406a074a..00000000000 --- a/examples/cpp/dds/StaticHelloWorldExample/HelloWorldv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// 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 HelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HELLOWORLD_SOURCE) -#define HELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define HELLOWORLD_DllAPI __declspec( dllimport ) -#endif // HELLOWORLD_SOURCE -#else -#define HELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define HELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure HelloWorld defined by the user in the IDL file. - * @ingroup HelloWorld - */ -class HelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport HelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~HelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - const HelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld( - HelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - const HelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object HelloWorld that will be copied. - */ - eProsima_user_DllExport HelloWorld& operator =( - HelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const HelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x HelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const HelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - 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 - */ - eProsima_user_DllExport void message( - const std::string& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::string&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::string& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - 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 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; - std::string m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_HELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/TypeLookupService/CMakeLists.txt b/examples/cpp/dds/TypeLookupService/CMakeLists.txt deleted file mode 100644 index bcbe9c9c84b..00000000000 --- a/examples/cpp/dds/TypeLookupService/CMakeLists.txt +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright 2019 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. - -cmake_minimum_required(VERSION 3.20) - -project(TypeLookupExample VERSION 1 LANGUAGES CXX) - -# Find requirements -if(NOT fastcdr_FOUND) - find_package(fastcdr 2 REQUIRED) -endif() - -if(NOT fastdds_FOUND) - find_package(fastdds 3 REQUIRED) -endif() - -#Check C++11 -include(CheckCXXCompilerFlag) -if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") - check_cxx_compiler_flag(-std=c++11 SUPPORTS_CXX11) - if(NOT SUPPORTS_CXX11) - message(FATAL_ERROR "Compiler doesn't support C++11") - endif() -endif() - -message(STATUS "Configuring TypeLookup example...") -file(GLOB DDS_TYPELOOKUP_EXAMPLE_SOURCES_CPP "*.cpp") - -add_executable(TypeLookupExample - ${DDS_TYPELOOKUP_EXAMPLE_SOURCES_CPP}) - -target_compile_definitions(TypeLookupExample PRIVATE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. -) -target_link_libraries(TypeLookupExample fastdds fastcdr) -install(TARGETS TypeLookupExample - RUNTIME DESTINATION examples/cpp/dds/TypeLookupService/${BIN_INSTALL_DIR}) -install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/example_type_profile.xml - DESTINATION examples/cpp/dds/TypeLookupService/${BIN_INSTALL_DIR}) - -file(COPY example_type_profile.xml DESTINATION ${PROJECT_BINARY_DIR}) diff --git a/examples/cpp/dds/TypeLookupService/README.txt b/examples/cpp/dds/TypeLookupService/README.txt deleted file mode 100644 index 69b047bf282..00000000000 --- a/examples/cpp/dds/TypeLookupService/README.txt +++ /dev/null @@ -1,17 +0,0 @@ -To launch this test open two different consoles: - -In the first one launch: ./TypeLookupExample publisher -(or TypeLookupExample.exe publisher on windows). -In the second one: ./TypeLookupExample subscriber -(or TypeLookupExample.exe subscriber on windows). - -In this example, the publisher loads a type from the XML file "example_type_profile.xml". -The publisher shares the TypeInformation so other participants can discover it. - -After retrieving the type using the TypeLookup service, -the subscriber will discover the type and introspecting it will show the received messages from the publisher. - -The type defined in the XML file can be modified to see how the subscriber notices the changes automatically, -but take into account that the publisher should be modified to understand the changes. - -For this example, the root type must be a structure. diff --git a/examples/cpp/dds/TypeLookupService/TypeLookupPublisher.cpp b/examples/cpp/dds/TypeLookupService/TypeLookupPublisher.cpp deleted file mode 100644 index fff5a448ed3..00000000000 --- a/examples/cpp/dds/TypeLookupService/TypeLookupPublisher.cpp +++ /dev/null @@ -1,238 +0,0 @@ -// 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 TypeLookupPublisher.cpp - * - */ - -#include "TypeLookupPublisher.h" - -#include - -#include -#include -#include -#include -#include -#include - -using namespace eprosima::fastdds::dds; -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::rtps; - -TypeLookupPublisher::TypeLookupPublisher() - : mp_participant(nullptr) - , mp_publisher(nullptr) -{ -} - -bool TypeLookupPublisher::init() -{ - if (ReturnCode_t::RETCODE_OK != - DomainParticipantFactory::get_instance()->load_XML_profiles_file("example_type_profile.xml")) - { - std::cout << "Cannot open XML file \"example_type_profile.xml\". Please, run the publisher from the folder " - << "that contatins this XML file." << std::endl; - return false; - } - - eprosima::fastrtps::types::DynamicTypeBuilder* type; - if (ReturnCode_t::RETCODE_OK != - DomainParticipantFactory::get_instance()->get_dynamic_type_builder_from_xml_by_name("TypeLookup", type)) - { - std::cout << - "Error getting dynamic type \"TypeLookup\"." << std::endl; - return false; - } - types::DynamicType_ptr dyn_type = type->build(); - TypeSupport m_type(new types::DynamicPubSubType(dyn_type)); - m_Hello = types::DynamicDataFactory::get_instance()->create_data(dyn_type); - - m_Hello->set_string_value("Hello DDS Dynamic World", 0); - m_Hello->set_uint32_value(0, 1); - types::DynamicData* inner = m_Hello->loan_value(2); - inner->set_byte_value(10, 0); - m_Hello->return_loaned_value(inner); - - DomainParticipantQos pqos; - pqos.wire_protocol().builtin.discovery_config.discoveryProtocol = SIMPLE; - pqos.wire_protocol().builtin.discovery_config.use_SIMPLE_EndpointDiscoveryProtocol = true; - pqos.wire_protocol().builtin.discovery_config.m_simpleEDP.use_PublicationReaderANDSubscriptionWriter = true; - pqos.wire_protocol().builtin.discovery_config.m_simpleEDP.use_PublicationWriterANDSubscriptionReader = true; - pqos.wire_protocol().builtin.typelookup_config.use_server = true; - pqos.wire_protocol().builtin.use_WriterLivelinessProtocol = false; - pqos.wire_protocol().builtin.discovery_config.leaseDuration = c_TimeInfinite; - pqos.name("Participant_pub"); - mp_participant = DomainParticipantFactory::get_instance()->create_participant(0, pqos); - - if (mp_participant == nullptr) - { - return false; - } - - //REGISTER THE TYPE - m_type.get()->auto_fill_type_information(true); - m_type.get()->auto_fill_type_object(false); - m_type.register_type(mp_participant); - - //CREATE THE PUBLISHER - mp_publisher = mp_participant->create_publisher(PUBLISHER_QOS_DEFAULT, nullptr); - - if (mp_publisher == nullptr) - { - return false; - } - - topic_ = mp_participant->create_topic("TypeLookupTopic", "TypeLookup", TOPIC_QOS_DEFAULT); - - if (topic_ == nullptr) - { - return false; - } - - // CREATE THE WRITER - DataWriterQos wqos; - wqos.history().kind = eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS; - wqos.history().depth = 30; - wqos.resource_limits().max_samples = 50; - wqos.resource_limits().allocated_samples = 20; - wqos.reliable_writer_qos().times.heartbeatPeriod.seconds = 2; - wqos.reliable_writer_qos().times.heartbeatPeriod.nanosec = 200 * 1000 * 1000; - writer_ = mp_publisher->create_datawriter(topic_, wqos, &m_listener); - - if (writer_ == nullptr) - { - return false; - } - - return true; - -} - -TypeLookupPublisher::~TypeLookupPublisher() -{ - if (writer_ != nullptr) - { - mp_publisher->delete_datawriter(writer_); - } - if (mp_publisher != nullptr) - { - mp_participant->delete_publisher(mp_publisher); - } - if (topic_ != nullptr) - { - mp_participant->delete_topic(topic_); - } - DomainParticipantFactory::get_instance()->delete_participant(mp_participant); -} - -void TypeLookupPublisher::PubListener::on_publication_matched( - eprosima::fastdds::dds::DataWriter*, - const eprosima::fastdds::dds::PublicationMatchedStatus& info) -{ - if (info.current_count_change == 1) - { - n_matched++; - firstConnected = true; - std::cout << "Publisher matched" << std::endl; - } - else if (info.current_count_change == -1) - { - n_matched--; - std::cout << "Publisher unmatched" << std::endl; - } - else - { - std::cout << "Publisher received an invalid value for PublicationMatchedStatus." << std::endl; - } -} - -void TypeLookupPublisher::runThread( - uint32_t samples, - uint32_t sleep) -{ - if (samples == 0) - { - while (!stop) - { - if (publish(false)) - { - std::string message; - m_Hello->get_string_value(message, 0); - uint32_t index; - m_Hello->get_uint32_value(index, 1); - std::cout << "Message: " << message << " with index: " << index << " SENT" << std::endl; - } - std::this_thread::sleep_for(std::chrono::milliseconds(sleep)); - } - } - else - { - for (uint32_t i = 0; i < samples; ++i) - { - if (!publish()) - { - --i; - } - else - { - std::string message; - m_Hello->get_string_value(message, 0); - uint32_t index; - m_Hello->get_uint32_value(index, 1); - std::cout << "Message: " << message << " with index: " << index << " SENT" << std::endl; - } - std::this_thread::sleep_for(std::chrono::milliseconds(sleep)); - } - } -} - -void TypeLookupPublisher::run( - uint32_t samples, - uint32_t sleep) -{ - stop = false; - std::thread thread(&TypeLookupPublisher::runThread, this, samples, sleep); - if (samples == 0) - { - std::cout << "Publisher running. Please press enter to stop the Publisher at any time." << std::endl; - std::cin.ignore(); - stop = true; - } - else - { - std::cout << "Publisher running " << samples << " samples." << std::endl; - } - thread.join(); -} - -bool TypeLookupPublisher::publish( - bool waitForListener) -{ - if (m_listener.firstConnected || !waitForListener || m_listener.n_matched > 0) - { - uint32_t index; - m_Hello->get_uint32_value(index, 1); - m_Hello->set_uint32_value(index + 1, 1); - types::DynamicData* inner = m_Hello->loan_value(2); - octet inner_count; - inner->get_byte_value(inner_count, 0); - inner->set_byte_value(inner_count + 1, 0); - m_Hello->return_loaned_value(inner); - writer_->write(m_Hello.get()); - return true; - } - return false; -} diff --git a/examples/cpp/dds/TypeLookupService/TypeLookupPublisher.h b/examples/cpp/dds/TypeLookupService/TypeLookupPublisher.h deleted file mode 100644 index 567ac872c1e..00000000000 --- a/examples/cpp/dds/TypeLookupService/TypeLookupPublisher.h +++ /dev/null @@ -1,94 +0,0 @@ -// 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 TypeLookupPublisher.h - * - */ - -#ifndef HELLOWORLDPUBLISHER_H_ -#define HELLOWORLDPUBLISHER_H_ - -#include -#include - -#include -#include - -class TypeLookupPublisher -{ -public: - - TypeLookupPublisher(); - - virtual ~TypeLookupPublisher(); - - //!Initialize - bool init(); - - //!Publish a sample - bool publish( - bool waitForListener = true); - - //!Run for number samples - void run( - uint32_t number, - uint32_t sleep); - -private: - - eprosima::fastrtps::types::DynamicData_ptr m_Hello; - - eprosima::fastdds::dds::DomainParticipant* mp_participant; - - eprosima::fastdds::dds::Publisher* mp_publisher; - - eprosima::fastdds::dds::Topic* topic_; - - eprosima::fastdds::dds::DataWriter* writer_; - - bool stop; - - class PubListener : public eprosima::fastdds::dds::DataWriterListener - { - public: - - PubListener() - : n_matched(0) - , firstConnected(false) - { - } - - ~PubListener() override - { - } - - void on_publication_matched( - eprosima::fastdds::dds::DataWriter* writer, - const eprosima::fastdds::dds::PublicationMatchedStatus& info) override; - - int n_matched; - - bool firstConnected; - } - m_listener; - - void runThread( - uint32_t number, - uint32_t sleep); -}; - - - -#endif /* HELLOWORLDPUBLISHER_H_ */ diff --git a/examples/cpp/dds/TypeLookupService/TypeLookupSubscriber.cpp b/examples/cpp/dds/TypeLookupService/TypeLookupSubscriber.cpp deleted file mode 100644 index 030fad3a1be..00000000000 --- a/examples/cpp/dds/TypeLookupService/TypeLookupSubscriber.cpp +++ /dev/null @@ -1,260 +0,0 @@ -// 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 TypeLookupSubscriber.cpp - * - */ - -#include "TypeLookupSubscriber.h" - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -using namespace eprosima::fastdds::dds; -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::rtps; - -TypeLookupSubscriber::TypeLookupSubscriber() - : mp_participant(nullptr) - , mp_subscriber(nullptr) - , m_listener(this) -{ -} - -bool TypeLookupSubscriber::init() -{ - DomainParticipantQos pqos; - pqos.wire_protocol().builtin.discovery_config.discoveryProtocol = SIMPLE; - pqos.wire_protocol().builtin.discovery_config.use_SIMPLE_EndpointDiscoveryProtocol = true; - pqos.wire_protocol().builtin.discovery_config.m_simpleEDP.use_PublicationReaderANDSubscriptionWriter = true; - pqos.wire_protocol().builtin.discovery_config.m_simpleEDP.use_PublicationWriterANDSubscriptionReader = true; - pqos.wire_protocol().builtin.typelookup_config.use_client = true; - pqos.wire_protocol().builtin.use_WriterLivelinessProtocol = false; - pqos.wire_protocol().builtin.discovery_config.leaseDuration = c_TimeInfinite; - pqos.name("Participant_sub"); - - //Do not enable entities on creation - DomainParticipantFactoryQos factory_qos; - factory_qos.entity_factory().autoenable_created_entities = false; - DomainParticipantFactory::get_instance()->set_qos(factory_qos); - - StatusMask par_mask = StatusMask::subscription_matched() << StatusMask::data_available(); - mp_participant = DomainParticipantFactory::get_instance()->create_participant(0, pqos, &m_listener, par_mask); - if (mp_participant == nullptr) - { - return false; - } - if (mp_participant->enable() != ReturnCode_t::RETCODE_OK) - { - DomainParticipantFactory::get_instance()->delete_participant(mp_participant); - return false; - } - - // CREATE THE COMMON READER ATTRIBUTES - qos_ = DATAREADER_QOS_DEFAULT; - qos_.durability().kind = eprosima::fastdds::dds::TRANSIENT_LOCAL_DURABILITY_QOS; - qos_.reliability().kind = eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS; - qos_.history().kind = eprosima::fastdds::dds::KEEP_LAST_HISTORY_QOS; - qos_.history().depth = 30; - qos_.resource_limits().max_samples = 50; - qos_.resource_limits().allocated_samples = 20; - - return true; -} - -TypeLookupSubscriber::~TypeLookupSubscriber() -{ - for (const auto& it : topics_) - { - mp_subscriber->delete_datareader(it.first); - mp_participant->delete_topic(it.second); - } - if (mp_subscriber != nullptr) - { - mp_participant->delete_subscriber(mp_subscriber); - } - - DomainParticipantFactory::get_instance()->delete_participant(mp_participant); - topics_.clear(); - readers_.clear(); - datas_.clear(); -} - -void TypeLookupSubscriber::SubListener::on_subscription_matched( - eprosima::fastdds::dds::DataReader* reader, - const eprosima::fastdds::dds::SubscriptionMatchedStatus& info) -{ - if (info.current_count_change == 1) - { - n_matched++; - std::cout << "Subscriber matched" << std::endl; - } - else if (info.current_count_change == -1) - { - n_matched--; - std::cout << "Subscriber unmatched" << std::endl; - auto itr = subscriber_->readers_.find(reader); - if (itr != subscriber_->readers_.end()) - { - subscriber_->readers_.erase(itr); - } - - auto itd = subscriber_->datas_.find(reader); - if (itd != subscriber_->datas_.end()) - { - subscriber_->datas_.erase(itd); - } - - if (subscriber_->mp_subscriber != nullptr) - { - subscriber_->mp_subscriber->delete_datareader(reader); - } - } - else - { - std::cout << "Subscriber received an invalid value for SubscriptionMatchedStatus." << std::endl; - } -} - -void TypeLookupSubscriber::SubListener::on_data_available( - eprosima::fastdds::dds::DataReader* reader) -{ - auto dit = subscriber_->datas_.find(reader); - - if (dit != subscriber_->datas_.end()) - { - types::DynamicData_ptr data = dit->second; - SampleInfo info; - if (reader->take_next_sample(data.get(), &info) == ReturnCode_t::RETCODE_OK) - { - if (info.valid_data) - { - types::DynamicType_ptr type = subscriber_->readers_[reader]; - this->n_samples++; - std::cout << "Received data of type " << type->get_name() << std::endl; - types::DynamicDataHelper::print(data); - } - } - } -} - -void TypeLookupSubscriber::SubListener::on_type_information_received( - eprosima::fastdds::dds::DomainParticipant*, - const eprosima::fastcdr::string_255 topic_name, - const eprosima::fastcdr::string_255 type_name, - const eprosima::fastrtps::types::TypeInformation& type_information) -{ - std::function callback = - [this, topic_name](const std::string& name, const types::DynamicType_ptr type) - { - std::cout << "Discovered type: " << name << " from topic " << topic_name << std::endl; - - if (subscriber_->mp_subscriber == nullptr) - { - subscriber_->mp_subscriber = subscriber_->mp_participant->create_subscriber( - SUBSCRIBER_QOS_DEFAULT, nullptr); - - if (subscriber_->mp_subscriber == nullptr) - { - return; - } - } - - //CREATE THE TOPIC - eprosima::fastdds::dds::Topic* topic = subscriber_->mp_participant->create_topic( - "TypeLookupTopic", - name, - TOPIC_QOS_DEFAULT); - - if (topic == nullptr) - { - return; - } - - StatusMask sub_mask = StatusMask::subscription_matched() << StatusMask::data_available(); - DataReader* reader = subscriber_->mp_subscriber->create_datareader( - topic, - subscriber_->qos_, - &subscriber_->m_listener, - sub_mask); - - if (type == nullptr) - { - const types::TypeIdentifier* ident = - types::TypeObjectFactory::get_instance()->get_type_identifier_trying_complete(name); - - if (nullptr != ident) - { - const types::TypeObject* obj = - types::TypeObjectFactory::get_instance()->get_type_object(ident); - - types::DynamicType_ptr dyn_type = - types::TypeObjectFactory::get_instance()->build_dynamic_type(name, ident, obj); - - if (nullptr != dyn_type) - { - subscriber_->readers_[reader] = dyn_type; - types::DynamicData_ptr data( - types::DynamicDataFactory::get_instance()->create_data(dyn_type)); - subscriber_->datas_[reader] = data; - } - else - { - std::cout << "ERROR: DynamicType cannot be created for type: " << name << std::endl; - } - } - else - { - std::cout << "ERROR: TypeIdentifier cannot be retrieved for type: " << name << std::endl; - } - } - else - { - subscriber_->topics_[reader] = topic; - subscriber_->readers_[reader] = type; - types::DynamicData_ptr data(types::DynamicDataFactory::get_instance()->create_data(type)); - subscriber_->datas_[reader] = data; - } - }; - - subscriber_->mp_participant->register_remote_type( - type_information, - type_name.to_string(), - callback); -} - -void TypeLookupSubscriber::run() -{ - std::cout << "Subscriber running. Please press enter to stop the Subscriber" << std::endl; - std::cin.ignore(); -} - -void TypeLookupSubscriber::run( - uint32_t number) -{ - std::cout << "Subscriber running until " << number << " samples have been received" << std::endl; - while (number > this->m_listener.n_samples) - { - std::this_thread::sleep_for(std::chrono::milliseconds(500)); - } -} diff --git a/examples/cpp/dds/TypeLookupService/TypeLookupSubscriber.h b/examples/cpp/dds/TypeLookupService/TypeLookupSubscriber.h deleted file mode 100644 index 2b0fddf033f..00000000000 --- a/examples/cpp/dds/TypeLookupService/TypeLookupSubscriber.h +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2019 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 TypeLookupSubscriber.h - * - */ - -#ifndef HELLOWORLDSUBSCRIBER_H_ -#define HELLOWORLDSUBSCRIBER_H_ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -class TypeLookupSubscriber -{ -public: - - TypeLookupSubscriber(); - - virtual ~TypeLookupSubscriber(); - - //!Initialize the subscriber - bool init(); - - //!RUN the subscriber - void run(); - - //!Run the subscriber until number samples have been received. - void run( - uint32_t number); - -private: - - eprosima::fastdds::dds::DomainParticipant* mp_participant; - - eprosima::fastdds::dds::Subscriber* mp_subscriber; - - std::map topics_; - - std::map readers_; - - std::map datas_; - - eprosima::fastdds::dds::DataReaderQos qos_; - -public: - - class SubListener - : public eprosima::fastdds::dds::DomainParticipantListener - { - public: - - SubListener( - TypeLookupSubscriber* sub) - : n_matched(0) - , n_samples(0) - , subscriber_(sub) - { - } - - ~SubListener() override - { - } - - void on_data_available( - eprosima::fastdds::dds::DataReader* reader) override; - - void on_subscription_matched( - eprosima::fastdds::dds::DataReader* reader, - const eprosima::fastdds::dds::SubscriptionMatchedStatus& info) override; - - void on_type_information_received( - eprosima::fastdds::dds::DomainParticipant* participant, - const eprosima::fastcdr::string_255 topic_name, - const eprosima::fastcdr::string_255 type_name, - const eprosima::fastrtps::types::TypeInformation& type_information) override; - - int n_matched; - - uint32_t n_samples; - - TypeLookupSubscriber* subscriber_; - - std::map topic_type_map_; - - eprosima::fastrtps::types::TypeInformation type_info_; - } - m_listener; - -private: - - eprosima::fastrtps::types::DynamicPubSubType m_type; -}; - -#endif /* HELLOWORLDSUBSCRIBER_H_ */ diff --git a/examples/cpp/dds/TypeLookupService/TypeLookup_main.cpp b/examples/cpp/dds/TypeLookupService/TypeLookup_main.cpp deleted file mode 100644 index fe8b961f045..00000000000 --- a/examples/cpp/dds/TypeLookupService/TypeLookup_main.cpp +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2019 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 TypeLookup_main.cpp - * - */ - -#include - -#include "TypeLookupPublisher.h" -#include "TypeLookupSubscriber.h" - -using namespace eprosima::fastrtps; -using namespace eprosima::fastdds::dds; - -int main( - int argc, - char** argv) -{ - std::cout << "Starting " << std::endl; - int type = 1; - int count = 5; - long sleep = 100; - if (argc > 1) - { - if (strcmp(argv[1], "publisher") == 0) - { - type = 1; - if (argc >= 3) - { - count = atoi(argv[2]); - if (argc == 4) - { - sleep = atoi(argv[3]); - } - } - } - else if (strcmp(argv[1], "subscriber") == 0) - { - type = 2; - } - } - else - { - std::cout << "publisher OR subscriber argument needed" << std::endl; - Log::Reset(); - return 0; - } - - switch (type) - { - case 1: - { - TypeLookupPublisher mypub; - if (mypub.init()) - { - mypub.run(count, sleep); - } - break; - } - case 2: - { - TypeLookupSubscriber mysub; - if (mysub.init()) - { - mysub.run(); - } - break; - } - } - Log::Reset(); - return 0; -} diff --git a/examples/cpp/dds/TypeLookupService/example_type_profile.xml b/examples/cpp/dds/TypeLookupService/example_type_profile.xml deleted file mode 100644 index 331b0c63290..00000000000 --- a/examples/cpp/dds/TypeLookupService/example_type_profile.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.cxx b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.cxx deleted file mode 100644 index 54ca2b05ab0..00000000000 --- a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// 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 LoanableHelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "LoanableHelloWorld.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -LoanableHelloWorld::LoanableHelloWorld() -{ -} - -LoanableHelloWorld::~LoanableHelloWorld() -{ -} - -LoanableHelloWorld::LoanableHelloWorld( - const LoanableHelloWorld& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -LoanableHelloWorld::LoanableHelloWorld( - LoanableHelloWorld&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -LoanableHelloWorld& LoanableHelloWorld::operator =( - const LoanableHelloWorld& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -LoanableHelloWorld& LoanableHelloWorld::operator =( - LoanableHelloWorld&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool LoanableHelloWorld::operator ==( - const LoanableHelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool LoanableHelloWorld::operator !=( - const LoanableHelloWorld& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void LoanableHelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t LoanableHelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& LoanableHelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void LoanableHelloWorld::message( - const std::array& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void LoanableHelloWorld::message( - std::array&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::array& LoanableHelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::array& LoanableHelloWorld::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "LoanableHelloWorldCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.h b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.hpp similarity index 69% rename from examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.h rename to examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.hpp index 80d8feaca9b..1567811078c 100644 --- a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.h +++ b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorld.hpp @@ -13,32 +13,18 @@ // limitations under the License. /*! - * @file LoanableHelloWorld.h + * @file LoanableHelloWorld.hpp * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool fastddsgen. */ -#include -#include "LoanableHelloWorldv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ -#define _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ +#ifndef _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_HPP_ +#define _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_HPP_ #include -#include #include -#include -#include -#include - -#include -#include -#include - - +#include #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -64,17 +50,6 @@ #define LOANABLEHELLOWORLD_DllAPI #endif // _WIN32 -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - /*! * @brief This class represents the structure LoanableHelloWorld defined by the user in the IDL file. * @ingroup LoanableHelloWorld @@ -86,73 +61,117 @@ class LoanableHelloWorld /*! * @brief Default constructor. */ - eProsima_user_DllExport LoanableHelloWorld(); + eProsima_user_DllExport LoanableHelloWorld() + { + } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~LoanableHelloWorld(); + eProsima_user_DllExport ~LoanableHelloWorld() + { + } /*! * @brief Copy constructor. * @param x Reference to the object LoanableHelloWorld that will be copied. */ eProsima_user_DllExport LoanableHelloWorld( - const LoanableHelloWorld& x); + const LoanableHelloWorld& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } /*! * @brief Move constructor. * @param x Reference to the object LoanableHelloWorld that will be copied. */ eProsima_user_DllExport LoanableHelloWorld( - LoanableHelloWorld&& x) noexcept; + LoanableHelloWorld&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } /*! * @brief Copy assignment. * @param x Reference to the object LoanableHelloWorld that will be copied. */ eProsima_user_DllExport LoanableHelloWorld& operator =( - const LoanableHelloWorld& x); + const LoanableHelloWorld& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } /*! * @brief Move assignment. * @param x Reference to the object LoanableHelloWorld that will be copied. */ eProsima_user_DllExport LoanableHelloWorld& operator =( - LoanableHelloWorld&& x) noexcept; + LoanableHelloWorld&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } /*! * @brief Comparison operator. * @param x LoanableHelloWorld object to compare. */ eProsima_user_DllExport bool operator ==( - const LoanableHelloWorld& x) const; + const LoanableHelloWorld& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } /*! * @brief Comparison operator. * @param x LoanableHelloWorld object to compare. */ eProsima_user_DllExport bool operator !=( - const LoanableHelloWorld& x) const; + const LoanableHelloWorld& x) const + { + return !(*this == x); + } /*! * @brief This function sets a value in member index * @param _index New value for member index */ eProsima_user_DllExport void index( - uint32_t _index); + uint32_t _index) + { + m_index = _index; + } /*! * @brief This function returns the value of member index * @return Value of member index */ - eProsima_user_DllExport uint32_t index() const; + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } /*! * @brief This function returns a reference to member index * @return Reference to member index */ - eProsima_user_DllExport uint32_t& index(); + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } /*! @@ -160,26 +179,40 @@ class LoanableHelloWorld * @param _message New value to be copied in member message */ eProsima_user_DllExport void message( - const std::array& _message); + const std::array& _message) + { + m_message = _message; + } /*! * @brief This function moves the value in member message * @param _message New value to be moved in member message */ eProsima_user_DllExport void message( - std::array&& _message); + std::array&& _message) + { + m_message = std::move(_message); + } /*! * @brief This function returns a constant reference to member message * @return Constant reference to member message */ - eProsima_user_DllExport const std::array& message() const; + eProsima_user_DllExport const std::array& message() const + { + return m_message; + } /*! * @brief This function returns a reference to member message * @return Reference to member message */ - eProsima_user_DllExport std::array& message(); + eProsima_user_DllExport std::array& message() + { + return m_message; + } + + private: @@ -188,8 +221,6 @@ class LoanableHelloWorld }; -#endif // _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ - +#endif // _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_HPP_ -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldCdrAux.hpp b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldCdrAux.hpp index c29aaedaaff..8fc200fee77 100644 --- a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldCdrAux.hpp +++ b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_LOANABLEHELLOWORLDCDRAUX_HPP_ #define _FAST_DDS_GENERATED_LOANABLEHELLOWORLDCDRAUX_HPP_ -#include "LoanableHelloWorld.h" +#include "LoanableHelloWorld.hpp" constexpr uint32_t LoanableHelloWorld_max_cdr_typesize {260UL}; constexpr uint32_t LoanableHelloWorld_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const LoanableHelloWorld& data); diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldCdrAux.ipp b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldCdrAux.ipp index 640061e832c..2c932b2b441 100644 --- a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldCdrAux.ipp +++ b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPubSubTypes.cxx b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPubSubTypes.cxx index 668ff484ea0..5ce26c2a2ed 100644 --- a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "LoanableHelloWorldPubSubTypes.h" +#include #include -#include "LoanableHelloWorldPubSubTypes.h" #include "LoanableHelloWorldCdrAux.hpp" +#include "LoanableHelloWorldTypeObjectSupport.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; - - LoanableHelloWorldPubSubType::LoanableHelloWorldPubSubType() { setName("LoanableHelloWorld"); @@ -219,3 +219,11 @@ bool LoanableHelloWorldPubSubType::getKey( return true; } +void LoanableHelloWorldPubSubType::register_type_object_representation() const +{ + register_LoanableHelloWorld_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "LoanableHelloWorldCdrAux.ipp" diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPubSubTypes.h b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPubSubTypes.h index e1c1a3017e7..33525ee7726 100644 --- a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPubSubTypes.h +++ b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPubSubTypes.h @@ -29,7 +29,7 @@ #include #include -#include "LoanableHelloWorld.h" +#include "LoanableHelloWorld.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - #ifndef SWIG namespace detail { @@ -123,6 +121,9 @@ class LoanableHelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataTyp eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPublisher.cxx b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPublisher.cxx index 44ec5a404fd..9407dce4f3d 100644 --- a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPublisher.cxx +++ b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldPublisher.cxx @@ -140,7 +140,7 @@ void LoanableHelloWorldPublisher::run() if (ch == 'y') { void* sample = nullptr; - if (ReturnCode_t::RETCODE_OK == writer_->loan_sample(sample)) + if (RETCODE_OK == writer_->loan_sample(sample)) { LoanableHelloWorld* data = static_cast(sample); data->index() = msgsent + 1; diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldSubscriber.cxx b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldSubscriber.cxx index 6ebf7a6f077..dfa87a321bb 100644 --- a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldSubscriber.cxx +++ b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldSubscriber.cxx @@ -127,7 +127,7 @@ void LoanableHelloWorldSubscriber::SubListener::on_data_available( LoanableHelloWorld st; SampleInfo info; - if (reader->take_next_sample(&st, &info) == ReturnCode_t::RETCODE_OK) + if (reader->take_next_sample(&st, &info) == RETCODE_OK) { if (info.instance_state == ALIVE_INSTANCE_STATE) { diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldTypeObjectSupport.cxx b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldTypeObjectSupport.cxx new file mode 100644 index 00000000000..212eb4a6d62 --- /dev/null +++ b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldTypeObjectSupport.cxx @@ -0,0 +1,313 @@ +// 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 LoanableHelloWorldTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "LoanableHelloWorldTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "LoanableHelloWorld.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_LoanableHelloWorld_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_LoanableHelloWorld_type_identifier(); + + }); +} + +void register_LoanableHelloWorld_type_identifier() +{ + { + StructTypeFlag struct_flags_LoanableHelloWorld = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::FINAL, + false, false); + ReturnCode_t return_code_LoanableHelloWorld; + TypeIdentifierPair type_ids_LoanableHelloWorld; + QualifiedTypeName type_name_LoanableHelloWorld = "LoanableHelloWorld"; + eprosima::fastcdr::optional type_ann_builtin_LoanableHelloWorld; + eprosima::fastcdr::optional ann_custom_LoanableHelloWorld; + AppliedAnnotationSeq tmp_ann_custom_LoanableHelloWorld; + eprosima::fastcdr::optional verbatim_LoanableHelloWorld; + if (!tmp_ann_custom_LoanableHelloWorld.empty()) + { + ann_custom_LoanableHelloWorld = tmp_ann_custom_LoanableHelloWorld; + } + + CompleteTypeDetail detail_LoanableHelloWorld = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_LoanableHelloWorld, ann_custom_LoanableHelloWorld, type_name_LoanableHelloWorld.to_string()); + CompleteStructHeader header_LoanableHelloWorld; + header_LoanableHelloWorld = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_LoanableHelloWorld); + CompleteStructMemberSeq member_seq_LoanableHelloWorld; + { + return_code_LoanableHelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_LoanableHelloWorld); + + if (return_code_LoanableHelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1()._d() || TK_NONE == type_ids_LoanableHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_LoanableHelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_LoanableHelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_LoanableHelloWorld.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_LoanableHelloWorld); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_LoanableHelloWorld, member_index); + } + { + return_code_LoanableHelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_char_256", type_ids_LoanableHelloWorld); + + if (return_code_LoanableHelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_LoanableHelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_char", type_ids_LoanableHelloWorld); + + if (return_code_LoanableHelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_char_256 {nullptr}; + if (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1()._d() || TK_NONE == type_ids_LoanableHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_char_256 = new TypeIdentifier(type_ids_LoanableHelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_char_256 = new TypeIdentifier(type_ids_LoanableHelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_char_256 = EK_COMPLETE; + if (TK_NONE == type_ids_LoanableHelloWorld.type_identifier2()._d()) + { + equiv_kind_anonymous_array_char_256 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_char_256 = 0; + PlainCollectionHeader header_anonymous_array_char_256 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_char_256, element_flags_anonymous_array_char_256); + std::string type_id_kind_anonymous_array_char_256("TI_PLAIN_ARRAY_LARGE"); + if (type_id_kind_anonymous_array_char_256 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(256)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_char_256, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_char_256)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_char_256")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_256 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(256)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_char_256, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_char_256)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_char_256")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_256 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_LoanableHelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_char_256", type_ids_LoanableHelloWorld); + if (return_code_LoanableHelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_256: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1()._d() || TK_NONE == type_ids_LoanableHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_LoanableHelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_LoanableHelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_LoanableHelloWorld.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_LoanableHelloWorld); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_LoanableHelloWorld, member_message); + } + CompleteStructType struct_type_LoanableHelloWorld = TypeObjectUtils::build_complete_struct_type(struct_flags_LoanableHelloWorld, header_LoanableHelloWorld, member_seq_LoanableHelloWorld); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_LoanableHelloWorld, type_name_LoanableHelloWorld.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "LoanableHelloWorld already registered in TypeObjectRegistry for a different type."); + } + return_code_LoanableHelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "LoanableHelloWorld", type_ids_LoanableHelloWorld); + if (return_code_LoanableHelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "LoanableHelloWorld: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldTypeObjectSupport.hpp b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldTypeObjectSupport.hpp new file mode 100644 index 00000000000..101fafc55f4 --- /dev/null +++ b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// 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 LoanableHelloWorldTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_LoanableHelloWorld_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register LoanableHelloWorld related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_LoanableHelloWorld_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldv1.cxx b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldv1.cxx deleted file mode 100644 index 63da3dfddbc..00000000000 --- a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldv1.cxx +++ /dev/null @@ -1,288 +0,0 @@ -// 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 LoanableHelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "LoanableHelloWorld.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define LoanableHelloWorld_max_cdr_typesize 260ULL; - - - - -LoanableHelloWorld::LoanableHelloWorld() -{ - // unsigned long m_index - m_index = 0; - // char m_message - memset(&m_message, 0, ((256)) * 1); - -} - -LoanableHelloWorld::~LoanableHelloWorld() -{ -} - -LoanableHelloWorld::LoanableHelloWorld( - const LoanableHelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -LoanableHelloWorld::LoanableHelloWorld( - LoanableHelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -LoanableHelloWorld& LoanableHelloWorld::operator =( - const LoanableHelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -LoanableHelloWorld& LoanableHelloWorld::operator =( - LoanableHelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool LoanableHelloWorld::operator ==( - const LoanableHelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool LoanableHelloWorld::operator !=( - const LoanableHelloWorld& x) const -{ - return !(*this == x); -} - -size_t LoanableHelloWorld::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return LoanableHelloWorld_max_cdr_typesize; -} - -size_t LoanableHelloWorld::getCdrSerializedSize( - const LoanableHelloWorld& 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 += (((256)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - - -void LoanableHelloWorld::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_message; - - -} - -void LoanableHelloWorld::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_message; - - -} - - -bool LoanableHelloWorld::isKeyDefined() -{ - return false; -} - -void LoanableHelloWorld::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void LoanableHelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t LoanableHelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& LoanableHelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void LoanableHelloWorld::message( - const std::array& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void LoanableHelloWorld::message( - std::array&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::array& LoanableHelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::array& LoanableHelloWorld::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldv1.h b/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldv1.h deleted file mode 100644 index e60540cec9b..00000000000 --- a/examples/cpp/dds/WriterLoansExample/LoanableHelloWorldv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// 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 LoanableHelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ -#define _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(LOANABLEHELLOWORLD_SOURCE) -#define LOANABLEHELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define LOANABLEHELLOWORLD_DllAPI __declspec( dllimport ) -#endif // LOANABLEHELLOWORLD_SOURCE -#else -#define LOANABLEHELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define LOANABLEHELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure LoanableHelloWorld defined by the user in the IDL file. - * @ingroup LoanableHelloWorld - */ -class LoanableHelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LoanableHelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LoanableHelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LoanableHelloWorld that will be copied. - */ - eProsima_user_DllExport LoanableHelloWorld( - const LoanableHelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LoanableHelloWorld that will be copied. - */ - eProsima_user_DllExport LoanableHelloWorld( - LoanableHelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LoanableHelloWorld that will be copied. - */ - eProsima_user_DllExport LoanableHelloWorld& operator =( - const LoanableHelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LoanableHelloWorld that will be copied. - */ - eProsima_user_DllExport LoanableHelloWorld& operator =( - LoanableHelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LoanableHelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LoanableHelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x LoanableHelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LoanableHelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - 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 - */ - eProsima_user_DllExport void message( - const std::array& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::array&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::array& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::array& 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 LoanableHelloWorld& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint32_t m_index; - std::array m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.cxx b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.cxx deleted file mode 100644 index 54ca2b05ab0..00000000000 --- a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// 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 LoanableHelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "LoanableHelloWorld.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -LoanableHelloWorld::LoanableHelloWorld() -{ -} - -LoanableHelloWorld::~LoanableHelloWorld() -{ -} - -LoanableHelloWorld::LoanableHelloWorld( - const LoanableHelloWorld& x) -{ - m_index = x.m_index; - m_message = x.m_message; -} - -LoanableHelloWorld::LoanableHelloWorld( - LoanableHelloWorld&& x) noexcept -{ - m_index = x.m_index; - m_message = std::move(x.m_message); -} - -LoanableHelloWorld& LoanableHelloWorld::operator =( - const LoanableHelloWorld& x) -{ - - m_index = x.m_index; - m_message = x.m_message; - return *this; -} - -LoanableHelloWorld& LoanableHelloWorld::operator =( - LoanableHelloWorld&& x) noexcept -{ - - m_index = x.m_index; - m_message = std::move(x.m_message); - return *this; -} - -bool LoanableHelloWorld::operator ==( - const LoanableHelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool LoanableHelloWorld::operator !=( - const LoanableHelloWorld& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void LoanableHelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t LoanableHelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& LoanableHelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void LoanableHelloWorld::message( - const std::array& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void LoanableHelloWorld::message( - std::array&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::array& LoanableHelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::array& LoanableHelloWorld::message() -{ - return m_message; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "LoanableHelloWorldCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.h b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.hpp similarity index 69% rename from examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.h rename to examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.hpp index 80d8feaca9b..1567811078c 100644 --- a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.h +++ b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorld.hpp @@ -13,32 +13,18 @@ // limitations under the License. /*! - * @file LoanableHelloWorld.h + * @file LoanableHelloWorld.hpp * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool fastddsgen. */ -#include -#include "LoanableHelloWorldv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ -#define _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ +#ifndef _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_HPP_ +#define _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_HPP_ #include -#include #include -#include -#include -#include - -#include -#include -#include - - +#include #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -64,17 +50,6 @@ #define LOANABLEHELLOWORLD_DllAPI #endif // _WIN32 -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - - - /*! * @brief This class represents the structure LoanableHelloWorld defined by the user in the IDL file. * @ingroup LoanableHelloWorld @@ -86,73 +61,117 @@ class LoanableHelloWorld /*! * @brief Default constructor. */ - eProsima_user_DllExport LoanableHelloWorld(); + eProsima_user_DllExport LoanableHelloWorld() + { + } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~LoanableHelloWorld(); + eProsima_user_DllExport ~LoanableHelloWorld() + { + } /*! * @brief Copy constructor. * @param x Reference to the object LoanableHelloWorld that will be copied. */ eProsima_user_DllExport LoanableHelloWorld( - const LoanableHelloWorld& x); + const LoanableHelloWorld& x) + { + m_index = x.m_index; + + m_message = x.m_message; + + } /*! * @brief Move constructor. * @param x Reference to the object LoanableHelloWorld that will be copied. */ eProsima_user_DllExport LoanableHelloWorld( - LoanableHelloWorld&& x) noexcept; + LoanableHelloWorld&& x) noexcept + { + m_index = x.m_index; + m_message = std::move(x.m_message); + } /*! * @brief Copy assignment. * @param x Reference to the object LoanableHelloWorld that will be copied. */ eProsima_user_DllExport LoanableHelloWorld& operator =( - const LoanableHelloWorld& x); + const LoanableHelloWorld& x) + { + + m_index = x.m_index; + + m_message = x.m_message; + + return *this; + } /*! * @brief Move assignment. * @param x Reference to the object LoanableHelloWorld that will be copied. */ eProsima_user_DllExport LoanableHelloWorld& operator =( - LoanableHelloWorld&& x) noexcept; + LoanableHelloWorld&& x) noexcept + { + + m_index = x.m_index; + m_message = std::move(x.m_message); + return *this; + } /*! * @brief Comparison operator. * @param x LoanableHelloWorld object to compare. */ eProsima_user_DllExport bool operator ==( - const LoanableHelloWorld& x) const; + const LoanableHelloWorld& x) const + { + return (m_index == x.m_index && + m_message == x.m_message); + } /*! * @brief Comparison operator. * @param x LoanableHelloWorld object to compare. */ eProsima_user_DllExport bool operator !=( - const LoanableHelloWorld& x) const; + const LoanableHelloWorld& x) const + { + return !(*this == x); + } /*! * @brief This function sets a value in member index * @param _index New value for member index */ eProsima_user_DllExport void index( - uint32_t _index); + uint32_t _index) + { + m_index = _index; + } /*! * @brief This function returns the value of member index * @return Value of member index */ - eProsima_user_DllExport uint32_t index() const; + eProsima_user_DllExport uint32_t index() const + { + return m_index; + } /*! * @brief This function returns a reference to member index * @return Reference to member index */ - eProsima_user_DllExport uint32_t& index(); + eProsima_user_DllExport uint32_t& index() + { + return m_index; + } /*! @@ -160,26 +179,40 @@ class LoanableHelloWorld * @param _message New value to be copied in member message */ eProsima_user_DllExport void message( - const std::array& _message); + const std::array& _message) + { + m_message = _message; + } /*! * @brief This function moves the value in member message * @param _message New value to be moved in member message */ eProsima_user_DllExport void message( - std::array&& _message); + std::array&& _message) + { + m_message = std::move(_message); + } /*! * @brief This function returns a constant reference to member message * @return Constant reference to member message */ - eProsima_user_DllExport const std::array& message() const; + eProsima_user_DllExport const std::array& message() const + { + return m_message; + } /*! * @brief This function returns a reference to member message * @return Reference to member message */ - eProsima_user_DllExport std::array& message(); + eProsima_user_DllExport std::array& message() + { + return m_message; + } + + private: @@ -188,8 +221,6 @@ class LoanableHelloWorld }; -#endif // _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ - +#endif // _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_HPP_ -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldCdrAux.hpp b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldCdrAux.hpp index c29aaedaaff..8fc200fee77 100644 --- a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldCdrAux.hpp +++ b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldCdrAux.hpp @@ -22,7 +22,7 @@ #ifndef _FAST_DDS_GENERATED_LOANABLEHELLOWORLDCDRAUX_HPP_ #define _FAST_DDS_GENERATED_LOANABLEHELLOWORLDCDRAUX_HPP_ -#include "LoanableHelloWorld.h" +#include "LoanableHelloWorld.hpp" constexpr uint32_t LoanableHelloWorld_max_cdr_typesize {260UL}; constexpr uint32_t LoanableHelloWorld_max_key_cdr_typesize {0UL}; @@ -34,8 +34,6 @@ namespace fastcdr { class Cdr; class CdrSizeCalculator; - - eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, const LoanableHelloWorld& data); diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldCdrAux.ipp b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldCdrAux.ipp index 640061e832c..2c932b2b441 100644 --- a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldCdrAux.ipp +++ b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldCdrAux.ipp @@ -34,8 +34,6 @@ using namespace eprosima::fastcdr::exception; namespace eprosima { namespace fastcdr { - - template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPubSubTypes.cxx b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPubSubTypes.cxx index 668ff484ea0..5ce26c2a2ed 100644 --- a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPubSubTypes.cxx +++ b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPubSubTypes.cxx @@ -19,18 +19,18 @@ * This file was generated by the tool fastddsgen. */ +#include "LoanableHelloWorldPubSubTypes.h" +#include #include -#include "LoanableHelloWorldPubSubTypes.h" #include "LoanableHelloWorldCdrAux.hpp" +#include "LoanableHelloWorldTypeObjectSupport.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; - - LoanableHelloWorldPubSubType::LoanableHelloWorldPubSubType() { setName("LoanableHelloWorld"); @@ -219,3 +219,11 @@ bool LoanableHelloWorldPubSubType::getKey( return true; } +void LoanableHelloWorldPubSubType::register_type_object_representation() const +{ + register_LoanableHelloWorld_type_objects(); +} + + +// Include auxiliary functions like for serializing/deserializing. +#include "LoanableHelloWorldCdrAux.ipp" diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPubSubTypes.h b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPubSubTypes.h index e1c1a3017e7..33525ee7726 100644 --- a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPubSubTypes.h +++ b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPubSubTypes.h @@ -29,7 +29,7 @@ #include #include -#include "LoanableHelloWorld.h" +#include "LoanableHelloWorld.hpp" #if !defined(GEN_API_VER) || (GEN_API_VER != 2) @@ -38,8 +38,6 @@ #endif // GEN_API_VER - - #ifndef SWIG namespace detail { @@ -123,6 +121,9 @@ class LoanableHelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataTyp eProsima_user_DllExport void deleteData( void* data) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPublisher.cxx b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPublisher.cxx index 0854b6ebd47..e19c18d90ec 100644 --- a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPublisher.cxx +++ b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldPublisher.cxx @@ -144,7 +144,7 @@ void LoanableHelloWorldPublisher::run() if (ch == 'y') { void* sample = nullptr; - if (ReturnCode_t::RETCODE_OK == writer_->loan_sample(sample)) + if (RETCODE_OK == writer_->loan_sample(sample)) { std::cout << "Preparing sample at address " << sample << std::endl; LoanableHelloWorld* data = static_cast(sample); diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldSubscriber.cxx b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldSubscriber.cxx index 67d9b286824..15fa0200bfd 100644 --- a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldSubscriber.cxx +++ b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldSubscriber.cxx @@ -130,7 +130,7 @@ void LoanableHelloWorldSubscriber::SubListener::on_data_available( DataSeq data; SampleInfoSeq infos; - while (ReturnCode_t::RETCODE_OK == reader->take(data, infos)) + while (RETCODE_OK == reader->take(data, infos)) { for (LoanableCollection::size_type i = 0; i < infos.length(); ++i) { diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldTypeObjectSupport.cxx b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldTypeObjectSupport.cxx new file mode 100644 index 00000000000..212eb4a6d62 --- /dev/null +++ b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldTypeObjectSupport.cxx @@ -0,0 +1,313 @@ +// 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 LoanableHelloWorldTypeObjectSupport.cxx + * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#include "LoanableHelloWorldTypeObjectSupport.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "LoanableHelloWorld.hpp" + + +using namespace eprosima::fastdds::dds::xtypes; + +void register_LoanableHelloWorld_type_objects() +{ + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + register_LoanableHelloWorld_type_identifier(); + + }); +} + +void register_LoanableHelloWorld_type_identifier() +{ + { + StructTypeFlag struct_flags_LoanableHelloWorld = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::FINAL, + false, false); + ReturnCode_t return_code_LoanableHelloWorld; + TypeIdentifierPair type_ids_LoanableHelloWorld; + QualifiedTypeName type_name_LoanableHelloWorld = "LoanableHelloWorld"; + eprosima::fastcdr::optional type_ann_builtin_LoanableHelloWorld; + eprosima::fastcdr::optional ann_custom_LoanableHelloWorld; + AppliedAnnotationSeq tmp_ann_custom_LoanableHelloWorld; + eprosima::fastcdr::optional verbatim_LoanableHelloWorld; + if (!tmp_ann_custom_LoanableHelloWorld.empty()) + { + ann_custom_LoanableHelloWorld = tmp_ann_custom_LoanableHelloWorld; + } + + CompleteTypeDetail detail_LoanableHelloWorld = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_LoanableHelloWorld, ann_custom_LoanableHelloWorld, type_name_LoanableHelloWorld.to_string()); + CompleteStructHeader header_LoanableHelloWorld; + header_LoanableHelloWorld = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_LoanableHelloWorld); + CompleteStructMemberSeq member_seq_LoanableHelloWorld; + { + return_code_LoanableHelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_uint32_t", type_ids_LoanableHelloWorld); + + if (return_code_LoanableHelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_index; + MemberId member_id_index = 0x00000000; + if (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1()._d() || TK_NONE == type_ids_LoanableHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_LoanableHelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_LoanableHelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure index member TypeIdentifier inconsistent."); + return; + } + MemberName name_index = "index"; + eprosima::fastcdr::optional member_ann_builtin_index; + ann_custom_LoanableHelloWorld.reset(); + CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_LoanableHelloWorld); + CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); + TypeObjectUtils::add_complete_struct_member(member_seq_LoanableHelloWorld, member_index); + } + { + return_code_LoanableHelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_char_256", type_ids_LoanableHelloWorld); + + if (return_code_LoanableHelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + return_code_LoanableHelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_char", type_ids_LoanableHelloWorld); + + if (return_code_LoanableHelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + TypeIdentifier* element_identifier_anonymous_array_char_256 {nullptr}; + if (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1()._d() || TK_NONE == type_ids_LoanableHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_char_256 = new TypeIdentifier(type_ids_LoanableHelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + element_identifier_anonymous_array_char_256 = new TypeIdentifier(type_ids_LoanableHelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Array element TypeIdentifier inconsistent."); + return; + } + EquivalenceKind equiv_kind_anonymous_array_char_256 = EK_COMPLETE; + if (TK_NONE == type_ids_LoanableHelloWorld.type_identifier2()._d()) + { + equiv_kind_anonymous_array_char_256 = EK_BOTH; + } + CollectionElementFlag element_flags_anonymous_array_char_256 = 0; + PlainCollectionHeader header_anonymous_array_char_256 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_char_256, element_flags_anonymous_array_char_256); + std::string type_id_kind_anonymous_array_char_256("TI_PLAIN_ARRAY_LARGE"); + if (type_id_kind_anonymous_array_char_256 == "TI_PLAIN_ARRAY_SMALL") + { + SBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(256)); + + PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_char_256, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_char_256)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_char_256")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_256 already registered in TypeObjectRegistry for a different type."); + } + } + else + { + LBoundSeq array_bound_seq; + TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast(256)); + + PlainArrayLElemDefn array_ldefn = TypeObjectUtils::build_plain_array_l_elem_defn(header_anonymous_array_char_256, array_bound_seq, + eprosima::fastcdr::external(element_identifier_anonymous_array_char_256)); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_l_array_type_identifier(array_ldefn, "anonymous_array_char_256")) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_256 already registered in TypeObjectRegistry for a different type."); + } + } + return_code_LoanableHelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_array_char_256", type_ids_LoanableHelloWorld); + if (return_code_LoanableHelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_array_char_256: Given Array TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } + StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED, + false, false, false, false); + CommonStructMember common_message; + MemberId member_id_message = 0x00000001; + if (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1()._d() || TK_NONE == type_ids_LoanableHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LoanableHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LoanableHelloWorld.type_identifier1()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier1().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_LoanableHelloWorld.type_identifier1()); + } + else if (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2()._d() || + (TI_PLAIN_SEQUENCE_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) || + (TI_PLAIN_SEQUENCE_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) || + (TI_PLAIN_ARRAY_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) || + (TI_PLAIN_MAP_SMALL == type_ids_LoanableHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_sdefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) || + (TI_PLAIN_MAP_LARGE == type_ids_LoanableHelloWorld.type_identifier2()._d() && + (EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_ldefn().header().equiv_kind() || + EK_COMPLETE == type_ids_LoanableHelloWorld.type_identifier2().map_ldefn().key_identifier()->_d()))) + { + common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_LoanableHelloWorld.type_identifier2()); + } + else + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Structure message member TypeIdentifier inconsistent."); + return; + } + MemberName name_message = "message"; + eprosima::fastcdr::optional member_ann_builtin_message; + ann_custom_LoanableHelloWorld.reset(); + CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_LoanableHelloWorld); + CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message); + TypeObjectUtils::add_complete_struct_member(member_seq_LoanableHelloWorld, member_message); + } + CompleteStructType struct_type_LoanableHelloWorld = TypeObjectUtils::build_complete_struct_type(struct_flags_LoanableHelloWorld, header_LoanableHelloWorld, member_seq_LoanableHelloWorld); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_LoanableHelloWorld, type_name_LoanableHelloWorld.to_string())) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "LoanableHelloWorld already registered in TypeObjectRegistry for a different type."); + } + return_code_LoanableHelloWorld = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "LoanableHelloWorld", type_ids_LoanableHelloWorld); + if (return_code_LoanableHelloWorld != eprosima::fastdds::dds::RETCODE_OK) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "LoanableHelloWorld: Given Struct TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + } +} + diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldTypeObjectSupport.hpp b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldTypeObjectSupport.hpp new file mode 100644 index 00000000000..101fafc55f4 --- /dev/null +++ b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldTypeObjectSupport.hpp @@ -0,0 +1,54 @@ +// 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 LoanableHelloWorldTypeObjectSupport.hpp + * Header file containing the API required to register the TypeObject representation of the described types in the IDL file + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ +#define _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +/** + * @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry. + */ +eProsima_user_DllExport void register_LoanableHelloWorld_type_objects(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +/** + * @brief Register LoanableHelloWorld related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + */ +void register_LoanableHelloWorld_type_identifier(); + + +#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC + +#endif // _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_TYPE_OBJECT_SUPPORT_HPP_ diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldv1.cxx b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldv1.cxx deleted file mode 100644 index 63da3dfddbc..00000000000 --- a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldv1.cxx +++ /dev/null @@ -1,288 +0,0 @@ -// 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 LoanableHelloWorld.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "LoanableHelloWorld.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define LoanableHelloWorld_max_cdr_typesize 260ULL; - - - - -LoanableHelloWorld::LoanableHelloWorld() -{ - // unsigned long m_index - m_index = 0; - // char m_message - memset(&m_message, 0, ((256)) * 1); - -} - -LoanableHelloWorld::~LoanableHelloWorld() -{ -} - -LoanableHelloWorld::LoanableHelloWorld( - const LoanableHelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - -} - -LoanableHelloWorld::LoanableHelloWorld( - LoanableHelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - -} - -LoanableHelloWorld& LoanableHelloWorld::operator =( - const LoanableHelloWorld& x) -{ - m_index = x.m_index; - - - m_message = x.m_message; - - return *this; -} - -LoanableHelloWorld& LoanableHelloWorld::operator =( - LoanableHelloWorld&& x) noexcept -{ - m_index = x.m_index; - - - m_message = std::move(x.m_message); - - return *this; -} - -bool LoanableHelloWorld::operator ==( - const LoanableHelloWorld& x) const -{ - return (m_index == x.m_index && - m_message == x.m_message); -} - -bool LoanableHelloWorld::operator !=( - const LoanableHelloWorld& x) const -{ - return !(*this == x); -} - -size_t LoanableHelloWorld::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return LoanableHelloWorld_max_cdr_typesize; -} - -size_t LoanableHelloWorld::getCdrSerializedSize( - const LoanableHelloWorld& 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 += (((256)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - - -void LoanableHelloWorld::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_index; - - scdr << m_message; - - -} - -void LoanableHelloWorld::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_index; - - - - dcdr >> m_message; - - -} - - -bool LoanableHelloWorld::isKeyDefined() -{ - return false; -} - -void LoanableHelloWorld::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ -void LoanableHelloWorld::index( - uint32_t _index) -{ - m_index = _index; -} - -/*! - * @brief This function returns the value of member index - * @return Value of member index - */ -uint32_t LoanableHelloWorld::index() const -{ - return m_index; -} - -/*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ -uint32_t& LoanableHelloWorld::index() -{ - return m_index; -} - - -/*! - * @brief This function copies the value in member message - * @param _message New value to be copied in member message - */ -void LoanableHelloWorld::message( - const std::array& _message) -{ - m_message = _message; -} - -/*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ -void LoanableHelloWorld::message( - std::array&& _message) -{ - m_message = std::move(_message); -} - -/*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ -const std::array& LoanableHelloWorld::message() const -{ - return m_message; -} - -/*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ -std::array& LoanableHelloWorld::message() -{ - return m_message; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldv1.h b/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldv1.h deleted file mode 100644 index e60540cec9b..00000000000 --- a/examples/cpp/dds/ZeroCopyExample/LoanableHelloWorldv1.h +++ /dev/null @@ -1,244 +0,0 @@ -// 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 LoanableHelloWorld.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ -#define _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(LOANABLEHELLOWORLD_SOURCE) -#define LOANABLEHELLOWORLD_DllAPI __declspec( dllexport ) -#else -#define LOANABLEHELLOWORLD_DllAPI __declspec( dllimport ) -#endif // LOANABLEHELLOWORLD_SOURCE -#else -#define LOANABLEHELLOWORLD_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define LOANABLEHELLOWORLD_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - - - -/*! - * @brief This class represents the structure LoanableHelloWorld defined by the user in the IDL file. - * @ingroup LoanableHelloWorld - */ -class LoanableHelloWorld -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LoanableHelloWorld(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LoanableHelloWorld(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LoanableHelloWorld that will be copied. - */ - eProsima_user_DllExport LoanableHelloWorld( - const LoanableHelloWorld& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LoanableHelloWorld that will be copied. - */ - eProsima_user_DllExport LoanableHelloWorld( - LoanableHelloWorld&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LoanableHelloWorld that will be copied. - */ - eProsima_user_DllExport LoanableHelloWorld& operator =( - const LoanableHelloWorld& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LoanableHelloWorld that will be copied. - */ - eProsima_user_DllExport LoanableHelloWorld& operator =( - LoanableHelloWorld&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LoanableHelloWorld object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LoanableHelloWorld& x) const; - - /*! - * @brief Comparison operator. - * @param x LoanableHelloWorld object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LoanableHelloWorld& x) const; - - /*! - * @brief This function sets a value in member index - * @param _index New value for member index - */ - eProsima_user_DllExport void index( - uint32_t _index); - - /*! - * @brief This function returns the value of member index - * @return Value of member index - */ - eProsima_user_DllExport uint32_t index() const; - - /*! - * @brief This function returns a reference to member index - * @return Reference to member index - */ - 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 - */ - eProsima_user_DllExport void message( - const std::array& _message); - - /*! - * @brief This function moves the value in member message - * @param _message New value to be moved in member message - */ - eProsima_user_DllExport void message( - std::array&& _message); - - /*! - * @brief This function returns a constant reference to member message - * @return Constant reference to member message - */ - eProsima_user_DllExport const std::array& message() const; - - /*! - * @brief This function returns a reference to member message - * @return Reference to member message - */ - eProsima_user_DllExport std::array& 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 LoanableHelloWorld& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint32_t m_index; - std::array m_message; - -}; - - -#endif // _FAST_DDS_GENERATED_LOANABLEHELLOWORLD_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/include/fastdds/config.h.in b/include/fastdds/config.h.in index 7e28350c157..c92c08c9134 100644 --- a/include/fastdds/config.h.in +++ b/include/fastdds/config.h.in @@ -85,7 +85,7 @@ // Log Info #ifndef FASTDDS_ENFORCE_LOG_INFO #cmakedefine FASTDDS_ENFORCE_LOG_INFO -#endif +#endif // ifndef FASTDDS_ENFORCE_LOG_INFO #ifndef HAVE_LOG_NO_INFO #define HAVE_LOG_NO_INFO @HAVE_LOG_NO_INFO@ #endif /* ifndef HAVE_LOG_NO_INFO */ @@ -103,6 +103,10 @@ // Statistics #cmakedefine FASTDDS_STATISTICS +#ifndef __has_cpp_attribute +# define __has_cpp_attribute(x) 0 +#endif // ifndef __has_cpp_attribute + // Deprecated macro #if __cplusplus >= 201402L #define FASTDDS_DEPRECATED(msg) [[ deprecated(msg) ]] @@ -128,6 +132,6 @@ #define FASTDDS_SER_METHOD_DEPRECATED(major, entity_name, msg) FASTDDS_DEPRECATED_UNTIL(major, entity_name, msg) #else #define FASTDDS_SER_METHOD_DEPRECATED(major, entity_name, msg) -#endif +#endif // if FASTCDR_VERSION_MAJOR > 1 #endif // _FASTDDS_CONFIG_H_ diff --git a/include/fastdds/dds/builtin/typelookup/TypeLookupManager.hpp b/include/fastdds/dds/builtin/typelookup/TypeLookupManager.hpp deleted file mode 100644 index c6465905c80..00000000000 --- a/include/fastdds/dds/builtin/typelookup/TypeLookupManager.hpp +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright 2019 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 TypeLookupManager.hpp - * - */ - -#ifndef _FASTDDS_TYPELOOKUP_SERVICE_MANAGER_HPP -#define _FASTDDS_TYPELOOKUP_SERVICE_MANAGER_HPP -#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC - -#include -#include - -#include -#include -#include - -#include -#include - -namespace eprosima { -namespace fastrtps { - -namespace rtps { - -class BuiltinProtocols; -class ReaderHistory; -class RTPSParticipantImpl; -class StatefulReader; -class StatefulWriter; -class ParticipantProxyData; -class WriterHistory; - -} // namespace rtps -} // namespace fastrtps - -namespace fastdds { -namespace dds { -namespace builtin { - -extern const fastrtps::rtps::SampleIdentity INVALID_SAMPLE_IDENTITY; - -/** - * Class TypeLookupManager that implements the TypeLookup Service described in the DDS-XTYPES 1.2 specification. - * @ingroup XTYPES - */ -class TypeLookupManager -{ - friend class TypeLookupRequestListener; - friend class TypeLookupReplyListener; - -public: - - /** - * Constructor - * @param prot Pointer to the BuiltinProtocols object. - */ - TypeLookupManager( - fastrtps::rtps::BuiltinProtocols* prot); - - virtual ~TypeLookupManager(); - - /** - * Initialize the TypeLookupManager protocol. - * @param p Pointer to the RTPS participant implementation. - * @return true if the initialziacion was successful. - */ - bool init_typelookup_service( - fastrtps::rtps::RTPSParticipantImpl* p); - - /** - * Assign the remote endpoints for a newly discovered RTPSParticipant. - * @param pdata Pointer to the RTPSParticipantProxyData object. - * @return True if correct. - */ - bool assign_remote_endpoints( - const fastrtps::rtps::ParticipantProxyData& pdata); - - /** - * Remove remote endpoints from the typelookup service. - * @param pdata Pointer to the ParticipantProxyData to remove - */ - void remove_remote_endpoints( - fastrtps::rtps::ParticipantProxyData* pdata); - - /** - * Get the builtin protocols - * @return Builtin protocols - */ - fastrtps::rtps::BuiltinProtocols* get_builtin_protocols() - { - return builtin_protocols_; - } - - /** - * Get the builtin request writer - * @return stateful writer - */ - fastrtps::rtps::StatefulWriter* get_builtin_request_writer(); - - /** - * Get the builtin reply writer - * @return stateful writer - */ - fastrtps::rtps::StatefulWriter* get_builtin_reply_writer(); - - /** - * Get the builtin request writer's history - * @return writer history - */ - fastrtps::rtps::WriterHistory* get_builtin_request_writer_history(); - - /** - * Get the builtin reply writer's history - * @return writer history - */ - fastrtps::rtps::WriterHistory* get_builtin_reply_writer_history(); - - /** - * Get the builtin request reader - * @return stateful reader - */ - fastrtps::rtps::StatefulReader* get_builtin_request_reader(); - - /** - * Get the builtin reply reader - * @return stateful reader - */ - fastrtps::rtps::StatefulReader* get_builtin_reply_reader(); - - /** - * Get the builtin request reader's history - * @return reader history - */ - fastrtps::rtps::ReaderHistory* get_builtin_request_reader_history(); - - /** - * Get the builtin reply reader's history - * @return reader history - */ - fastrtps::rtps::ReaderHistory* get_builtin_reply_reader_history(); - - /* TODO Uncomment if security is implemented. - #if HAVE_SECURITY - bool pairing_remote_reader_with_local_writer_after_security( - const fastrtps::rtps::GUID_t& local_writer, - const fastrtps::rtps::ReaderProxyData& remote_reader_data); - - bool pairing_remote_writer_with_local_reader_after_security( - const fastrtps::rtps::GUID_t& local_reader, - const fastrtps::rtps::WriterProxyData& remote_writer_data); - #endif - */ - - fastrtps::rtps::SampleIdentity get_type_dependencies( - const fastrtps::types::TypeIdentifierSeq& in) const; - - fastrtps::rtps::SampleIdentity get_types( - const fastrtps::types::TypeIdentifierSeq& in) const; - -private: - - /** - * Create the endpoints used in the TypeLookupManager. - * @return true if correct. - */ - bool create_endpoints(); - - /** - * Get the RTPS participant - * @return RTPS participant - */ - inline fastrtps::rtps::RTPSParticipantImpl* get_RTPS_participant() - { - return participant_; - } - - //! Get out instanceName as defined in 7.6.2.3.4 of the XTypes 1.2 document - std::string get_instanceName() const; - - //! Aux method to send requests - bool send_request( - TypeLookup_Request& req) const; - - //! Aux method to send replies - bool send_reply( - TypeLookup_Reply& rep) const; - - //! Aux method to received requests - bool recv_request( - fastrtps::rtps::CacheChange_t& change, - TypeLookup_Request& req) const; - - //! Aux method to received replies - bool recv_reply( - fastrtps::rtps::CacheChange_t& change, - TypeLookup_Reply& rep) const; - - const fastrtps::rtps::GUID_t& get_builtin_request_writer_guid() const; - - //!Pointer to the local RTPSParticipant. - fastrtps::rtps::RTPSParticipantImpl* participant_; - - //!Pointer to the builtinprotocol class. - fastrtps::rtps::BuiltinProtocols* builtin_protocols_; - - //!Pointer to the builtinRTPSParticipantMEssageWriter. - fastrtps::rtps::StatefulWriter* builtin_request_writer_; - - //!Pointer to the builtinRTPSParticipantMEssageReader. - fastrtps::rtps::StatefulReader* builtin_request_reader_; - - //!Pointer to the builtinRTPSParticipantMEssageWriter. - fastrtps::rtps::StatefulWriter* builtin_reply_writer_; - - //!Pointer to the builtinRTPSParticipantMEssageReader. - fastrtps::rtps::StatefulReader* builtin_reply_reader_; - - //!Writer History - fastrtps::rtps::WriterHistory* builtin_request_writer_history_; - - //!Writer History - fastrtps::rtps::WriterHistory* builtin_reply_writer_history_; - - //!Reader History - fastrtps::rtps::ReaderHistory* builtin_request_reader_history_; - - //!Reader History - fastrtps::rtps::ReaderHistory* builtin_reply_reader_history_; - - //!Request Listener object. - TypeLookupRequestListener* request_listener_; - - //!Reply Listener object. - TypeLookupReplyListener* reply_listener_; - - std::mutex temp_data_lock_; - fastrtps::rtps::ReaderProxyData temp_reader_proxy_data_; - fastrtps::rtps::WriterProxyData temp_writer_proxy_data_; - - mutable fastrtps::rtps::SequenceNumber_t request_seq_number_; - - mutable TypeLookup_RequestTypeSupport request_type_; - - mutable TypeLookup_ReplyTypeSupport reply_type_; - - /* TODO Uncomment if security is implemented. - #if HAVE_SECURITY - //!Pointer to the builtinRTPSParticipantMEssageWriter. - fastrtps::rtps::StatefulWriter* builtin_request_writer_secure_; - - //!Pointer to the builtinRTPSParticipantMEssageWriter. - fastrtps::rtps::StatefulWriter* builtin_reply_writer_secure_; - - //!Pointer to the builtinRTPSParticipantMEssageReader. - fastrtps::rtps::StatefulReader* builtin_request_reader_secure_; - - //!Pointer to the builtinRTPSParticipantMEssageReader. - fastrtps::rtps::StatefulReader* builtin_reply_reader_secure_; - - //!Writer History - fastrtps::rtps::WriterHistory* builtin_request_writer_secure_history_; - - //!Writer History - fastrtps::rtps::WriterHistory* builtin_reply_writer_secure_history_; - - //!Reader History - fastrtps::rtps::ReaderHistory* builtin_request_reader_secure_history_; - - //!Reader History - fastrtps::rtps::ReaderHistory* builtin_reply_reader_secure_history_; - - bool create_secure_endpoints(); - #endif - */ - - void request_cache_change_acked( - fastrtps::rtps::CacheChange_t* change); - - void reply_cache_change_acked( - fastrtps::rtps::CacheChange_t* change); -}; - -} /* namespace builtin */ -} /* namespace dds */ -} /* namespace fastdds */ -} /* namespace eprosima */ -#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#endif /* _FASTDDS_TYPELOOKUP_SERVICE_MANAGER_HPP */ diff --git a/include/fastdds/dds/builtin/typelookup/common/TypeLookupTypes.hpp b/include/fastdds/dds/builtin/typelookup/common/TypeLookupTypes.hpp deleted file mode 100644 index 11d1ca42bf1..00000000000 --- a/include/fastdds/dds/builtin/typelookup/common/TypeLookupTypes.hpp +++ /dev/null @@ -1,650 +0,0 @@ -// Copyright 2019 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 TypeLookupTypes.hpp - * - */ - -#ifndef TYPELOOKUPTYPES_HPP -#define TYPELOOKUPTYPES_HPP - -#include -#include - -#include -#include -#include - -namespace eprosima { - -namespace fastcdr { -class Cdr; -} // namespace fastcdr - -namespace fastdds { -namespace dds { -namespace builtin { - -const int32_t TypeLookup_getTypes_Hash = static_cast(0xd35282d1); -const int32_t TypeLookup_getDependencies_Hash = static_cast(0x31fbaa35); - -struct TypeLookup_getTypes_In -{ - std::vector type_ids; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_In::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - FASTDDS_EXPORTED_API static size_t getCdrSerializedSize( - const TypeLookup_getTypes_In& data, - size_t current_alignment = 0); - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_In::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_In::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - FASTDDS_EXPORTED_API static bool isKeyDefined() - { - return false; - } - -}; - -struct TypeLookup_getTypes_Out -{ - std::vector types; - - std::vector complete_to_minimal; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Out::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - FASTDDS_EXPORTED_API static size_t getCdrSerializedSize( - const TypeLookup_getTypes_Out& data, - size_t current_alignment = 0); - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Out::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Out::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - FASTDDS_EXPORTED_API static bool isKeyDefined() - { - return false; - } - -}; - -class TypeLookup_getTypes_Result -{ -public: - - FASTDDS_EXPORTED_API TypeLookup_getTypes_Result(); - - FASTDDS_EXPORTED_API ~TypeLookup_getTypes_Result(); - - FASTDDS_EXPORTED_API TypeLookup_getTypes_Result( - const TypeLookup_getTypes_Result& x); - - FASTDDS_EXPORTED_API TypeLookup_getTypes_Result( - TypeLookup_getTypes_Result&& x); - - FASTDDS_EXPORTED_API TypeLookup_getTypes_Result& operator =( - const TypeLookup_getTypes_Result& x); - - FASTDDS_EXPORTED_API TypeLookup_getTypes_Result& operator =( - TypeLookup_getTypes_Result&& x); - - FASTDDS_EXPORTED_API void _d( - int32_t __d); - - FASTDDS_EXPORTED_API int32_t _d() const; - - FASTDDS_EXPORTED_API int32_t& _d(); - - FASTDDS_EXPORTED_API void result( - const TypeLookup_getTypes_Out& _result); - - FASTDDS_EXPORTED_API void result( - TypeLookup_getTypes_Out&& _result); - - FASTDDS_EXPORTED_API const TypeLookup_getTypes_Out& result() const; - - FASTDDS_EXPORTED_API TypeLookup_getTypes_Out& result(); - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, - "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Result::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - FASTDDS_EXPORTED_API static size_t getCdrSerializedSize( - const TypeLookup_getTypes_Result& data, - size_t current_alignment = 0); - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Result::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypes_Result::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - FASTDDS_EXPORTED_API static bool isKeyDefined() - { - return false; - } - -private: - - int32_t m__d; - TypeLookup_getTypes_Out m_result; -}; - -class TypeLookup_getTypeDependencies_In -{ -public: - - std::vector type_ids; - - std::vector continuation_point; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, - "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_In::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - FASTDDS_EXPORTED_API static size_t getCdrSerializedSize( - const TypeLookup_getTypeDependencies_In& data, - size_t current_alignment = 0); - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_In::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_SER_METHOD_DEPRECATED(3, - "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_In::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - FASTDDS_EXPORTED_API static bool isKeyDefined() - { - return false; - } - -}; - -class TypeLookup_getTypeDependencies_Out -{ -public: - - std::vector dependent_typeids; - - std::vector continuation_point; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, - "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Out::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - FASTDDS_EXPORTED_API static size_t getCdrSerializedSize( - const TypeLookup_getTypeDependencies_Out& data, - size_t current_alignment = 0); - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Out::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_SER_METHOD_DEPRECATED(3, - "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Out::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - FASTDDS_EXPORTED_API static bool isKeyDefined() - { - return false; - } - -}; - -class TypeLookup_getTypeDependencies_Result -{ -public: - - FASTDDS_EXPORTED_API TypeLookup_getTypeDependencies_Result(); - - FASTDDS_EXPORTED_API ~TypeLookup_getTypeDependencies_Result(); - - FASTDDS_EXPORTED_API TypeLookup_getTypeDependencies_Result( - const TypeLookup_getTypeDependencies_Result& x); - - FASTDDS_EXPORTED_API TypeLookup_getTypeDependencies_Result( - TypeLookup_getTypeDependencies_Result&& x); - - FASTDDS_EXPORTED_API TypeLookup_getTypeDependencies_Result& operator =( - const TypeLookup_getTypeDependencies_Result& x); - - FASTDDS_EXPORTED_API TypeLookup_getTypeDependencies_Result& operator =( - TypeLookup_getTypeDependencies_Result&& x); - - FASTDDS_EXPORTED_API void _d( - int32_t __d); - - FASTDDS_EXPORTED_API int32_t _d() const; - - FASTDDS_EXPORTED_API int32_t& _d(); - - FASTDDS_EXPORTED_API void result( - const TypeLookup_getTypeDependencies_Out& _result); - - FASTDDS_EXPORTED_API void result( - TypeLookup_getTypeDependencies_Out&& _result); - - FASTDDS_EXPORTED_API const TypeLookup_getTypeDependencies_Out& result() const; - - FASTDDS_EXPORTED_API TypeLookup_getTypeDependencies_Out& result(); - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, - "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Result::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - FASTDDS_EXPORTED_API static size_t getCdrSerializedSize( - const TypeLookup_getTypeDependencies_Result& data, - size_t current_alignment = 0); - - FASTDDS_SER_METHOD_DEPRECATED(3, - "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Result::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_SER_METHOD_DEPRECATED(3, - "eprosima::fastdds::dds::builtin::TypeLookup_getTypeDependencies_Result::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - FASTDDS_EXPORTED_API static bool isKeyDefined() - { - return false; - } - -private: - - int32_t m__d; - - TypeLookup_getTypeDependencies_Out m_result; -}; -class TypeLookup_Call -{ -public: - - FASTDDS_EXPORTED_API TypeLookup_Call(); - - FASTDDS_EXPORTED_API ~TypeLookup_Call(); - - FASTDDS_EXPORTED_API TypeLookup_Call( - const TypeLookup_Call& x); - - FASTDDS_EXPORTED_API TypeLookup_Call( - TypeLookup_Call&& x); - - FASTDDS_EXPORTED_API TypeLookup_Call& operator =( - const TypeLookup_Call& x); - - FASTDDS_EXPORTED_API TypeLookup_Call& operator =( - TypeLookup_Call&& x); - - FASTDDS_EXPORTED_API void _d( - int32_t __d); - - FASTDDS_EXPORTED_API int32_t _d() const; - - FASTDDS_EXPORTED_API int32_t& _d(); - - FASTDDS_EXPORTED_API void getTypes( - const TypeLookup_getTypes_In& _getTypes); - - FASTDDS_EXPORTED_API void getTypes( - TypeLookup_getTypes_In&& _getTypes); - - FASTDDS_EXPORTED_API const TypeLookup_getTypes_In& getTypes() const; - - FASTDDS_EXPORTED_API TypeLookup_getTypes_In& getTypes(); - - FASTDDS_EXPORTED_API void getTypeDependencies( - const TypeLookup_getTypeDependencies_In& _getTypeDependencies); - - FASTDDS_EXPORTED_API void getTypeDependencies( - TypeLookup_getTypeDependencies_In&& _getTypeDependencies); - - FASTDDS_EXPORTED_API const TypeLookup_getTypeDependencies_In& getTypeDependencies() const; - - FASTDDS_EXPORTED_API TypeLookup_getTypeDependencies_In& getTypeDependencies(); - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Call::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - FASTDDS_EXPORTED_API static size_t getCdrSerializedSize( - const TypeLookup_Call& data, - size_t current_alignment = 0); - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Call::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Call::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - FASTDDS_EXPORTED_API static bool isKeyDefined() - { - return false; - } - -private: - - int32_t m__d; - - TypeLookup_getTypes_In m_getTypes; - TypeLookup_getTypeDependencies_In m_getTypeDependencies; -}; - -class TypeLookup_Request -{ -public: - - rpc::RequestHeader header; - - TypeLookup_Call data; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Request::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - FASTDDS_EXPORTED_API static size_t getCdrSerializedSize( - const TypeLookup_Request& data, - size_t current_alignment = 0); - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Request::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Request::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - FASTDDS_EXPORTED_API static bool isKeyDefined() - { - return false; - } - -}; - -class TypeLookup_Return -{ -public: - - FASTDDS_EXPORTED_API TypeLookup_Return(); - - FASTDDS_EXPORTED_API ~TypeLookup_Return(); - - FASTDDS_EXPORTED_API TypeLookup_Return( - const TypeLookup_Return& x); - - FASTDDS_EXPORTED_API TypeLookup_Return( - TypeLookup_Return&& x); - - FASTDDS_EXPORTED_API TypeLookup_Return& operator =( - const TypeLookup_Return& x); - - FASTDDS_EXPORTED_API TypeLookup_Return& operator =( - TypeLookup_Return&& x); - - FASTDDS_EXPORTED_API void _d( - int32_t __d); - - FASTDDS_EXPORTED_API int32_t _d() const; - - FASTDDS_EXPORTED_API int32_t& _d(); - - FASTDDS_EXPORTED_API void getType( - const TypeLookup_getTypes_Result& _getType); - - FASTDDS_EXPORTED_API void getType( - TypeLookup_getTypes_Result&& _getType); - - FASTDDS_EXPORTED_API const TypeLookup_getTypes_Result& getType() const; - - FASTDDS_EXPORTED_API TypeLookup_getTypes_Result& getType(); - - FASTDDS_EXPORTED_API void getTypeDependencies( - const TypeLookup_getTypeDependencies_Result& _getTypeDependencies); - - FASTDDS_EXPORTED_API void getTypeDependencies( - TypeLookup_getTypeDependencies_Result&& _getTypeDependencies); - - FASTDDS_EXPORTED_API const TypeLookup_getTypeDependencies_Result& getTypeDependencies() const; - - FASTDDS_EXPORTED_API TypeLookup_getTypeDependencies_Result& getTypeDependencies(); - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Return::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - FASTDDS_EXPORTED_API static size_t getCdrSerializedSize( - const TypeLookup_Return& data, - size_t current_alignment = 0); - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Return::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Return::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - FASTDDS_EXPORTED_API static bool isKeyDefined() - { - return false; - } - -private: - - int32_t m__d; - - TypeLookup_getTypes_Result m_getType; - TypeLookup_getTypeDependencies_Result m_getTypeDependencies; -}; - -class TypeLookup_Reply -{ -public: - - rpc::RequestHeader header; - - TypeLookup_Return return_value; - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Reply::getCdrSerializedSize()", - "In favor of version using eprosima::fastcdr::calculate_serialized_size.") - FASTDDS_EXPORTED_API static size_t getCdrSerializedSize( - const TypeLookup_Reply& data, - size_t current_alignment = 0); - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Reply::serialize()", - "In favor of version using eprosima::fastcdr::serialize.") - FASTDDS_EXPORTED_API void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_SER_METHOD_DEPRECATED(3, "eprosima::fastdds::dds::builtin::TypeLookup_Reply::deserialize()", - "In favor of version using eprosima::fastcdr::deserialize.") - FASTDDS_EXPORTED_API void deserialize( - eprosima::fastcdr::Cdr& cdr); -#endif // DOXYGEN_SHOULD_SKIP_THIS - - FASTDDS_EXPORTED_API static bool isKeyDefined() - { - return false; - } - -}; - -// TypeSupports -class TypeLookup_RequestPubSubType : public TopicDataType -{ -public: - - TypeLookup_RequestPubSubType(); - - virtual ~TypeLookup_RequestPubSubType() override; - - bool serialize( - void* data, - fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - } - - bool serialize( - void* data, - fastrtps::rtps::SerializedPayload_t* payload, - fastdds::dds::DataRepresentationId_t data_representation) override; - - bool deserialize( - fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - void* createData() override; - - void deleteData( - void* data) override; -}; - -class TypeLookup_ReplyPubSubType : public TopicDataType -{ -public: - - TypeLookup_ReplyPubSubType(); - - virtual ~TypeLookup_ReplyPubSubType() override; - - bool serialize( - void* data, - fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - } - - bool serialize( - void* data, - fastrtps::rtps::SerializedPayload_t* payload, - fastdds::dds::DataRepresentationId_t data_representation) override; - - bool deserialize( - fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - void* createData() override; - - void deleteData( - void* data) override; -}; - -class TypeLookup_RequestTypeSupport : public TypeSupport -{ -public: - - FASTDDS_EXPORTED_API bool serialize( - void* data, - fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - } - - FASTDDS_EXPORTED_API bool serialize( - void* data, - fastrtps::rtps::SerializedPayload_t* payload, - fastdds::dds::DataRepresentationId_t data_representation) override; - - FASTDDS_EXPORTED_API bool deserialize( - fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - FASTDDS_EXPORTED_API void* create_data() override; - - FASTDDS_EXPORTED_API void delete_data( - void* data) override; -}; - -class TypeLookup_ReplyTypeSupport : public TypeSupport -{ -public: - - FASTDDS_EXPORTED_API bool serialize( - void* data, - fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, fastdds::dds::DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - } - - FASTDDS_EXPORTED_API bool serialize( - void* data, - fastrtps::rtps::SerializedPayload_t* payload, - fastdds::dds::DataRepresentationId_t data_representation) override; - - FASTDDS_EXPORTED_API bool deserialize( - fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - FASTDDS_EXPORTED_API void* create_data() override; - - FASTDDS_EXPORTED_API void delete_data( - void* data) override; -}; - - -} // namespace builtin -} // namespace dds -} // namespace fastdds -} // namespace eprosima - -#endif // TYPELOOKUPTYPES_HPP diff --git a/include/fastdds/dds/core/Entity.hpp b/include/fastdds/dds/core/Entity.hpp index 46ed24065db..c1d22d9269e 100644 --- a/include/fastdds/dds/core/Entity.hpp +++ b/include/fastdds/dds/core/Entity.hpp @@ -22,8 +22,8 @@ #include #include +#include #include -#include namespace eprosima { namespace fastdds { @@ -56,10 +56,10 @@ class Entity * * @return RETCODE_OK */ - virtual fastrtps::types::ReturnCode_t enable() + virtual ReturnCode_t enable() { enable_ = true; - return fastrtps::types::ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } /** diff --git a/include/fastdds/dds/core/ReturnCode.hpp b/include/fastdds/dds/core/ReturnCode.hpp new file mode 100644 index 00000000000..607e091c670 --- /dev/null +++ b/include/fastdds/dds/core/ReturnCode.hpp @@ -0,0 +1,26 @@ +// Copyright 2023 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 ReturnCode.hpp + */ + +#ifndef _FASTDDS_DDS_CORE_RETURNCODE_HPP_ +#define _FASTDDS_DDS_CORE_RETURNCODE_HPP_ + +#include "detail/DDSReturnCode.hpp" +#include "detail/DDSSecurityReturnCode.hpp" + +#endif // _FASTDDS_DDS_CORE_RETURNCODE_HPP_ + diff --git a/include/fastdds/dds/builtin/common/RequestHeader.hpp b/include/fastdds/dds/core/Types.hpp similarity index 55% rename from include/fastdds/dds/builtin/common/RequestHeader.hpp rename to include/fastdds/dds/core/Types.hpp index 09fee20c92e..8f24af6545b 100644 --- a/include/fastdds/dds/builtin/common/RequestHeader.hpp +++ b/include/fastdds/dds/core/Types.hpp @@ -1,4 +1,4 @@ -// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// Copyright 2023 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. @@ -12,43 +12,21 @@ // See the License for the specific language governing permissions and // limitations under the License. -/** - * @file RequestHeader.hpp - * - */ +#ifndef FASTDDS_DDS_CORE_TYPES_HPP +#define FASTDDS_DDS_CORE_TYPES_HPP -#ifndef REQUESTHEADER_HPP -#define REQUESTHEADER_HPP - -#include -#include +#include namespace eprosima { - -namespace fastcdr { -class Cdr; -} // fastcdr - namespace fastdds { namespace dds { -namespace rpc { - -struct RequestHeader -{ - eprosima::fastrtps::rtps::SampleIdentity requestId; - - InstanceName instanceName; - FASTDDS_EXPORTED_API static bool isKeyDefined() - { - return false; - } +typedef uint32_t DomainId_t; -}; +const int32_t LENGTH_UNLIMITED = -1; -} // namespace rpc } // namespace dds } // namespace fastdds } // namespace eprosima -#endif // REQUESTHEADER_HPP +#endif // FASTDDS_DDS_CORE_TYPES_HPP diff --git a/include/fastdds/dds/core/condition/GuardCondition.hpp b/include/fastdds/dds/core/condition/GuardCondition.hpp index 27f81989091..e4329556a6b 100644 --- a/include/fastdds/dds/core/condition/GuardCondition.hpp +++ b/include/fastdds/dds/core/condition/GuardCondition.hpp @@ -23,10 +23,8 @@ #include #include +#include #include -#include - -using eprosima::fastrtps::types::ReturnCode_t; namespace eprosima { namespace fastdds { diff --git a/include/fastdds/dds/core/condition/StatusCondition.hpp b/include/fastdds/dds/core/condition/StatusCondition.hpp index 3335de5ad32..a3d1b1ca285 100644 --- a/include/fastdds/dds/core/condition/StatusCondition.hpp +++ b/include/fastdds/dds/core/condition/StatusCondition.hpp @@ -21,11 +21,9 @@ #define _FASTDDS_STATUS_CONDITION_HPP_ #include +#include #include #include -#include - -using eprosima::fastrtps::types::ReturnCode_t; namespace eprosima { namespace fastdds { diff --git a/include/fastdds/dds/core/condition/WaitSet.hpp b/include/fastdds/dds/core/condition/WaitSet.hpp index 6b805d0bf04..367fd591ce2 100644 --- a/include/fastdds/dds/core/condition/WaitSet.hpp +++ b/include/fastdds/dds/core/condition/WaitSet.hpp @@ -23,11 +23,9 @@ #include #include +#include #include #include -#include - -using eprosima::fastrtps::types::ReturnCode_t; namespace eprosima { namespace fastdds { diff --git a/test/blackbox/types/TestIncludeRegression3361.h b/include/fastdds/dds/core/detail/DDSReturnCode.hpp similarity index 52% rename from test/blackbox/types/TestIncludeRegression3361.h rename to include/fastdds/dds/core/detail/DDSReturnCode.hpp index 9f0c54030ed..24c32e8e8e8 100644 --- a/test/blackbox/types/TestIncludeRegression3361.h +++ b/include/fastdds/dds/core/detail/DDSReturnCode.hpp @@ -13,32 +13,17 @@ // limitations under the License. /*! - * @file TestIncludeRegression3361.h + * @file DDSReturnCode.hpp * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool fastddsgen. */ -#include -#include "TestIncludeRegression3361v1.h" +#ifndef _FAST_DDS_GENERATED_DDSRETURNCODE_HPP_ +#define _FAST_DDS_GENERATED_DDSRETURNCODE_HPP_ -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_TESTINCLUDEREGRESSION3361_H_ -#define _FAST_DDS_GENERATED_TESTINCLUDEREGRESSION3361_H_ - -#include -#include #include -#include -#include -#include - -#include -#include -#include - - +#include #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) @@ -52,36 +37,48 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TESTINCLUDEREGRESSION3361_SOURCE) -#define TESTINCLUDEREGRESSION3361_DllAPI __declspec( dllexport ) +#if defined(DDSRETURNCODE_SOURCE) +#define DDSRETURNCODE_DllAPI __declspec( dllexport ) #else -#define TESTINCLUDEREGRESSION3361_DllAPI __declspec( dllimport ) -#endif // TESTINCLUDEREGRESSION3361_SOURCE +#define DDSRETURNCODE_DllAPI __declspec( dllimport ) +#endif // DDSRETURNCODE_SOURCE #else -#define TESTINCLUDEREGRESSION3361_DllAPI +#define DDSRETURNCODE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define TESTINCLUDEREGRESSION3361_DllAPI +#define DDSRETURNCODE_DllAPI #endif // _WIN32 namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima +namespace fastdds { + +namespace dds { -namespace TestModule { +typedef int32_t ReturnCode_t; -typedef std::string MACHINEID; +const ReturnCode_t RETCODE_OK = 0; +const ReturnCode_t RETCODE_ERROR = 1; +const ReturnCode_t RETCODE_UNSUPPORTED = 2; +const ReturnCode_t RETCODE_BAD_PARAMETER = 3; +const ReturnCode_t RETCODE_PRECONDITION_NOT_MET = 4; +const ReturnCode_t RETCODE_OUT_OF_RESOURCES = 5; +const ReturnCode_t RETCODE_NOT_ENABLED = 6; +const ReturnCode_t RETCODE_IMMUTABLE_POLICY = 7; +const ReturnCode_t RETCODE_INCONSISTENT_POLICY = 8; +const ReturnCode_t RETCODE_ALREADY_DELETED = 9; +const ReturnCode_t RETCODE_TIMEOUT = 10; +const ReturnCode_t RETCODE_NO_DATA = 11; +const ReturnCode_t RETCODE_ILLEGAL_OPERATION = 12; +} // namespace dds -} // namespace TestModule +} // namespace fastdds + +} // namespace eprosima -#endif // _FAST_DDS_GENERATED_TESTINCLUDEREGRESSION3361_H_ +#endif // _FAST_DDS_GENERATED_DDSRETURNCODE_HPP_ -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/include/fastdds/dds/core/detail/DDSReturnCode.idl b/include/fastdds/dds/core/detail/DDSReturnCode.idl new file mode 100644 index 00000000000..0d286676f0c --- /dev/null +++ b/include/fastdds/dds/core/detail/DDSReturnCode.idl @@ -0,0 +1,25 @@ +// The content of this file, related to the DDS's return code values, was extracted from the omg idl +// https://www.omg.org/spec/DDS/20140501/dds_dcps.idl + +module DDS { + + typedef long ReturnCode_t; + + // ---------------------------------------------------------------------- + // Return codes + // ---------------------------------------------------------------------- + const ReturnCode_t RETCODE_OK = 0; + const ReturnCode_t RETCODE_ERROR = 1; + const ReturnCode_t RETCODE_UNSUPPORTED = 2; + const ReturnCode_t RETCODE_BAD_PARAMETER = 3; + const ReturnCode_t RETCODE_PRECONDITION_NOT_MET = 4; + const ReturnCode_t RETCODE_OUT_OF_RESOURCES = 5; + const ReturnCode_t RETCODE_NOT_ENABLED = 6; + const ReturnCode_t RETCODE_IMMUTABLE_POLICY = 7; + const ReturnCode_t RETCODE_INCONSISTENT_POLICY = 8; + const ReturnCode_t RETCODE_ALREADY_DELETED = 9; + const ReturnCode_t RETCODE_TIMEOUT = 10; + const ReturnCode_t RETCODE_NO_DATA = 11; + const ReturnCode_t RETCODE_ILLEGAL_OPERATION = 12; + +}; diff --git a/test/blackbox/types/HelloWorldTypeObject.h b/include/fastdds/dds/core/detail/DDSSecurityReturnCode.hpp similarity index 55% rename from test/blackbox/types/HelloWorldTypeObject.h rename to include/fastdds/dds/core/detail/DDSSecurityReturnCode.hpp index 76b2a621eb7..36955743934 100644 --- a/test/blackbox/types/HelloWorldTypeObject.h +++ b/include/fastdds/dds/core/detail/DDSSecurityReturnCode.hpp @@ -13,53 +13,59 @@ // limitations under the License. /*! - * @file HelloWorldTypeObject.h + * @file DDSSecurityReturnCode.hpp * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool fastddsgen. */ -#ifndef _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_H_ -#define _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_H_ +#ifndef _FAST_DDS_GENERATED_DDSSECURITYRETURNCODE_HPP_ +#define _FAST_DDS_GENERATED_DDSSECURITYRETURNCODE_HPP_ - -#include -#include +#include +#include +#include "DDSReturnCode.hpp" #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) #define eProsima_user_DllExport __declspec( dllexport ) #else #define eProsima_user_DllExport -#endif +#endif // EPROSIMA_USER_DLL_EXPORT #else #define eProsima_user_DllExport -#endif +#endif // _WIN32 #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(HelloWorld_SOURCE) -#define HelloWorld_DllAPI __declspec( dllexport ) +#if defined(DDSSECURITYRETURNCODE_SOURCE) +#define DDSSECURITYRETURNCODE_DllAPI __declspec( dllexport ) #else -#define HelloWorld_DllAPI __declspec( dllimport ) -#endif // HelloWorld_SOURCE +#define DDSSECURITYRETURNCODE_DllAPI __declspec( dllimport ) +#endif // DDSSECURITYRETURNCODE_SOURCE #else -#define HelloWorld_DllAPI -#endif +#define DDSSECURITYRETURNCODE_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT #else -#define HelloWorld_DllAPI +#define DDSSECURITYRETURNCODE_DllAPI #endif // _WIN32 -using namespace eprosima::fastrtps::types; +namespace eprosima { + +namespace fastdds { + +namespace dds { + + +const ReturnCode_t RETCODE_NOT_ALLOWED_BY_SECURITY = 1000; + +} // namespace dds -eProsima_user_DllExport void registerHelloWorldTypes(); +} // namespace fastdds +} // namespace eprosima -eProsima_user_DllExport const TypeIdentifier* GetHelloWorldIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetHelloWorldObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalHelloWorldObject(); -eProsima_user_DllExport const TypeObject* GetCompleteHelloWorldObject(); +#endif // _FAST_DDS_GENERATED_DDSSECURITYRETURNCODE_HPP_ -#endif // _FAST_DDS_GENERATED_HELLOWORLD_TYPE_OBJECT_H_ \ No newline at end of file diff --git a/include/fastdds/dds/core/detail/DDSSecurityReturnCode.idl b/include/fastdds/dds/core/detail/DDSSecurityReturnCode.idl new file mode 100644 index 00000000000..3248239741c --- /dev/null +++ b/include/fastdds/dds/core/detail/DDSSecurityReturnCode.idl @@ -0,0 +1,10 @@ +// The content of this file, related to the DDS Security's return code values, was extracted from the omg idl +// https://www.omg.org/spec/DDS-SECURITY/20170901/dds_security_plugins_spis.idl +#include "DDSReturnCode.idl" + +module DDS { + + // DDSSEC11-24 + const ReturnCode_t RETCODE_NOT_ALLOWED_BY_SECURITY = 1000; + +}; diff --git a/include/fastdds/dds/core/policy/QosPolicies.hpp b/include/fastdds/dds/core/policy/QosPolicies.hpp index cd9eeb7ce11..bd4b0e3563d 100644 --- a/include/fastdds/dds/core/policy/QosPolicies.hpp +++ b/include/fastdds/dds/core/policy/QosPolicies.hpp @@ -20,9 +20,12 @@ #ifndef _FASTDDS_DDS_QOS_QOSPOLICIES_HPP_ #define _FASTDDS_DDS_QOS_QOSPOLICIES_HPP_ +#include #include #include +#include +#include #include #include #include @@ -35,7 +38,6 @@ #include #include -#include #include namespace eprosima { @@ -1712,9 +1714,6 @@ class HistoryQosPolicy : public Parameter_t, public QosPolicy int32_t depth; }; -//! A special value indicating an unlimited quantity -constexpr int32_t LENGTH_UNLIMITED = -1; - /** * Specifies the resources that the Service can consume in order to meet the requested QoS * @@ -2292,7 +2291,7 @@ class TypeIdV1 : public Parameter_t, public QosPolicy public: //!Type Identifier - fastrtps::types::TypeIdentifier m_type_identifier; + xtypes::TypeIdentifier m_type_identifier; /** @@ -2324,7 +2323,7 @@ class TypeIdV1 : public Parameter_t, public QosPolicy * @param identifier TypeIdentifier to be set */ FASTDDS_EXPORTED_API TypeIdV1( - const fastrtps::types::TypeIdentifier& identifier) + const xtypes::TypeIdentifier& identifier) : Parameter_t(PID_TYPE_IDV1, 0) , QosPolicy(false) , m_type_identifier(identifier) @@ -2379,7 +2378,7 @@ class TypeIdV1 : public Parameter_t, public QosPolicy } FASTDDS_EXPORTED_API TypeIdV1& operator =( - const fastrtps::types::TypeIdentifier& type_id) + const xtypes::TypeIdentifier& type_id) { m_type_identifier = type_id; return *this; @@ -2390,7 +2389,7 @@ class TypeIdV1 : public Parameter_t, public QosPolicy * * @return TypeIdentifier reference */ - FASTDDS_EXPORTED_API const fastrtps::types::TypeIdentifier& get() const + FASTDDS_EXPORTED_API const xtypes::TypeIdentifier& get() const { return m_type_identifier; } @@ -2405,7 +2404,7 @@ class TypeObjectV1 : public Parameter_t, public QosPolicy public: //!Type Object - fastrtps::types::TypeObject m_type_object; + xtypes::TypeObject m_type_object; /** * @brief Constructor @@ -2436,7 +2435,7 @@ class TypeObjectV1 : public Parameter_t, public QosPolicy * @param type TypeObject to be set */ FASTDDS_EXPORTED_API TypeObjectV1( - const fastrtps::types::TypeObject& type) + const xtypes::TypeObject& type) : Parameter_t(PID_TYPE_OBJECTV1, 0) , QosPolicy(false) , m_type_object(type) @@ -2491,7 +2490,7 @@ class TypeObjectV1 : public Parameter_t, public QosPolicy } FASTDDS_EXPORTED_API TypeObjectV1& operator =( - const fastrtps::types::TypeObject& type_object) + const xtypes::TypeObject& type_object) { m_type_object = type_object; return *this; @@ -2502,7 +2501,7 @@ class TypeObjectV1 : public Parameter_t, public QosPolicy * * @return TypeObject reference */ - FASTDDS_EXPORTED_API const fastrtps::types::TypeObject& get() const + FASTDDS_EXPORTED_API const xtypes::TypeObject& get() const { return m_type_object; } @@ -2512,19 +2511,19 @@ class TypeObjectV1 : public Parameter_t, public QosPolicy namespace xtypes { /** - * Class xtypes::TypeInformation + * Class xtypes::TypeInformationParameter */ -class TypeInformation : public Parameter_t, public QosPolicy +class TypeInformationParameter : public Parameter_t, public QosPolicy { public: //!Type Information - fastrtps::types::TypeInformation type_information; + eprosima::fastdds::dds::xtypes::TypeInformation type_information; /** * @brief Constructor */ - FASTDDS_EXPORTED_API TypeInformation() + FASTDDS_EXPORTED_API TypeInformationParameter() : Parameter_t(PID_TYPE_INFORMATION, 0) , QosPolicy(false) , type_information() @@ -2535,10 +2534,10 @@ class TypeInformation : public Parameter_t, public QosPolicy /** * @brief Copy constructor * - * @param type Another instance of TypeInformation + * @param type Another instance of TypeInformationParameter */ - FASTDDS_EXPORTED_API TypeInformation( - const TypeInformation& type) + FASTDDS_EXPORTED_API TypeInformationParameter( + const TypeInformationParameter& type) : Parameter_t(type.Pid, type.length) , QosPolicy(type.send_always_) , type_information(type.type_information) @@ -2547,12 +2546,12 @@ class TypeInformation : public Parameter_t, public QosPolicy } /** - * @brief Constructor using a fastrtps::types::TypeInformation + * @brief Constructor using a TypeInformation * - * @param info fastrtps::types::TypeInformation to be set + * @param info TypeInformation to be set */ - FASTDDS_EXPORTED_API TypeInformation( - const fastrtps::types::TypeInformation& info) + FASTDDS_EXPORTED_API TypeInformationParameter( + const eprosima::fastdds::dds::xtypes::TypeInformation& info) : Parameter_t(PID_TYPE_INFORMATION, 0) , QosPolicy(false) , type_information(info) @@ -2563,10 +2562,10 @@ class TypeInformation : public Parameter_t, public QosPolicy /** * @brief Move Constructor * - * @param type Another instance of TypeInformation + * @param type Another instance of TypeInformationParameter */ - FASTDDS_EXPORTED_API TypeInformation( - TypeInformation&& type) + FASTDDS_EXPORTED_API TypeInformationParameter( + TypeInformationParameter&& type) : Parameter_t(type.Pid, type.length) , QosPolicy(type.send_always_) , type_information(std::move(type.type_information)) @@ -2574,8 +2573,8 @@ class TypeInformation : public Parameter_t, public QosPolicy { } - FASTDDS_EXPORTED_API TypeInformation& operator =( - const TypeInformation& type) + FASTDDS_EXPORTED_API TypeInformationParameter& operator =( + const TypeInformationParameter& type) { Pid = type.Pid; length = type.length; @@ -2587,8 +2586,8 @@ class TypeInformation : public Parameter_t, public QosPolicy return *this; } - FASTDDS_EXPORTED_API TypeInformation& operator =( - TypeInformation&& type) + FASTDDS_EXPORTED_API TypeInformationParameter& operator =( + TypeInformationParameter&& type) { Pid = type.Pid; length = type.length; @@ -2603,11 +2602,11 @@ class TypeInformation : public Parameter_t, public QosPolicy /** * @brief Destructor */ - virtual FASTDDS_EXPORTED_API ~TypeInformation() override = default; + virtual FASTDDS_EXPORTED_API ~TypeInformationParameter() override = default; inline void clear() override { - *this = TypeInformation(); + *this = TypeInformationParameter(); } /** @@ -2631,8 +2630,8 @@ class TypeInformation : public Parameter_t, public QosPolicy assigned_ = value; } - FASTDDS_EXPORTED_API TypeInformation& operator =( - const fastrtps::types::TypeInformation& type_info) + FASTDDS_EXPORTED_API TypeInformationParameter& operator =( + const TypeInformation& type_info) { type_information = type_info; assigned_ = true; @@ -2641,7 +2640,7 @@ class TypeInformation : public Parameter_t, public QosPolicy private: - //!Boolean that states if the TypeInformation has been asigned manually or not. + //!Boolean that states if the TypeInformationParameter has been asigned manually or not. bool assigned_; }; diff --git a/include/fastdds/dds/domain/DomainParticipant.hpp b/include/fastdds/dds/domain/DomainParticipant.hpp index 3e8b5a00a67..8ca6db4463d 100644 --- a/include/fastdds/dds/domain/DomainParticipant.hpp +++ b/include/fastdds/dds/domain/DomainParticipant.hpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -40,10 +41,6 @@ #include #include #include -#include -#include - -using eprosima::fastrtps::types::ReturnCode_t; namespace dds { namespace domain { @@ -56,11 +53,6 @@ namespace fastrtps { namespace rtps { class ResourceEvent; } // namespace rtps - -namespace types { -class TypeInformation; -} // namespace types - } //namespace fastrtps namespace fastdds { @@ -847,49 +839,6 @@ class DomainParticipant : public Entity */ FASTDDS_EXPORTED_API fastrtps::rtps::ResourceEvent& get_resource_event() const; - /** - * When a DomainParticipant receives an incomplete list of TypeIdentifiers in a - * PublicationBuiltinTopicData or SubscriptionBuiltinTopicData, it may request the additional type - * dependencies by invoking the getTypeDependencies operation. - * - * @param in TypeIdentifier sequence - * @return SampleIdentity - */ - FASTDDS_EXPORTED_API fastrtps::rtps::SampleIdentity get_type_dependencies( - const fastrtps::types::TypeIdentifierSeq& in) const; - - /** - * A DomainParticipant may invoke the operation getTypes to retrieve the TypeObjects associated with a - * list of TypeIdentifiers. - * - * @param in TypeIdentifier sequence - * @return SampleIdentity - */ - FASTDDS_EXPORTED_API fastrtps::rtps::SampleIdentity get_types( - const fastrtps::types::TypeIdentifierSeq& in) const; - - /** - * Helps the user to solve all dependencies calling internally to the type lookup service and - * registers the resulting dynamic type. - * The registration may be perform asynchronously, case in which the user will be notified - * through the given callback, which receives the type_name as unique argument. - * - * @param type_information - * @param type_name - * @param callback - * @return RETCODE_OK If the given type_information is enough to build the type without using - * the typelookup service (callback will not be called). - * @return RETCODE_OK if the given type is already available (callback will not be called). - * @return RETCODE_NO_DATA if type is not available yet (the callback will be called if - * negotiation is success, and ignored in other case). - * @return RETCODE_NOT_ENABLED if the DomainParticipant is not enabled. - * @return RETCODE_PRECONDITION_NOT_MET if the DomainParticipant type lookup service is disabled. - */ - FASTDDS_EXPORTED_API ReturnCode_t register_remote_type( - const fastrtps::types::TypeInformation& type_information, - const std::string& type_name, - std::function& callback); - /** * Register a custom content filter factory, which can be used to create a ContentFilteredTopic. * diff --git a/include/fastdds/dds/domain/DomainParticipantFactory.hpp b/include/fastdds/dds/domain/DomainParticipantFactory.hpp index a222cca44b3..09df4a26027 100644 --- a/include/fastdds/dds/domain/DomainParticipantFactory.hpp +++ b/include/fastdds/dds/domain/DomainParticipantFactory.hpp @@ -17,21 +17,20 @@ * */ -#ifndef _FASTDDS_DOMAINPARTICIPANT_HPP_ -#define _FASTDDS_DOMAINPARTICIPANT_HPP_ +#ifndef _FASTDDS_DDS_DOMAIN_DOMAINPARTICIPANT_FACTORY_HPP_ +#define _FASTDDS_DDS_DOMAIN_DOMAINPARTICIPANT_FACTORY_HPP_ #include #include #include +#include #include #include #include +#include +#include #include -#include -#include - -using eprosima::fastrtps::types::ReturnCode_t; namespace eprosima { @@ -311,7 +310,7 @@ class DomainParticipantFactory const LibrarySettings& library_settings); /** - * @brief Get the DynamicTypeBuilder defined in XML file. + * @brief Get the @ref DynamicType defined in XML file. * The XML file shall be previously loaded. * * @param type_name Dynamic type name. @@ -322,7 +321,14 @@ class DomainParticipantFactory */ FASTDDS_EXPORTED_API ReturnCode_t get_dynamic_type_builder_from_xml_by_name( const std::string& type_name, - fastrtps::types::DynamicTypeBuilder*& type); + DynamicType::_ref_type& type); + + /** + * @brief Return the TypeObjectRegistry member to access the public API. + * + * @return const xtypes::TypeObjectRegistry reference. + */ + FASTDDS_EXPORTED_API xtypes::ITypeObjectRegistry& type_object_registry(); protected: @@ -385,4 +391,4 @@ class DomainParticipantFactory } // namespace fastdds } // namespace eprosima -#endif /* _FASTDDS_DOMAINPARTICIPANT_HPP_*/ +#endif /* _FASTDDS_DDS_DOMAIN_DOMAINPARTICIPANT_FACTORY_HPP_*/ diff --git a/include/fastdds/dds/domain/DomainParticipantListener.hpp b/include/fastdds/dds/domain/DomainParticipantListener.hpp index 5f5a93b8893..0aceab58e1f 100644 --- a/include/fastdds/dds/domain/DomainParticipantListener.hpp +++ b/include/fastdds/dds/domain/DomainParticipantListener.hpp @@ -20,16 +20,12 @@ #ifndef __FASTDDS__PARTICIPANT_PARTICIPANTLISTENER_HPP__ #define __FASTDDS__PARTICIPANT_PARTICIPANTLISTENER_HPP__ -#include -#include -#include #include #include #include - -#include -#include -#include +#include +#include +#include namespace eprosima { namespace fastdds { @@ -168,59 +164,6 @@ class DomainParticipantListener : static_cast(should_be_ignored); } - /*! - * This method is called when a participant discovers a new Type - * The ownership of all object belongs to the caller so if needs to be used after the - * method ends, a full copy should be perform (except for dyn_type due to its shared_ptr nature. - * For example: - * fastrtps::types::TypeIdentifier new_type_id = \*identifier; - */ - virtual void on_type_discovery( - DomainParticipant* participant, - const fastrtps::rtps::SampleIdentity& request_sample_id, - const fastcdr::string_255& topic, - const fastrtps::types::TypeIdentifier* identifier, - const fastrtps::types::TypeObject* object, - fastrtps::types::DynamicType_ptr dyn_type) - { - static_cast(participant); - static_cast(request_sample_id); - static_cast(topic); - static_cast(identifier); - static_cast(object); - static_cast(dyn_type); - } - - /*! - * This method is called when the typelookup client received a reply to a getTypeDependencies request. - * The user may want to retrieve these new types using the getTypes request and create a new - * DynamicType using the retrieved TypeObject. - */ - virtual void on_type_dependencies_reply( - DomainParticipant* participant, - const fastrtps::rtps::SampleIdentity& request_sample_id, - const fastrtps::types::TypeIdentifierWithSizeSeq& dependencies) - { - static_cast(participant); - static_cast(request_sample_id); - static_cast(dependencies); - } - - /*! - * This method is called when a participant receives a TypeInformation while discovering another participant. - */ - virtual void on_type_information_received( - DomainParticipant* participant, - const fastcdr::string_255 topic_name, - const fastcdr::string_255 type_name, - const fastrtps::types::TypeInformation& type_information) - { - static_cast(participant); - static_cast(topic_name); - static_cast(type_name); - static_cast(type_information); - } - // TODO: Methods in DomainParticipantListener (p.33 - DDS) }; diff --git a/include/fastdds/dds/log/Log.hpp b/include/fastdds/dds/log/Log.hpp index 50c4daf31e5..e468e99e34e 100644 --- a/include/fastdds/dds/log/Log.hpp +++ b/include/fastdds/dds/log/Log.hpp @@ -123,10 +123,16 @@ class Log FASTDDS_EXPORTED_API static void SetCategoryFilter( const std::regex&); + //! Returns a copy of the current category filter or an empty object otherwise + FASTDDS_EXPORTED_API static std::regex GetCategoryFilter(); + //! Sets a filter that will pattern-match against filenames, dropping any unmatched categories. FASTDDS_EXPORTED_API static void SetFilenameFilter( const std::regex&); + //! Returns a copy of the current filename filter or an empty object otherwise + FASTDDS_EXPORTED_API static std::regex GetFilenameFilter(); + //! Sets a filter that will pattern-match against the provided error string, dropping any unmatched categories. FASTDDS_EXPORTED_API static void SetErrorStringFilter( const std::regex&); @@ -135,6 +141,9 @@ class Log FASTDDS_EXPORTED_API static void SetThreadConfig( const rtps::ThreadSettings&); + //! Returns a copy of the current error string filter or an empty object otherwise + FASTDDS_EXPORTED_API static std::regex GetErrorStringFilter(); + //! Returns the logging engine to configuration defaults. FASTDDS_EXPORTED_API static void Reset(); @@ -176,6 +185,45 @@ class Log const std::string& message, const Log::Context&, Log::Kind); + + //! RAII to setup Logging + struct ScopeLogs + { + //! Set a specific category filter + ScopeLogs( + std::string category_filter) + { +#ifdef __cpp_lib_make_unique + filter_ = std::make_unique(Log::GetCategoryFilter()); +#else + filter_ = std::unique_ptr(new std::regex(Log::GetCategoryFilter())); +#endif // ifdef __cpp_lib_make_unique + Log::SetCategoryFilter(std::regex{category_filter}); + } + + //! Set a specified level + ScopeLogs( + Log::Kind new_verbosity = Log::Error) + { + old_ = Log::GetVerbosity(); + Log::SetVerbosity(new_verbosity); + } + + ~ScopeLogs() + { + if (filter_) + { + Log::SetCategoryFilter(*filter_); + } + else + { + Log::SetVerbosity(old_); + } + } + + Log::Kind old_; + std::unique_ptr filter_; + }; }; //! Streams Log::Kind serialization diff --git a/include/fastdds/dds/publisher/DataWriter.hpp b/include/fastdds/dds/publisher/DataWriter.hpp index 8e3407361d3..52f6d560065 100644 --- a/include/fastdds/dds/publisher/DataWriter.hpp +++ b/include/fastdds/dds/publisher/DataWriter.hpp @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -30,9 +31,6 @@ #include #include #include -#include - -using eprosima::fastrtps::types::ReturnCode_t; namespace eprosima { namespace fastrtps { @@ -227,7 +225,7 @@ class DataWriter : public DomainEntity * @param[in] instance Sample used to deduce instance's key in case of `handle` parameter is HANDLE_NIL. * @param[in] handle Instance's key to be unregistered. * @return Returns the operation's result. - * If the operation finishes successfully, ReturnCode_t::RETCODE_OK is returned. + * If the operation finishes successfully, RETCODE_OK is returned. */ FASTDDS_EXPORTED_API ReturnCode_t unregister_instance( void* instance, @@ -530,10 +528,10 @@ class DataWriter : public DomainEntity * @param [out] sample Pointer to the sample on the internal pool. * @param [in] initialization How to initialize the loaned sample. * - * @return ReturnCode_t::RETCODE_ILLEGAL_OPERATION when the data type does not support loans. - * @return ReturnCode_t::RETCODE_NOT_ENABLED if the writer has not been enabled. - * @return ReturnCode_t::RETCODE_OUT_OF_RESOURCES if the pool has been exhausted. - * @return ReturnCode_t::RETCODE_OK if a pointer to a sample is successfully obtained. + * @return RETCODE_ILLEGAL_OPERATION when the data type does not support loans. + * @return RETCODE_NOT_ENABLED if the writer has not been enabled. + * @return RETCODE_OUT_OF_RESOURCES if the pool has been exhausted. + * @return RETCODE_OK if a pointer to a sample is successfully obtained. */ FASTDDS_EXPORTED_API ReturnCode_t loan_sample( void*& sample, @@ -546,10 +544,10 @@ class DataWriter : public DomainEntity * * @param [in,out] sample Pointer to the previously loaned sample. * - * @return ReturnCode_t::RETCODE_ILLEGAL_OPERATION when the data type does not support loans. - * @return ReturnCode_t::RETCODE_NOT_ENABLED if the writer has not been enabled. - * @return ReturnCode_t::RETCODE_BAD_PARAMETER if the pointer does not correspond to a loaned sample. - * @return ReturnCode_t::RETCODE_OK if the loan is successfully discarded. + * @return RETCODE_ILLEGAL_OPERATION when the data type does not support loans. + * @return RETCODE_NOT_ENABLED if the writer has not been enabled. + * @return RETCODE_BAD_PARAMETER if the pointer does not correspond to a loaned sample. + * @return RETCODE_OK if the loan is successfully discarded. */ FASTDDS_EXPORTED_API ReturnCode_t discard_loan( void*& sample); diff --git a/include/fastdds/dds/publisher/Publisher.hpp b/include/fastdds/dds/publisher/Publisher.hpp index e3b5c62405a..3a9a6d71353 100644 --- a/include/fastdds/dds/publisher/Publisher.hpp +++ b/include/fastdds/dds/publisher/Publisher.hpp @@ -21,15 +21,13 @@ #define _FASTDDS_PUBLISHER_HPP_ #include +#include #include #include #include #include #include -#include - -using eprosima::fastrtps::types::ReturnCode_t; namespace dds { namespace pub { diff --git a/include/fastdds/dds/subscriber/DataReader.hpp b/include/fastdds/dds/subscriber/DataReader.hpp index af721648b78..d22e9b7b8f1 100644 --- a/include/fastdds/dds/subscriber/DataReader.hpp +++ b/include/fastdds/dds/subscriber/DataReader.hpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -42,10 +43,6 @@ #include #include -#include - -using eprosima::fastrtps::types::ReturnCode_t; - namespace dds { namespace sub { @@ -135,7 +132,7 @@ class DataReader : public DomainEntity * @brief Method to block the current thread until an unread message is available. * * @param[in] max_wait Max blocking time for this operation. - * @return RETCODE_OK if there is new unread message, ReturnCode_t::RETCODE_TIMEOUT if timeout + * @return RETCODE_OK if there is new unread message, RETCODE_TIMEOUT if timeout * @warning Not supported yet. Currently returns RETCODE_UNSUPPORTED */ FASTDDS_EXPORTED_API ReturnCode_t wait_for_historical_data( diff --git a/include/fastdds/dds/subscriber/Subscriber.hpp b/include/fastdds/dds/subscriber/Subscriber.hpp index 2358d6ed66f..06dce9942ca 100644 --- a/include/fastdds/dds/subscriber/Subscriber.hpp +++ b/include/fastdds/dds/subscriber/Subscriber.hpp @@ -20,6 +20,7 @@ #define _FASTDDS_SUBSCRIBER_HPP_ #include +#include #include #include #include @@ -28,9 +29,6 @@ #include #include #include -#include - -using eprosima::fastrtps::types::ReturnCode_t; namespace dds { namespace sub { diff --git a/include/fastdds/dds/topic/ContentFilteredTopic.hpp b/include/fastdds/dds/topic/ContentFilteredTopic.hpp index 6652e5dd7ed..bda635de270 100644 --- a/include/fastdds/dds/topic/ContentFilteredTopic.hpp +++ b/include/fastdds/dds/topic/ContentFilteredTopic.hpp @@ -19,14 +19,13 @@ #ifndef _FASTDDS_DDS_TOPIC_CONTENTFILTEREDTOPIC_HPP_ #define _FASTDDS_DDS_TOPIC_CONTENTFILTEREDTOPIC_HPP_ -#include +#include #include #include +#include #define FASTDDS_SQLFILTER_NAME eprosima::fastdds::dds::sqlfilter_name -using eprosima::fastrtps::types::ReturnCode_t; - namespace eprosima { namespace fastdds { namespace dds { diff --git a/include/fastdds/dds/topic/IContentFilter.hpp b/include/fastdds/dds/topic/IContentFilter.hpp index 3c91414ae6a..aef9f387a59 100644 --- a/include/fastdds/dds/topic/IContentFilter.hpp +++ b/include/fastdds/dds/topic/IContentFilter.hpp @@ -21,15 +21,10 @@ #include -#include - #include #include #include -#include -#include - namespace eprosima { namespace fastdds { namespace dds { diff --git a/include/fastdds/dds/topic/IContentFilterFactory.hpp b/include/fastdds/dds/topic/IContentFilterFactory.hpp index d860df1f39d..b61219d4151 100644 --- a/include/fastdds/dds/topic/IContentFilterFactory.hpp +++ b/include/fastdds/dds/topic/IContentFilterFactory.hpp @@ -22,11 +22,10 @@ #include #include +#include #include #include -#include - namespace eprosima { namespace fastdds { namespace dds { @@ -36,9 +35,7 @@ namespace dds { */ struct IContentFilterFactory { - using ReturnCode_t = eprosima::fastrtps::types::ReturnCode_t; using ParameterSeq = LoanableTypedCollection; - using TypeDescriptor = eprosima::fastrtps::types::TypeDescriptor; /** * Create or update an IContentFilter instance. diff --git a/include/fastdds/dds/topic/Topic.hpp b/include/fastdds/dds/topic/Topic.hpp index 2139a3cc3d5..c10e34f9793 100644 --- a/include/fastdds/dds/topic/Topic.hpp +++ b/include/fastdds/dds/topic/Topic.hpp @@ -21,12 +21,11 @@ #include #include +#include #include #include #include -using eprosima::fastrtps::types::ReturnCode_t; - namespace dds { namespace topic { diff --git a/include/fastdds/dds/topic/TopicDataType.hpp b/include/fastdds/dds/topic/TopicDataType.hpp index 5aeb81aa253..3262574fd78 100644 --- a/include/fastdds/dds/topic/TopicDataType.hpp +++ b/include/fastdds/dds/topic/TopicDataType.hpp @@ -118,6 +118,7 @@ class TopicDataType * @param[in] data Pointer to data. * @return Functor which calculates the serialized size of the data. */ + // FASTDDS_TODO_BEFORE(3, 0, "Remove this overload") FASTDDS_EXPORTED_API virtual std::function getSerializedSizeProvider( void* data) = 0; @@ -180,27 +181,6 @@ class TopicDataType return m_topicDataTypeName.c_str(); } - /** - * Get the type object auto-fill configuration - * - * @return true if the type object should be auto-filled - */ - FASTDDS_EXPORTED_API inline bool auto_fill_type_object() const - { - return auto_fill_type_object_; - } - - /** - * Set the type object auto-fill configuration - * - * @param auto_fill_type_object new value to set - */ - FASTDDS_EXPORTED_API inline void auto_fill_type_object( - bool auto_fill_type_object) - { - auto_fill_type_object_ = auto_fill_type_object; - } - /** * Get the type information auto-fill configuration * @@ -289,9 +269,9 @@ class TopicDataType /** * Get the type information * - * @return TypeInformation + * @return TypeInformationParameter */ - FASTDDS_EXPORTED_API inline const std::shared_ptr type_information() const + FASTDDS_EXPORTED_API inline const std::shared_ptr type_information() const { return type_information_; } @@ -299,21 +279,21 @@ class TopicDataType /** * Set type information * - * @param info new value for TypeInformation + * @param info new value for TypeInformationParameter */ FASTDDS_EXPORTED_API inline void type_information( - const xtypes::TypeInformation& info) + const xtypes::TypeInformationParameter& info) { - type_information_ = std::make_shared(info); + type_information_ = std::make_shared(info); } /** * Set type information * - * @param info shared pointer to TypeInformation + * @param info shared pointer to TypeInformationParameter */ FASTDDS_EXPORTED_API inline void type_information( - std::shared_ptr info) + std::shared_ptr info) { type_information_ = std::move(info); } @@ -357,6 +337,13 @@ class TopicDataType return false; } + /** + * @brief Register TypeObject type representation + */ + FASTDDS_EXPORTED_API virtual inline void register_type_object_representation() const + { + } + //! Maximum serialized size of the type in bytes. //! If the type has unbounded fields, and therefore cannot have a maximum size, use 0. uint32_t m_typeSize; @@ -371,14 +358,13 @@ class TopicDataType //!Type Object XTYPES 1.1 std::shared_ptr type_object_; //!XTYPES 1.2 - std::shared_ptr type_information_; + std::shared_ptr type_information_; private: //! Data Type Name. std::string m_topicDataTypeName; - - bool auto_fill_type_object_; + //TODO(XTypes) bool auto_fill_type_information_; friend class fastdds::dds::TypeSupport; diff --git a/include/fastdds/dds/topic/TypeSupport.hpp b/include/fastdds/dds/topic/TypeSupport.hpp index 6b41414efe5..e2b3b9c0d56 100644 --- a/include/fastdds/dds/topic/TypeSupport.hpp +++ b/include/fastdds/dds/topic/TypeSupport.hpp @@ -19,15 +19,16 @@ #ifndef _FASTDDS_TYPE_SUPPORT_HPP_ #define _FASTDDS_TYPE_SUPPORT_HPP_ -#include -#include -#include -#include - #include #include #include +#include +#include +#include +#include +#include + namespace eprosima { namespace fastdds { namespace dds { @@ -42,13 +43,11 @@ class DomainParticipant; * where Serialize and deserialize methods MUST be implemented. * @ingroup FASTDDS_MODULE */ -class TypeSupport : public std::shared_ptr +class TypeSupport : public std::shared_ptr { public: - using ReturnCode_t = eprosima::fastrtps::types::ReturnCode_t; - - using Base = std::shared_ptr; + using Base = std::shared_ptr; /** * @brief Constructor @@ -95,8 +94,8 @@ class TypeSupport : public std::shared_ptr * @param ptr */ FASTDDS_EXPORTED_API explicit TypeSupport( - fastdds::dds::TopicDataType* ptr) - : std::shared_ptr(ptr) + TopicDataType* ptr) + : std::shared_ptr(ptr) { } @@ -107,9 +106,8 @@ class TypeSupport : public std::shared_ptr * @param ptr */ FASTDDS_EXPORTED_API TypeSupport( - fastrtps::types::DynamicPubSubType ptr) - : std::shared_ptr(std::make_shared(std::move( - ptr))) + DynamicPubSubType ptr) + : std::shared_ptr(std::make_shared(std::move(ptr))) { } diff --git a/include/fastdds/dds/xtypes/common.hpp b/include/fastdds/dds/xtypes/common.hpp new file mode 100644 index 00000000000..3001d6120f4 --- /dev/null +++ b/include/fastdds/dds/xtypes/common.hpp @@ -0,0 +1,114 @@ +// Copyright 2023 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 + * This file contains common definitions for the different XTypes modules. + */ + +#ifndef _FASTDDS_DDS_XTYPES_COMMON_HPP_ +#define _FASTDDS_DDS_XTYPES_COMMON_HPP_ + +#include + +namespace eprosima { +namespace fastdds { +namespace dds { +namespace xtypes { + +enum class ExtensibilityKind : uint32_t +{ + NOT_APPLIED, + FINAL, + APPENDABLE, + MUTABLE +}; + +enum class TryConstructKind : uint32_t +{ + NOT_APPLIED, + USE_DEFAULT, + DISCARD, + TRIM +}; + +/** + * @brief PlacementKind values (@verbatim annotation) + */ +enum class PlacementKind : uint32_t +{ + BEGIN_FILE, + BEFORE_DECLARATION, + BEGIN_DECLARATION, + END_DECLARATION, + AFTER_DECLARATION, + END_FILE +}; + +// Primitive type names +constexpr const char* boolean_type_name = "_bool"; +constexpr const char* byte_type_name = "_byte"; +constexpr const char* int16_type_name = "_int16_t"; +constexpr const char* int32_type_name = "_int32_t"; +constexpr const char* int64_type_name = "_int64_t"; +constexpr const char* uint16_type_name = "_uint16_t"; +constexpr const char* uint32_type_name = "_uint32_t"; +constexpr const char* uint64_type_name = "_uint64_t"; +constexpr const char* float32_type_name = "_float"; +constexpr const char* float64_type_name = "_double"; +constexpr const char* float128_type_name = "_longdouble"; +constexpr const char* int8_type_name = "_int8_t"; +constexpr const char* uint8_type_name = "_uint8_t"; +constexpr const char* char8_type_name = "_char"; +constexpr const char* char16_type_name = "_wchar_t"; + +// Builtin annotation names +constexpr const char* id_annotation_name = "id"; +constexpr const char* autoid_annotation_name = "autoid"; +constexpr const char* optional_annotation_name = "optional"; +constexpr const char* position_annotation_name = "position"; +constexpr const char* value_annotation_name = "value"; // Pending implementation +constexpr const char* extensibility_annotation_name = "extensibility"; +constexpr const char* final_annotation_name = "final"; +constexpr const char* appendable_annotation_name = "appendable"; +constexpr const char* mutable_annotation_name = "mutable"; +constexpr const char* key_annotation_name = "key"; +constexpr const char* must_understand_annotation_name = "must_understand"; +constexpr const char* default_literal_annotation_name = "default_literal"; +constexpr const char* default_annotation_name = "default"; // Pending implementation +constexpr const char* range_annotation_name = "range"; // Pending implementation +constexpr const char* min_annotation_name = "min"; // Pending implementation +constexpr const char* max_annotation_name = "max"; // Pending implementation +constexpr const char* unit_annotation_name = "unit"; +constexpr const char* bit_bound_annotation_name = "bit_bound"; +constexpr const char* external_annotation_name = "external"; +constexpr const char* nested_annotation_name = "nested"; +constexpr const char* verbatim_annotation_name = "verbatim"; +constexpr const char* service_annotation_name = "service"; +constexpr const char* oneway_annotation_name = "oneway"; +constexpr const char* ami_annotation_name = "ami"; +constexpr const char* hashid_annotation_name = "hashid"; +constexpr const char* default_nested_annotation_name = "default_nested"; +constexpr const char* ignore_literal_names_annotation_name = "ignore_literal_names"; +constexpr const char* try_construct_annotation_name = "try_construct"; +constexpr const char* non_serialized_annotation_name = "non_serialized"; +constexpr const char* data_representation_annotation_name = "data_representation"; +constexpr const char* topic_annotation_name = "topic"; + +} // xtypes +} // dds +} // fastdds +} // eprosima + +#endif // _FASTDDS_DDS_XTYPES_COMMON_HPP_ diff --git a/include/fastdds/dds/xtypes/dynamic_types/AnnotationDescriptor.hpp b/include/fastdds/dds/xtypes/dynamic_types/AnnotationDescriptor.hpp new file mode 100644 index 00000000000..5eaef141de7 --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/AnnotationDescriptor.hpp @@ -0,0 +1,131 @@ +// Copyright 2023 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. + +#ifndef FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_ANNOTATION_DESCRIPTOR_HPP +#define FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_ANNOTATION_DESCRIPTOR_HPP + +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +class DynamicType; + +class FASTDDS_EXPORTED_API AnnotationDescriptor +{ +public: + + using _ref_type = typename traits::ref_type; + + /*! + * Returns a reference to the type. The reference can be nil. + * @return @ref DynamicType reference. + */ + virtual traits::ref_type type() const = 0; + + /*! + * Returns a reference to the type. The reference can be nil. + * @return @ref DynamicType reference. + */ + virtual traits::ref_type& type() = 0; + + /*! + * Modifies the underlying type reference. + * @param[in] @ref DynamicType reference. + */ + virtual void type( + traits::ref_type type) = 0; + + /** + * Getter given a key for the @b value property. + * @param[inout] value The value. + * @param[in] key Key used to retrieve the value. + * @return @ref ReturnCode_t returns operation success + */ + virtual ReturnCode_t get_value( + ObjectName& value, + const ObjectName& key) = 0; + + /** + * Getter for all the values. + * @param[inout] value @ref Parameters interface to the strings map. + * @return @ref ReturnCode_t returns operation success. + */ + virtual ReturnCode_t get_all_value( + Parameters& value) = 0; + + /** + * Setter given a key for the @b value property. + * @param[in] key null terminated string + * @param[in] value null terminated string + * @return @ref ReturnCode_t returns operation success + */ + virtual ReturnCode_t set_value( + const ObjectName& key, + const ObjectName& value) = 0; + + /** + * Overwrites the contents of this descriptor with those of another descriptor (see [standard] 7.5.2.3.1) + * @param[in] descriptor object + * @return standard @ref ReturnCode_t + * @retval RETCODE_OK when the copy was successful. + * @retval RETCODE_BAD_PARAMETER when descriptor reference is nil. + */ + virtual ReturnCode_t copy_from( + traits::ref_type descriptor) = 0; + + /** + * State comparison according with the [standard] sections \b 7.5.2.3.2 + * @param[in] descriptor reference. + * @return \b bool `true` on equality + */ + virtual bool equals( + traits::ref_type descriptor) = 0; + + /*! + * Indicates whether the states of all of this descriptor's properties are consistent according with the [standard] + * section \b 7.5.2.3.3. + * @return \b bool `true` if consistent. + */ + virtual bool is_consistent() = 0; + +protected: + + AnnotationDescriptor() = default; + + AnnotationDescriptor( + const AnnotationDescriptor&) = default; + + AnnotationDescriptor( + AnnotationDescriptor&&) = default; + + virtual ~AnnotationDescriptor() = default; + +private: + + AnnotationDescriptor& operator =( + const AnnotationDescriptor&) = delete; + + AnnotationDescriptor& operator =( + AnnotationDescriptor&&) = delete; +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_ANNOTATION_DESCRIPTOR_HPP diff --git a/include/fastdds/dds/xtypes/dynamic_types/DynamicData.hpp b/include/fastdds/dds/xtypes/dynamic_types/DynamicData.hpp new file mode 100644 index 00000000000..6aefb983224 --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/DynamicData.hpp @@ -0,0 +1,1042 @@ +// Copyright 2023 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. + +#ifndef FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_DATA_HPP +#define FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_DATA_HPP + +#include +#include + +#include +#include +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +class DynamicData : public std::enable_shared_from_this +{ +public: + + using _ref_type = typename traits::ref_type; + + /*! + * Retrieve the @ref DynamicType reference associated to this @ref DynamicData + * @return Non-nil @ref DynamicType reference + */ + FASTDDS_EXPORTED_API virtual traits::ref_type type() = 0; + + /*! + * Retrieves the @ref MemberDescriptor associated to a member. + * @param[inout] value Non-nil @ref MemberDescriptor reference where the information is copied. + * @param[in] id Identifier of the member to be retrieved. + * @retval RETCODE_OK when the copy was successful. + * @retval RETCODE_BAD_PARAMETER when descriptor reference is nil or member identifier is not found. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_descriptor( + traits::ref_type& value, + MemberId id) = 0; + + /*! + * Compares two @ref DynamicData, equality requires: + * - Their respective type definitions are equal + * - All contained values are equal and occur in the same order + * - If the samples' type is an aggregated type, previous rule shall be amended as follows: + * -# Members shall be compared without regard to their order. + * @param [in] other @ref DynamicData reference to compare to + * @return `true` on equality + */ + FASTDDS_EXPORTED_API virtual bool equals( + traits::ref_type other) = 0; + + /*! + * Queries @ref MemberId by name. + * The query result depends on the type of the sample. + * Only next types support accessing by name. + * @li Aggregated type. + * @li Map type. + * @li Bitmask type. + * @param[in] name string + * @return MemberId or MEMBER_ID_INVALID on failure + */ + FASTDDS_EXPORTED_API virtual MemberId get_member_id_by_name( + const ObjectName& name) = 0; + + /*! + * Queries @ref MemberId by index + * The query result depends on the type of the sample. + * Only next types support accessing by index. + * @li Aggregated type. + * @li Sequence type. + * @li String type. + * @li Map type. + * @li Array type. + * @li Bitmask type. + * @param[in] index Index. + * @return MemberId or MEMBER_ID_INVALID on failure + */ + FASTDDS_EXPORTED_API virtual MemberId get_member_id_at_index( + uint32_t index) = 0; + + /*! + * Provides the @b item @b count of the data and depends on the type of object: + * @li If the object is of a collection type, returns the number of elements currently in the collection. + * In the case of an array type, this value will always be equal to the product of the bounds of all array + * dimensions. + * @li If the object is of a bitmask type, return the number of named flags that are currently set in the bitmask. + * @li If the object is of a structure or annotation type, return the number of members in the object. + * This value may be different than the number of members in the corresponding @ref DynamicType. + * @li If the object is of a union type, return the number of members in the object. This number will be two if the + * discriminator value selects a member and one otherwise. + * @li if the object is of a primitive or enumerated type, it is atomic: return one. + * @li if the object is of an alias type, return the value appropriate for the alias base type. + * @return count as defined above + */ + FASTDDS_EXPORTED_API virtual uint32_t get_item_count() = 0; + + /*! + * Clear all members associated to the object. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the cleaning was successful. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t clear_all_values() = 0; + + /*! + * Clear all members not associated to the key + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the cleaning was successful. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t clear_nonkey_values() = 0; + + /*! + * Clear a member. + * The meaning of "clearing" depends on the type of the sample: + * @li If aggregated type, set it to its default value. + * @li If variable-length collection type, remove the indicated element, shifting any subsequence elements to the + * next-lowest index. + * @li If array type, set the indicated element to its default value. + * @li If bitmask type, clear the indicated bit. + * @li If enumerated type, set it to the first value of the enumerated type. + * @li If primitive type, set it to its default value. + * @param[in] id Identifier of the member to purge + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the cleaning was successful. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t clear_value( + MemberId id) = 0; + + /*! + * \b Loans a @ref DynamicData reference within the sample + * @remarks This loan shall be returned by the @ref DynamicData::return_loaned_value operation + * @param[in] id identifier of the object to retrieve + * @return @ref DynamicData reference loaned or \b nil on outstanding loaned data + */ + FASTDDS_EXPORTED_API virtual traits::ref_type loan_value( + MemberId id) = 0; + + /*! + * Returns a loan retrieved using @ref DynamicData::loan_value. + * @param[in] value @ref DynamicData reference previously loaned + * @retval RETCODE_OK when the loan was returned successfully. + * @retval RETCODE_PRECONDITION_NOT_MET when the loan is invalid. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t return_loaned_value( + traits::ref_type value) = 0; + + /*! + * Creates and returns a new data sample with the same contents as this one. + * A comparison of this object and the clone using equals immediately following this call will return `true`. + * @return @ref DynamicData reference + */ + FASTDDS_EXPORTED_API virtual traits::ref_type clone() = 0; + + /*! + * Retrieves an \b int32 value associated to an identifier. + * @param[inout] value \b int32 to populate + * @param[in] Id identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b int32. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_int32_value( + int32_t& value, + MemberId id) = 0; + + /*! + * Sets an \b int32 value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value \b int32 to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b int32. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_int32_value( + MemberId id, + int32_t value) = 0; + + /*! + * Retrieves an \b uint32 value associated to an identifier. + * @param[inout] value \b uint32 to populate + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b uint32. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_uint32_value( + uint32_t& value, + MemberId id) = 0; + + /*! + * Sets an \b uint32 value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value \b uint32 to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b uint32. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_uint32_value( + MemberId id, + uint32_t value) = 0; + + /*! + * Retrieves an \b int8 value associated to an identifier. + * @param[inout] value \b int8 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b int8. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_int8_value( + int8_t& value, + MemberId id) = 0; + + /*! + * Sets an \b int8 value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value \b int8 to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b int8. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_int8_value( + MemberId id, + int8_t value) = 0; + + /*! + * Retrieves an \b uint8 value associated to an identifier. + * @param[inout] value \b uint8 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b uint8. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_uint8_value( + uint8_t& value, + MemberId id) = 0; + + /*! + * Sets an \b uint8 value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value \b uint8 to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b uint8. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_uint8_value( + MemberId id, + uint8_t value) = 0; + + /*! + * Retrieves an \b int16 value associated to an identifier. + * @param[inout] value \b int16 to populate. + * @param [in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b int16. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_int16_value( + int16_t& value, + MemberId id) = 0; + + /*! + * Sets an \b int16 value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value \b int16 to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b int16. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_int16_value( + MemberId id, + int16_t value) = 0; + + /*! + * Retrieves an \b uint16 value associated to an identifier. + * @param[inout] value \b uint16 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b uint16. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_uint16_value( + uint16_t& value, + MemberId id) = 0; + + /*! + * Sets an \b uint16 value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value \b uint16 to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b uint16. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_uint16_value( + MemberId id, + uint16_t value) = 0; + + /*! + * Retrieves an \b int64 value associated to an identifier. + * @param[inout] value \b int64 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b int64. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_int64_value( + int64_t& value, + MemberId id) = 0; + + /*! + * Sets an \b int64 value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value \b int64 to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b int64. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_int64_value( + MemberId id, + int64_t value) = 0; + + /*! + * Retrieves an \b uint64 value associated to an identifier. + * @param[inout] value \b uint64 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b uint64. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_uint64_value( + uint64_t& value, + MemberId id) = 0; + + /*! + * Sets an \b uint64 value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value \b uint64 to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b uint64. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_uint64_value( + MemberId id, + uint64_t value) = 0; + + /*! + * Retrieves an \b float32 value associated to an identifier. + * @param[inout] value \b float32 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b float32. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_float32_value( + float& value, + MemberId id) = 0; + + /*! + * Sets an \b float32 value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value \b float32 to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b float32. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_float32_value( + MemberId id, + float value) = 0; + + /*! + * Retrieves an \b float64 value associated to an identifier. + * @param[inout] value \b float64 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b float64. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_float64_value( + double& value, + MemberId id) = 0; + + /*! + * Sets an \b float64 value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value \b float64 to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b float64. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_float64_value( + MemberId id, + double value) = 0; + + /*! + * Retrieves an \b float128 value associated to an identifier. + * @param[inout] value \b float128 to populate. + * @param[in] id Identifier of the member to query. + * @remarks Only available on platforms supporting long double + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b float128. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_float128_value( + long double& value, + MemberId id) = 0; + + /*! + * Sets an \b float128 value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value \b float128 to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b float128. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_float128_value( + MemberId id, + long double value) = 0; + + /*! + * Retrieves an \b char8 value associated to an identifier. + * @param[inout] value \b char8 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b char8. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_char8_value( + char& value, + MemberId id) = 0; + + /*! + * Sets an \b char8 value associated to an identifier + * @param[in] id Identifier of the member to set. + * @param[in] value \b char8 to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b char8. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_char8_value( + MemberId id, + char value) = 0; + + /*! + * Retrieves an \b char16 value associated to an identifier. + * @param[inout] value \b char16 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b char16. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_char16_value( + wchar_t& value, + MemberId id) = 0; + + /*! + * Sets an \b char16 value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value \b char16 to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b char16. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_char16_value( + MemberId id, + wchar_t value) = 0; + + /*! + * Retrieves an \b byte value associated to an identifier. + * @param[inout] value \b byte to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b byte. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_byte_value( + eprosima::fastrtps::rtps::octet& value, + MemberId id) = 0; + + /*! + * Sets an \b byte value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value \b byte to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b byte. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_byte_value( + MemberId id, + eprosima::fastrtps::rtps::octet value) = 0; + + /*! + * Retrieves an \b bool value associated to an identifier. + * @param[in] id Identifier of the member to query. + * @param[inout] value \b bool to populate. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b bool. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_boolean_value( + bool& value, + MemberId id) = 0; + + /*! + * Sets an \b bool value associated to an identifier + * @param[in] Id identifier of the member to set. + * @param[in] value \b bool to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b bool. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_boolean_value( + MemberId id, + bool value) = 0; + + /*! + * Retrieves an \b string value associated to an identifier. + * @param[inout] value \b string to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b string. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_string_value( + std::string& value, + MemberId id) = 0; + + /*! + * Sets an \b string value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value \b string to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b string + * or the string length is greater than the string bound. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_string_value( + MemberId id, + const std::string& value) = 0; + + /*! + * Retrieves an \b wstring value associated to an identifier. + * @param[inout] value \b wstring to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b wstring. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_wstring_value( + std::wstring& value, + MemberId id) = 0; + + /*! + * Sets an \b wstring value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value \b wstring to set. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b wstring + * or the string length is greater than the string bound. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_wstring_value( + MemberId id, + const std::wstring& value) = 0; + + /*! + * Retrieves a \b complex value associated to an identifier. + * @param[inout] value @ref DynamicData reference to populate + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b complex. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_complex_value( + traits::ref_type& value, + MemberId id) = 0; + + /*! + * Sets a \b complex value associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value @ref DynamicData reference to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the value reference is nil or @ref MemberId is invalid or the member type is + * not promotable to \b complex. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_complex_value( + MemberId id, + traits::ref_type value) = 0; + + /*! + * Retrieves a sequence of \b int32 values associated to an identifier. + * @param[inout] value \b Sequence of \b int32 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b int32. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_int32_values( + Int32Seq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b int32 values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b int32 to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b int32. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_int32_values( + MemberId id, + const Int32Seq& value) = 0; + + /*! + * Retrieves a sequence of \b uint32 values associated to an identifier. + * @param[inout] value \b Sequence of \b uint32 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b uint32. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_uint32_values( + UInt32Seq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b uint32 values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b uint32 to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b uint32. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_uint32_values( + MemberId id, + const UInt32Seq& value) = 0; + + /*! + * Retrieves a sequence of \b int8 values associated to an identifier. + * @param[inout] value \b Sequence of \b int8 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b int8. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_int8_values( + Int8Seq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b int8 values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b int8 to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b int8. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_int8_values( + MemberId id, + const Int8Seq& value) = 0; + + /*! + * Retrieves a sequence of \b uint8 values associated to an identifier. + * @param[inout] value \b Sequence of \b uint8 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b uint8. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_uint8_values( + UInt8Seq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b uint8 values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b uint8 to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b uint8. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_uint8_values( + MemberId id, + const UInt8Seq& value) = 0; + + /*! + * Retrieves a sequence of \b int16 values associated to an identifier. + * @param[inout] value \b Sequence of \b int16 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b int16. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_int16_values( + Int16Seq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b int16 values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b int16 to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b int16. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_int16_values( + MemberId id, + const Int16Seq& value) = 0; + + /*! + * Retrieves a sequence of \b uint16 values associated to an identifier. + * @param[inout] value \b Sequence of \b uint16 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b uint16. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_uint16_values( + UInt16Seq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b uint16 values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b uint16 to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b uint16. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_uint16_values( + MemberId id, + const UInt16Seq& value) = 0; + + /*! + * Retrieves a sequence of \b int64 values associated to an identifier. + * @param[inout] value \b Sequence of \b int64 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b int64. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_int64_values( + Int64Seq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b int64 values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b int64 to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b int64. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_int64_values( + MemberId id, + const Int64Seq& value) = 0; + + /*! + * Retrieves a sequence of \b uint64 values associated to an identifier. + * @param[inout] value \b Sequence of \b uint64 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b uint64. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_uint64_values( + UInt64Seq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b uint64 values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b uint64 to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b uint64. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_uint64_values( + MemberId id, + const UInt64Seq& value) = 0; + + /*! + * Retrieves a sequence of \b float32 values associated to an identifier. + * @param[inout] value \b Sequence of \b float32 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b float32. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_float32_values( + Float32Seq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b float32 values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b float32 to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b float32. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_float32_values( + MemberId id, + const Float32Seq& value) = 0; + + /*! + * Retrieves a sequence of \b float64 values associated to an identifier. + * @param[inout] value \b Sequence of \b float64 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b float64. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_float64_values( + Float64Seq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b float64 values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b float64 to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b float64. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_float64_values( + MemberId id, + const Float64Seq& value) = 0; + + /*! + * Retrieves a sequence of \b float128 values associated to an identifier. + * @param[inout] value \b Sequence of \b float128 to populate. + * @param[in] id Identifier of the member to query. + * @remarks Only available on platforms supporting long double + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b + * float128. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_float128_values( + Float128Seq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b float128 values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b float128 to set + * @remarks Only available on platforms supporting long double + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b float128. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_float128_values( + MemberId id, + const Float128Seq& value) = 0; + + /*! + * Retrieves a sequence of \b char8 values associated to an identifier. + * @param[inout] value \b Sequence of \b char8 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b char8. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_char8_values( + CharSeq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b char8 values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b char8 to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b char8. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_char8_values( + MemberId id, + const CharSeq& value) = 0; + + /*! + * Retrieves a sequence of \b char16 values associated to an identifier. + * @param[inout] value \b Sequence of \b char16 to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b char16. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_char16_values( + WcharSeq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b char16 values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b char16 to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b char16. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_char16_values( + MemberId id, + const WcharSeq& value) = 0; + + /*! + * Retrieves a sequence of \b byte values associated to an identifier. + * @param[inout] value \b Sequence of \b byte to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b byte. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_byte_values( + ByteSeq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b byte values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b byte to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b byte. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_byte_values( + MemberId id, + const ByteSeq& value) = 0; + + /*! + * Retrieves a sequence of \b bool values associated to an identifier. + * @param[inout] value \b Sequence of \b bool to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b bool. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_boolean_values( + BooleanSeq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b bool values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b bool to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b bool. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_boolean_values( + MemberId id, + const BooleanSeq& value) = 0; + + /*! + * Retrieves a sequence of \b string values associated to an identifier. + * @param[inout] value \b Sequence of \b string to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b string. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_string_values( + StringSeq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b string values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b string to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b string. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_string_values( + MemberId id, + const StringSeq& value) = 0; + + /*! + * Retrieves a sequence of \b wstring values associated to an identifier. + * @param[inout] value \b Sequence of \b wstring to populate. + * @param[in] id Identifier of the member to query. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was retrieved successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b wstring. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_wstring_values( + WstringSeq& value, + MemberId id) = 0; + + /*! + * Sets a sequence of \b wstring values associated to an identifier. + * @param[in] id Identifier of the member to set. + * @param[in] value Sequence of \b wstring to set + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the value was set successfully. + * @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to sequence of \b wstring. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t set_wstring_values( + MemberId id, + const WstringSeq& value) = 0; + +protected: + + DynamicData() = default; + + virtual ~DynamicData() = default; + + traits::ref_type _this(); + +private: + + DynamicData( + const DynamicData&) = delete; + + DynamicData( + DynamicData&&) = delete; + + DynamicData& operator =( + const DynamicData&) = delete; + + DynamicData& operator =( + DynamicData&&) = delete; +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_DATA_HPP diff --git a/include/fastdds/dds/xtypes/dynamic_types/DynamicDataFactory.hpp b/include/fastdds/dds/xtypes/dynamic_types/DynamicDataFactory.hpp new file mode 100644 index 00000000000..a1dc29fcc77 --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/DynamicDataFactory.hpp @@ -0,0 +1,78 @@ +// Copyright 2023 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. + +#ifndef FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_DATA_FACTORY_HPP +#define FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_DATA_FACTORY_HPP + +#include + +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +class DynamicDataFactory : public std::enable_shared_from_this +{ +public: + + using _ref_type = typename traits::ref_type; + + /*! + * Returns the singleton factory object + * @remark This method is non thread-safe. + * @return @ref DynamicDataFactory reference. + */ + FASTDDS_EXPORTED_API static traits::ref_type get_instance(); + + /*! + * Resets the singleton reference. + * @return @ref ReturnCode_t + * @retval RETCODE_BAD_PARAMETER if singleton reference is currently nil. + * @retval RETCODE_OK otherwise. + */ + FASTDDS_EXPORTED_API static ReturnCode_t delete_instance(); + + /** + * Creates a new @ref DynamicData reference based on the given @ref DynamicType reference. + * All objects returned by this operation should eventually be deleted by calling delete_data. + * @param[in] type @ref DynamicType reference associated. + * @return new @ref DynamicData reference + */ + FASTDDS_EXPORTED_API virtual traits::ref_type create_data( + traits::ref_type type) = 0; + + /** + * Resets the internal reference if it is cached. + * @param[in] type @ref DynamicData reference whose internal cached reference to reset. + * @return standard ReturnCode_t + * @retval RETCODE_BAD_PARAMETER if reference is nil. + * @retval RETCODE_OK is otherwise returned. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t delete_data( + traits::ref_type& data) = 0; + +protected: + + virtual ~DynamicDataFactory() = default; + +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_DATA_FACTORY_HPP diff --git a/include/fastdds/dds/xtypes/dynamic_types/DynamicPubSubType.hpp b/include/fastdds/dds/xtypes/dynamic_types/DynamicPubSubType.hpp new file mode 100644 index 00000000000..2b76b316162 --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/DynamicPubSubType.hpp @@ -0,0 +1,154 @@ +// Copyright 2023 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. + +#ifndef FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_PUB_SUB_TYPE_HPP +#define FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_PUB_SUB_TYPE_HPP + +#include +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +class DynamicType; +class DynamicData; + +class DynamicPubSubType : public virtual eprosima::fastdds::dds::TopicDataType +{ + traits::ref_type dynamic_type_; + + unsigned char* key_buffer_ {nullptr}; + + MD5 md5_; + +public: + + //{{{ Public functions + + FASTDDS_EXPORTED_API DynamicPubSubType() = default; + + /* + * Constructs a @ref DynamicPubSubType from a @ref DynamicType + * @param type @ref DynamicType object associated to the data + * @remark Ownership is not transferred. + */ + FASTDDS_EXPORTED_API DynamicPubSubType( + traits::ref_type type); + + FASTDDS_EXPORTED_API virtual ~DynamicPubSubType(); + + /* + * Create a new data object of the specified type + * @return pointer to the new object + * @remark Ownership is transferred. This object must be removed using @ref deleteData + */ + FASTDDS_EXPORTED_API void* createData() override; + + /* + * Deletes an object previously allocated via @ref createData + * @param data pointer to the object to be deleted + * @remark Ownership is transferred. This object must be allocated using @ref createData + */ + FASTDDS_EXPORTED_API void deleteData ( + void* data) override; + + /* + * Deserialize an object from the given payload + * @param payload @ref eprosima::fastrtps::rtps::SerializedPayload_t to parse + * @param data object to fill in with payload data + * @return bool specifying success + */ + FASTDDS_EXPORTED_API bool deserialize ( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + /* + * Returns a copy of the internal @ref DynamicType object + * @return pointer to the new object + */ + FASTDDS_EXPORTED_API traits::ref_type get_dynamic_type() const noexcept; + + /* + * Calculate the key associated to a given object + * @param data object whose key is calculated + * @param ihandle @ref eprosima::fastrtps::rtps::InstanceHandle_t to fill in + * @param force_md5 use always md5 even if key payload footprint is smaller than the hash + * @return bool specifying success + */ + FASTDDS_EXPORTED_API bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + /* + * Provide a functor that calculates a specified object serialized size + * @param data object whose payload footprint to calculate + * @return functor that calculates the size + */ + // FASTDDS_TODO_BEFORE(3, 0, "Remove this overload") + FASTDDS_EXPORTED_API std::function getSerializedSizeProvider( + void* data) override; + + FASTDDS_EXPORTED_API std::function getSerializedSizeProvider( + void* data, + DataRepresentationId_t data_representation) override; + + /* + * Serialize an object into a given payload + * @param data object to serialize + * @param payload @ref eprosima::fastrtps::rtps::SerializedPayload_t to fill in + * @return bool specifying success + */ + FASTDDS_EXPORTED_API bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + /* + * Serialize an object into a given payload + * @param data object to serialize + * @param payload @ref eprosima::fastrtps::rtps::SerializedPayload_t to fill in + * @return bool specifying success + */ + FASTDDS_EXPORTED_API bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + fastdds::dds::DataRepresentationId_t data_representation) override; + + /* + * Sets up the internal @ref DynamicType object + * @param @ref DynamicType to copy + * @return @ref ReturnCode_t with operation status + * @remark Ownership is not transferred. + */ + FASTDDS_EXPORTED_API ReturnCode_t set_dynamic_type( + traits::ref_type type); + + //}}} + +private: + + void update_dynamic_type(); +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_PUB_SUB_TYPE_HPP diff --git a/include/fastdds/dds/xtypes/dynamic_types/DynamicType.hpp b/include/fastdds/dds/xtypes/dynamic_types/DynamicType.hpp new file mode 100644 index 00000000000..9025efd7b68 --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/DynamicType.hpp @@ -0,0 +1,190 @@ +// Copyright 2023 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. + +#ifndef FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_TYPE_HPP +#define FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_TYPE_HPP + +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +class DynamicType : public std::enable_shared_from_this +{ +public: + + using _ref_type = typename traits::ref_type; + + /*! + * Provides a summary of the state of this type overwriting a provided object (see [standard] 7.5.2.8.7) + * @param[inout] descriptor @ref TypeDescriptor reference where copied the information. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the copy was successful. + * @retval RETCODE_BAD_PARAMETER when descriptor reference is nil. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_descriptor( + traits::ref_type& descriptor) = 0; + + /*! + * Returns the fully qualified name of this type + * @return Type name. + */ + FASTDDS_EXPORTED_API virtual ObjectName get_name() = 0; + + /*! + * Returns the @ref TypeKind associated + * @return @ref TypeKind + */ + FASTDDS_EXPORTED_API virtual TypeKind get_kind() = 0; + + /*! + * Returns the member that corresponds to the specified name. + * @param[inout] member @ref DynamicTypeMember reference used to return the reference to the member. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the member was found. + * @retval RETCODE_BAD_PARAMETER when the member doesn't exist. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_member_by_name( + traits::ref_type& member, + const ObjectName& name) = 0; + + /*! + * Returns all members by @ref ObjectName. + * @param[inout] member @ref DynamicTypeMembersByName reference where the information is copied. + * @return @ref ReturnCode_t + * @retval RETCODE_OK + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_all_members_by_name( + DynamicTypeMembersByName& member) = 0; + + /*! + * Returns the member that corresponds to the specified @ref MemberId. + * @param[inout] member @ref DynamicTypeMember reference used to return the reference to the member. + * @param[in] id @ref MemberId + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the member was found. + * @retval RETCODE_BAD_PARAMETER when the member doesn't exist. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_member( + traits::ref_type& member, + MemberId id) = 0; + + /*! + * Returns all members by @ref MemberId. + * @param[inout] member @ref DynamicTypeMembersById reference where the information is copied. + * @return @ref ReturnCode_t + * @retval RETCODE_OK + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_all_members( + DynamicTypeMembersById& member) = 0; + + /*! + * This operation returns the current number of members. + * @return Current number of members + */ + FASTDDS_EXPORTED_API virtual uint32_t get_member_count() = 0; + + /** + * This operation returns the member that corresponds to the specified index. + * @param[inout] member @ref DynamicTypeMember reference used to return the reference to the member. + * @param[in] index Index + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the member was found. + * @retval RETCODE_BAD_PARAMETER when the index is out-of-range. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_member_by_index( + traits::ref_type& member, + uint32_t index) = 0; + + /*! + * Returns the number of applied annotations to the type. + * @return Number of annotations. + */ + FASTDDS_EXPORTED_API virtual uint32_t get_annotation_count() = 0; + + /*! + * Returns an applied annotation by index. + * @param[inout] descriptor @ref AnnotationDescriptor reference where the information is copied. + * @param[in] idx Index. + * @return standard @ref ReturnCode_t + * @retval RETCODE_OK when the copy was successful. + * @retval RETCODE_BAD_PARAMETER when descriptor reference is nil or index is out-of-range. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_annotation( + traits::ref_type& descriptor, + uint32_t idx) = 0; + + /*! + * Returns the number of applied verbatim text to the type. + * @return Number of verbatim texts. + */ + FASTDDS_EXPORTED_API virtual uint32_t get_verbatim_text_count() = 0; + + /*! + * Returns an applied verbatim text by index. + * @param[inout] descriptor @ref VerbatimTextDescriptor reference where the information is copied. + * @param[in] idx Index. + * @return standard @ref ReturnCode_t + * @retval RETCODE_OK when the copy was successful. + * @retval RETCODE_BAD_PARAMETER when descriptor reference is nil or index is out-of-range. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_verbatim_text( + traits::ref_type& descriptor, + uint32_t idx) = 0; + + /** + * State comparison according with the [standard] sections \b 7.5.2.8.4 + * @param[in] other @DynamicType reference to compare to + * @return \b bool `true` on equality + */ + FASTDDS_EXPORTED_API virtual bool equals( + traits::ref_type other) = 0; + +protected: + + DynamicType() = default; + + virtual ~DynamicType() = default; + + traits::ref_type _this(); + +private: + + DynamicType( + const DynamicType&) = delete; + + DynamicType( + DynamicType&&) = delete; + + DynamicType& operator =( + const DynamicType&) = delete; + + DynamicType& operator =( + DynamicType&&) = delete; +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_TYPE_HPP diff --git a/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeBuilder.hpp b/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeBuilder.hpp new file mode 100644 index 00000000000..9ea32a56ecf --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeBuilder.hpp @@ -0,0 +1,210 @@ +// Copyright 2023 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. + +#ifndef FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_TYPE_BUILDER_HPP +#define FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_TYPE_BUILDER_HPP + +#include + +#include +#include +#include +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +class DynamicTypeBuilder : public std::enable_shared_from_this +{ +public: + + using _ref_type = typename traits::ref_type; + + /*! + * Provides a summary of the state of this type overwriting a provided object. + * @param[inout] descriptor @ref TypeDescriptor + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the copy was successful. + * @retval RETCODE_BAD_PARAMETER when descriptor reference is nil. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_descriptor( + traits::ref_type& descriptor) = 0; + + /*! + * Returns the fully qualified name of this type + * @return Type name. + */ + FASTDDS_EXPORTED_API virtual ObjectName get_name() = 0; + + /*! + * Returns the @ref TypeKind associated + * @return @ref TypeKind + */ + FASTDDS_EXPORTED_API virtual TypeKind get_kind() = 0; + + /*! + * Returns a member looked for by name. + * @param[inout] member @ref DynamicTypeMember reference used to return the member. + * @param[in] name Member name. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when member was found. + * @retval RETCODE_BAD_PARAMETER when member wasn't found. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_member_by_name( + traits::ref_type& member, + const ObjectName& name) = 0; + + /*! + * Returns all members sorted by name. + * @param[inout] member @ref DynamicTypeMemberByName reference used to return all members. + * @return @ref ReturnCode_t + * @retval RETCODE_OK always. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_all_members_by_name( + DynamicTypeMembersByName& member) = 0; + /*! + * Returns a member looked for by @ref MemberId. + * @param[inout] member @ref DynamicTypeMember reference used to return the member. + * @param[in] id Member identifier. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when member was found. + * @retval RETCODE_BAD_PARAMETER when member wasn't found. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_member( + traits::ref_type& member, + MemberId id) = 0; + + /*! + * Returns all members sorted by MemberId. + * @param[inout] member @ref DynamicTypeMemberById reference used to return all members. + * @return @ref ReturnCode_t + * @retval RETCODE_OK always. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_all_members( + DynamicTypeMembersById& member) = 0; + + /*! + * This operation returns the current number of members. + * @return Current number of members + */ + FASTDDS_EXPORTED_API virtual uint32_t get_member_count() = 0; + + /*! + * This operation returns the member that corresponds to the specified index. + * @param[inout] member @ref DynamicTypeMember reference used to return the member. + * @param[in] index Index + * @return @ref ReturnCode_t + * @retval RETCODE_OK when member was found. + * @retval RETCODE_BAD_PARAMETER when index is out-of-range. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_member_by_index( + traits::ref_type& member, + uint32_t index) = 0; + + /*! + * This operation returns the current number of annotations to the type. + * @return Current number of annotations + */ + FASTDDS_EXPORTED_API virtual uint32_t get_annotation_count() = 0; + + /*! + * This operation returns the annotation that corresponds to the specified index. + * @param[inout] descriptor @ref AnnotationDescriptor reference where information is copied. + * @param[in] idx Index + * @return @ref ReturnCode_t + * @retval RETCODE_OK when member was found. + * @retval RETCODE_BAD_PARAMETER when reference is nil or index is out-of-range. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_annotation( + traits::ref_type& descriptor, + uint32_t idx) = 0; + + /*! + * Compares current state against a @ref DynamicType reference. + * @param[in] other @ref DynamicType reference to compare to. + * @return \b bool `true` on equality + */ + FASTDDS_EXPORTED_API virtual bool equals( + traits::ref_type other) = 0; + + /*! + * Adds a 'member' to this type, where the new 'member' has the meaning defined in the specification of + * the DynamicTypeMember class. + * @param[in] descriptor @ref MemberDescriptor reference used for the new member. + * @return ReturnCode_t + * @retval RETCODE_OK when the member was created successfully. + * @retval RETCODE_BAD_PARAMETER when there is an inconsistency. + * @retval RETCODE_PRECONDITION_NOT_MET when the type does not have members. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t add_member( + traits::ref_type descriptor) = 0; + + /*! + * Apply the given annotation to this type. + * @param[in] descriptor @ref AnnotationDescriptor reference to be applied. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the annotation was applied successful. + * @retval RETCODE_BAD_PARAMETER when there is an inconsistency. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t apply_annotation( + traits::ref_type descriptor) = 0; + + /*! + * Apply the given annotation to a member of this type. + * @param[in] descriptor @ref AnnotationDescriptor reference to be applied. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the annotation was applied successful. + * @retval RETCODE_BAD_PARAMETER when there is an inconsistency. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t apply_annotation_to_member( + MemberId member_id, + traits::ref_type descriptor) = 0; + + /*! + * Create an immutable DynamicType object containing a snapshot of this builder's current state. + * @return @ref DynamicType reference. + */ + FASTDDS_EXPORTED_API virtual traits::ref_type build() = 0; + +protected: + + DynamicTypeBuilder() = default; + + virtual ~DynamicTypeBuilder() = default; + + traits::ref_type _this(); + +private: + + DynamicTypeBuilder( + const DynamicTypeBuilder&) = delete; + + DynamicTypeBuilder( + DynamicTypeBuilder&&) = delete; + + DynamicTypeBuilder& operator =( + const DynamicTypeBuilder&) = delete; + + DynamicTypeBuilder& operator =( + DynamicTypeBuilder&&) = delete; +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_TYPE_BUILDER_HPP diff --git a/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeBuilderFactory.hpp b/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeBuilderFactory.hpp new file mode 100644 index 00000000000..abad001cbb3 --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeBuilderFactory.hpp @@ -0,0 +1,213 @@ +// Copyright 2023 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. + +#ifndef FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_TYPE_BUILDER_FACTORY_HPP +#define FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_TYPE_BUILDER_FACTORY_HPP + +#include +#include + +#include +#include +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +namespace xtypes { +class TypeObject; +} // namespace xtypes + +class DynamicTypeBuilderFactory : public std::enable_shared_from_this +{ +public: + + using _ref_type = typename traits::ref_type; + + /*! + * Returns the singleton factory object + * @remark This method is non thread-safe. + * @return @ref DynamicTypeBuilderFactory reference. + */ + FASTDDS_EXPORTED_API static traits::ref_type get_instance(); + + /*! + * Resets the singleton reference. + * @return @ref ReturnCode_t + * @retval RETCODE_BAD_PARAMETER if singleton reference is currently nil. + * @retval RETCODE_OK otherwise. + */ + FASTDDS_EXPORTED_API static ReturnCode_t delete_instance(); + + /*! + * Retrieves the cached @ref DynamicType reference associated to a given primitive + * @param[in] kind Type identifying the primitive type to retrieve. + * @return @ref DynamicType reference. Nil reference returned in error case. + */ + FASTDDS_EXPORTED_API virtual traits::ref_type get_primitive_type( + TypeKind kind) = 0; + + /*! + * Creates a new @ref DynamicTypeBuilder reference based on the given @ref TypeDescriptor state. + * @param[in] descriptor @ref TypeDescriptor to be copied. + * @return New @ref DynamicTypeBuilder reference. Nil reference returned in error case. + */ + FASTDDS_EXPORTED_API virtual traits::ref_type create_type( + traits::ref_type descriptor) = 0; + + /*! + * Creates a new @ref DynamicTypeBuilder reference based on the given @ref DynamicType reference. + * @param[in] type @ref DynamicType reference to be used. + * @return New @ref DynamicTypeBuilder reference. Nil reference returned in error case. + */ + FASTDDS_EXPORTED_API virtual traits::ref_type create_type_copy( + traits::ref_type type) = 0; + + /*! + * Creates a new @ref DynamicTypeBuilder reference based on the given @ref TypeObject instance. + * @param[in] type_object @ref TypeObject instance to be used. + * @return New @ref DynamicTypeBuilder reference. Nil reference returned in error case. + */ + FASTDDS_EXPORTED_API virtual traits::ref_type create_type_w_type_object( + const xtypes::TypeObject& type_object) = 0; + + /*! + * Creates a new @ref DynamicTypeBuilder reference representing a bounded string type. + * @param[in] bound `uint32_t` representing the maximum number of elements that may be stored. + * If the value is equal to LENGTH_UNLIMITED, the string type shall be considered to be unbounded. + * @return new @ref DynamicTypeBuilder reference.. Nil reference returned in error case. + */ + FASTDDS_EXPORTED_API virtual traits::ref_type create_string_type( + uint32_t bound) = 0; + + /*! + * Creates a new @ref DynamicTypeBuilder reference representing a bounded wstring type. + * @param[in] bound `uint32_t` representing the maximum number of elements that may be stored. + * If the value is equal to LENGTH_UNLIMITED, the wstring type shall be considered to be unbounded. + * @return new @ref DynamicTypeBuilder reference.. Nil reference returned in error case. + */ + FASTDDS_EXPORTED_API virtual traits::ref_type create_wstring_type( + uint32_t bound) = 0; + + /*! + * Creates a new @ref DynamicTypeBuilder reference representing a sequence. + * @param[in] element_type @ref DynamicType reference which becomes the element type + * @param[in] bound `uint32_t` representing the maximum number of elements that may be stored. + * If the value is equal to LENGTH_UNLIMITED, the sequence type shall be considered to be unbounded. + * @return new @ref DynamicTypeBuilder reference. Nil reference returned in error case. + */ + FASTDDS_EXPORTED_API virtual traits::ref_type create_sequence_type( + traits::ref_type element_type, + uint32_t bound) = 0; + + /*! + * Creates a new @ref DynamicTypeBuilder reference representing an array. + * @param[in] element_type @ref DynamicType reference which becomes the element type + * @param[in] bounds `uint32_t` representing the desired dimensions. + * @return new @ref DynamicTypeBuilder reference. Nil reference returned in error case. + */ + FASTDDS_EXPORTED_API virtual traits::ref_type create_array_type( + traits::ref_type element_type, + const BoundSeq& bound) = 0; + + /*! + * Creates a new @ref DynamicTypeBuilder reference representing a map. + * @param[in] key_type @ref DynamicType reference which becomes the map's key type + * @param[in] value_type @ref DynamicType reference which becomes the map's value type + * @param[in] bound `uint32_t` representing the maximum number of elements that may be stored. + * If the value is equal to LENGTH_UNLIMITED, the map type shall be considered to be unbounded. + * @return new @ref DynamicTypeBuilder reference. Nil reference returned in error case. + */ + FASTDDS_EXPORTED_API virtual traits::ref_type create_map_type( + traits::ref_type key_element_type, + traits::ref_type element_type, + uint32_t bound) = 0; + + /*! + * Creates a new @ref DynamicTypeBuilder reference representing a bitmask + * @param[in] bound `uint32_t` representing the maximum number of elements that may be stored. + * @return new @ref DynamicTypeBuilder reference. Nil reference returned in error case. + */ + FASTDDS_EXPORTED_API virtual traits::ref_type create_bitmask_type( + uint32_t bound) = 0; + + /*! + * Creates a new @ref DynamicTypeBuilder reference by parsing the type description at the given URL. + * @remark Not implemented yet. + * @param[in] URL pointing to the XML description. + * @param[in] type_name Fully qualified name of the type to be loaded from the document. + * @param[in] include_paths A collection of URLs to directories to be searched for additional type description + * documents. + * @return new @ref DynamicTypeBuilder reference. Nil reference returned in error case. + */ + FASTDDS_EXPORTED_API virtual traits::ref_type create_type_w_uri( + const std::string& document_url, + const std::string& type_name, + const IncludePathSeq& include_paths) = 0; + + /*! + * Creates a new @ref DynamicTypeBuilder reference by parsing the type description contained in the given string. + * @remark Not implemented yet. + * @param[in] String containing the type description. + * @param[in] type_name Fully qualified name of the type to be loaded from the string. + * @param[in] include_paths A collection of URLs to directories to be searched for additional type description + * documents. + * @return new @ref DynamicTypeBuilder reference. Nil reference returned in error case. + */ + FASTDDS_EXPORTED_API virtual traits::ref_type create_type_w_document( + const std::string& document, + const std::string& type_name, + const IncludePathSeq& include_paths) = 0; + + /*! + * Resets the internal reference if it is cached. + * @param[in] type @ref DynamicType reference whose internal cached reference to reset. + * @return standard ReturnCode_t + * @retval RETCODE_OK is always returned. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t delete_type( + traits::ref_type type) = 0; + +protected: + + DynamicTypeBuilderFactory() = default; + + virtual ~DynamicTypeBuilderFactory() = default; + + traits::ref_type _this(); + +private: + + DynamicTypeBuilderFactory( + const DynamicTypeBuilderFactory&) = delete; + + DynamicTypeBuilderFactory( + DynamicTypeBuilderFactory&&) = delete; + + DynamicTypeBuilderFactory& operator =( + const DynamicTypeBuilderFactory&) = delete; + + DynamicTypeBuilderFactory& operator =( + DynamicTypeBuilderFactory&&) = delete; + +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_TYPE_BUILDER_FACTORY_HPP diff --git a/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeMember.hpp b/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeMember.hpp new file mode 100644 index 00000000000..ef4f5118526 --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/DynamicTypeMember.hpp @@ -0,0 +1,139 @@ +// Copyright 2023 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. + +#ifndef FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_TYPE_MEMBER_HPP +#define FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_TYPE_MEMBER_HPP + +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +/*! + * Represents a "member" of a type. A "member" in this sense may be a member of an aggregated type, a constant within an + * enumeration, or some other type substructure. + */ +class DynamicTypeMember : public std::enable_shared_from_this +{ +public: + + using _ref_type = typename traits::ref_type; + + /*! + * Provides a summary of the state of this type overwriting a provided object (see [standard] 7.5.2.6.2) + * @param[inout] descriptor @ref MemberDescriptor reference where the information is copied. + * @return standard @ref ReturnCode_t + * @retval RETCODE_OK when the copy was successful. + * @retval RETCODE_BAD_PARAMETER when descriptor reference is nil. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_descriptor( + traits::ref_type& descriptor) = 0; + + /*! + * Returns the number of applied annotations to the member. + * @return Number of annotations. + */ + FASTDDS_EXPORTED_API virtual uint32_t get_annotation_count() = 0; + + /*! + * Returns an applied annotation by index. + * @param[inout] descriptor @ref AnnotationDescriptor reference where the information is copied. + * @param[in] idx Index. + * @return standard @ref ReturnCode_t + * @retval RETCODE_OK when the copy was successful. + * @retval RETCODE_BAD_PARAMETER when descriptor reference is nil or index is out-of-range. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_annotation( + traits::ref_type& descriptor, + uint32_t idx) = 0; + + /*! + * Returns the number of applied verbatim text to the member. + * @return Number of verbatim texts. + */ + FASTDDS_EXPORTED_API virtual uint32_t get_verbatim_text_count() = 0; + + /*! + * Returns an applied verbatim text by index. + * @param[inout] descriptor @ref VerbatimTextDescriptor reference where the information is copied. + * @param[in] idx Index. + * @return standard @ref ReturnCode_t + * @retval RETCODE_OK when the copy was successful. + * @retval RETCODE_BAD_PARAMETER when descriptor reference is nil or index is out-of-range. + */ + FASTDDS_EXPORTED_API virtual ReturnCode_t get_verbatim_text( + traits::ref_type& descriptor, + uint32_t idx) = 0; + + /** + * State comparison according with the [standard] sections \b 7.5.2.6.3 + * @param[in] other @DynamicTypeMember reference to compare to + * @return \b bool `true` on equality + */ + FASTDDS_EXPORTED_API virtual bool equals( + traits::ref_type other) = 0; + + /** + * Getter for @b id property according with the [standard] section \b 7.5.2.6.4 + * @return @ref MemberId + */ + FASTDDS_EXPORTED_API virtual MemberId get_id() = 0; + + /** + * Returns the name of this member. + * @return Member name. + */ + FASTDDS_EXPORTED_API virtual ObjectName get_name() = 0; + +protected: + + DynamicTypeMember() = default; + + virtual ~DynamicTypeMember() = default; + + traits::ref_type _this(); + +private: + + DynamicTypeMember( + const DynamicTypeMember&) = delete; + + DynamicTypeMember( + DynamicTypeMember&&) = delete; + + DynamicTypeMember& operator =( + const DynamicTypeMember&) = delete; + + DynamicTypeMember& operator =( + DynamicTypeMember&&) = delete; +}; + +typedef std::map::ref_type> DynamicTypeMembersByName; + +typedef std::map::ref_type> DynamicTypeMembersById; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DYNAMIC_TYPE_MEMBER_HPP diff --git a/include/fastdds/dds/xtypes/dynamic_types/MemberDescriptor.hpp b/include/fastdds/dds/xtypes/dynamic_types/MemberDescriptor.hpp new file mode 100644 index 00000000000..a39a03fceb8 --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/MemberDescriptor.hpp @@ -0,0 +1,331 @@ +// Copyright 2023 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. + +#ifndef FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_MEMBER_DESCRIPTOR_HPP +#define FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_MEMBER_DESCRIPTOR_HPP + +#include +#include +#include + +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +class DynamicType; + +class FASTDDS_EXPORTED_API MemberDescriptor +{ +public: + + using _ref_type = typename traits::ref_type; + + /*! + * Returns the name of this member. + * @return Member's name. + */ + virtual ObjectName& name() = 0; + + /*! + * Returns the name of this member. + * @return Member's name. + */ + virtual const ObjectName& name() const = 0; + + /*! + * Modifies the underlying member's name by copy. + * @param[in] name Member's name. + */ + virtual void name( + const ObjectName& name) = 0; + + /*! + * Modifies the underlying member's name by move. + * @param[in] name Member's name. + */ + virtual void name( + ObjectName&& name) = 0; + + /*! + * Returns the @ref MemberId of the member. + * @return @ref MemberId. + */ + virtual MemberId id() const = 0; + + /*! + * Returns the @ref MemberId of the member. + * @return @ref MemberId. + */ + virtual MemberId& id() = 0; + + /*! + * Modifies the underlying @ref MemberId. + * @param[in] @ref MemberId to be set. + */ + virtual void id( + MemberId id) = 0; + + /*! + * Returns a reference to the member's type. + * @return @ref DynamicType reference. + */ + virtual traits::ref_type type() const = 0; + + /*! + * Returns a reference to the member's type. + * @return @ref DynamicType reference. + */ + virtual traits::ref_type& type() = 0; + + /*! + * Modifies the underlying member's type reference. + * @param[in] @ref DynamicType reference. + */ + virtual void type( + traits::ref_type type) = 0; + + /*! + * Returns the default value. + * @return Default value. + */ + virtual std::string& default_value() = 0; + + /*! + * Returns the default value. + * @return Default value. + */ + virtual const std::string& default_value() const = 0; + + /*! + * Modifies the underlying default value by copy. + * @param[in] default_value Default value. + */ + virtual void default_value( + const std::string& default_value) = 0; + + /*! + * Modifies the underlying default value by move. + * @param[in] default_value Default value. + */ + virtual void default_value( + std::string&& default_value) = 0; + + /*! + * Returns the order of definition of the member. + * @return Order of definition. + */ + virtual uint32_t& index() = 0; + + /*! + * Returns the order of definition of the member. + * @return Order of definition. + */ + virtual uint32_t index() const = 0; + + /*! + * Returns the labels the member belongs to. + * @return @ref UnionCaseLabelSeq. + */ + virtual const UnionCaseLabelSeq& label() const = 0; + + /*! + * Returns the labels the member belongs to. + * @return @ref UnionCaseLabelSeq. + */ + virtual UnionCaseLabelSeq& label() = 0; + + /*! + * Modifies the labels the member belongs to by copy. + * @param[in] @ref UnionCaseLabelSeq + */ + virtual void label( + const UnionCaseLabelSeq& label) = 0; + + /*! + * Modifies the labels the member belongs to by move. + * @param[in] @ref UnionCaseLabelSeq + */ + virtual void label( + UnionCaseLabelSeq&& label) = 0; + + /*! + * Returns the @ref TryConstructKind of the member. + * @return @ref TryConstructKind. + */ + virtual TryConstructKind try_construct_kind() const = 0; + + /*! + * Returns the @ref TryConstructKind of the member. + * @return @ref TryConstructKind. + */ + virtual TryConstructKind& try_construct_kind() = 0; + + /*! + * Modifies the @ref TryConstructKind of the member. + * @param[in] try_construct_kind @ref TryConstructKind. + */ + virtual void try_construct_kind( + TryConstructKind try_construct_kind) = 0; + + /*! + * Returns the if the member is key. + * @return If the member is key. + */ + virtual bool is_key() const = 0; + + /*! + * Returns the if the member is key. + * @return If the member is key. + */ + virtual bool& is_key() = 0; + + /*! + * Modifies if the member is key. + * @param[in] is_key Boolean + */ + virtual void is_key( + bool is_key) = 0; + + /*! + * Returns the if the member is optional. + * @return If the member is optional. + */ + virtual bool is_optional() const = 0; + + /*! + * Returns the if the member is optional. + * @return If the member is optional. + */ + virtual bool& is_optional() = 0; + + /*! + * Modifies if the member is optional. + * @param[in] is_optional Boolean + */ + virtual void is_optional( + bool is_optional) = 0; + + /*! + * Returns the if the member is must_understand. + * @return If the member is must_understand. + */ + virtual bool is_must_understand() const = 0; + + /*! + * Returns the if the member is must_understand. + * @return If the member is must_understand. + */ + virtual bool& is_must_understand() = 0; + + /*! + * Modifies if the member is must_understand. + * @param[in] is_must_understand Boolean + */ + virtual void is_must_understand( + bool is_must_understand) = 0; + + /*! + * Returns the if the member is shared. + * @return If the member is shared. + */ + virtual bool is_shared() const = 0; + + /*! + * Returns the if the member is shared. + * @return If the member is shared. + */ + virtual bool& is_shared() = 0; + + /*! + * Modifies if the member is shared. + * @param[in] is_shared Boolean + */ + virtual void is_shared( + bool is_shared) = 0; + + /*! + * Returns the if the member is default_label. + * @return If the member is default_label. + */ + virtual bool is_default_label() const = 0; + + /*! + * Returns the if the member is default_label. + * @return If the member is default_label. + */ + virtual bool& is_default_label() = 0; + + /*! + * Modifies if the member is default_label. + * @param[in] is_default_label Boolean + */ + virtual void is_default_label( + bool is_default_label) = 0; + + /*! + * Overwrites the contents of this descriptor with those of another descriptor (see [standard] 7.5.2.7.1). + * @param[in] descriptor reference. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the copy was successful. + * @retval RETCODE_BAD_PARAMETER when descriptor reference is nil. + */ + virtual ReturnCode_t copy_from( + traits::ref_type descriptor) = 0; + + /*! + * Compares according with the [standard] section \b 7.5.2.7.4. + * @param[in] descriptor reference to compare to. + * @return \b bool `true` on equality + */ + virtual bool equals( + traits::ref_type descriptor) = 0; + + /*! + * Indicates whether the states of all of this descriptor's properties are consistent according with the [standard] + * section \b 7.5.2.7.7. + * @return \b bool `true` if consistent. + */ + virtual bool is_consistent() = 0; + +protected: + + MemberDescriptor() = default; + + MemberDescriptor( + const MemberDescriptor& type) = default; + + MemberDescriptor( + MemberDescriptor&& type) = default; + + virtual ~MemberDescriptor() = default; + +private: + + MemberDescriptor& operator =( + const MemberDescriptor& type) = delete; + + MemberDescriptor& operator =( + MemberDescriptor&& type) = delete; + +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_MEMBER_DESCRIPTOR_HPP diff --git a/include/fastdds/dds/xtypes/dynamic_types/TypeDescriptor.hpp b/include/fastdds/dds/xtypes/dynamic_types/TypeDescriptor.hpp new file mode 100644 index 00000000000..f5512402c26 --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/TypeDescriptor.hpp @@ -0,0 +1,274 @@ +// Copyright 2023 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. + +#ifndef FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_TYPE_DESCRIPTOR_HPP +#define FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_TYPE_DESCRIPTOR_HPP + +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +class DynamicType; + +/*! + * TypeDescriptor definition according to [standard] section \b 7.5.2.4. + */ +class FASTDDS_EXPORTED_API TypeDescriptor +{ +public: + + using _ref_type = typename traits::ref_type; + + /*! + * Returns the @ref TypeKind associated. + * @return standard @ref TypeKind. + */ + virtual TypeKind kind() const = 0; + + /*! + * Returns the @ref TypeKind associated. + * @return standard @ref TypeKind. + */ + virtual TypeKind& kind() = 0; + + /*! + * Modifies the underlying @ref TypeKind. + * @param[in] @ref TypeKind to be set. + */ + virtual void kind( + TypeKind kind) = 0; + + /*! + * Returns the fully qualified name of this type. + * @return Fully qualified name. + */ + virtual ObjectName& name() = 0; + + /*! + * Returns the fully qualified name of this type. + * @return Fully qualified name. + */ + virtual const ObjectName& name() const = 0; + + /*! + * Modifies the underlying type name by copy. + * @param[in] name Fully qualified name. + */ + virtual void name( + const ObjectName& name) = 0; + + /*! + * Modifies the underlying type name by move. + * @param[in] name Fully qualified name. + */ + virtual void name( + ObjectName&& name) = 0; + + /*! + * Returns a reference to the base type. The reference can be nil. + * @return @ref DynamicType reference. + */ + virtual traits::ref_type base_type() const = 0; + + /*! + * Returns a reference to the base type. The reference can be nil. + * @return @ref DynamicType reference. + */ + virtual traits::ref_type& base_type() = 0; + + /*! + * Modifies the underlying base type reference. + * @param[in] @ref DynamicType reference. + */ + virtual void base_type( + traits::ref_type type) = 0; + + /*! + * Returns a reference discriminator type. The reference can be nil. + * @return @ref DynamicType reference. + */ + virtual traits::ref_type discriminator_type() const = 0; + + /*! + * Returns a reference discriminator type. The reference can be nil. + * @return @ref DynamicType reference. + */ + virtual traits::ref_type& discriminator_type() = 0; + + /*! + * Modifies the underlying discriminator type reference. + * @param[in] @ref DynamicType reference. + */ + virtual void discriminator_type( + traits::ref_type type) = 0; + + /*! + * Returns the bound. + * @return @ref BoundSeq. + */ + virtual const BoundSeq& bound() const = 0; + + /*! + * Returns the bound. + * @return @ref BoundSeq. + */ + virtual BoundSeq& bound() = 0; + + /*! + * Modifies the underlying bound by copy. + * @param[in] @ref BoundSeq + */ + virtual void bound( + const BoundSeq& bound) = 0; + + /*! + * Modifies the underlying bound by move. + * @param[in] @ref BoundSeq + */ + virtual void bound( + BoundSeq&& bound) = 0; + + /*! + * Returns a reference element type. The reference can be nil. + * @return @ref DynamicType reference. + */ + virtual traits::ref_type element_type() const = 0; + + /*! + * Returns a reference element type. The reference can be nil. + * @return @ref DynamicType reference. + */ + virtual traits::ref_type& element_type() = 0; + + /*! + * Modifies the underlying element type reference. + * @param[in] @ref DynamicType reference. + */ + virtual void element_type( + traits::ref_type type) = 0; + + /*! + * Returns a reference key element type. The reference can be nil. + * @return @ref DynamicType reference. + */ + virtual traits::ref_type key_element_type() const = 0; + + /*! + * Returns a reference key element type. The reference can be nil. + * @return @ref DynamicType reference. + */ + virtual traits::ref_type& key_element_type() = 0; + + /*! + * Modifies the underlying key element type reference. + * @param[in] @ref DynamicType reference. + */ + virtual void key_element_type( + traits::ref_type type) = 0; + + + /*! + * Returns the extensibility kind. + * return @ref ExtensibilityKind + */ + virtual ExtensibilityKind extensibility_kind() const = 0; + + /*! + * Returns the extensibility kind. + * return @ref ExtensibilityKind + */ + virtual ExtensibilityKind& extensibility_kind() = 0; + + /*! + * Modifies the extensibility kind. + * @param[in] @ref ExtensibilityKind + */ + virtual void extensibility_kind( + ExtensibilityKind extensibility_kind) = 0; + + /*! + * Returns the is_nested property. + * return Boolean + */ + virtual bool is_nested() const = 0; + + /*! + * Returns the is_nested property. + * return Boolean + */ + virtual bool& is_nested() = 0; + + /*! + * Mofifies the is_nested property. + * @param[in] Boolean + */ + virtual void is_nested( + bool is_nested) = 0; + + /*! + * Overwrites the contents of this descriptor with those of another descriptor (see [standard] 7.5.2.4.3). + * @param[in] descriptor reference. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the copy was successful. + * @retval RETCODE_BAD_PARAMETER when descriptor reference is nil. + */ + virtual ReturnCode_t copy_from( + traits::ref_type descriptor) = 0; + + /*! + * Compares according with the [standard] section \b 7.5.2.4.6. + * @param[in] descriptor reference to compare to. + * @return \b bool `true` on equality + */ + virtual bool equals( + traits::ref_type descriptor) = 0; + + /*! + * Indicates whether the states of all of this descriptor's properties are consistent according with the [standard] + * section \b 7.5.2.4.7. + * @return \b bool `true` if consistent. + */ + virtual bool is_consistent() = 0; + +protected: + + TypeDescriptor() = default; + + TypeDescriptor( + const TypeDescriptor& type) = default; + + TypeDescriptor( + TypeDescriptor&& type) = default; + + virtual ~TypeDescriptor() = default; + +private: + + TypeDescriptor& operator =( + const TypeDescriptor& type) = delete; + + TypeDescriptor& operator =( + TypeDescriptor&& type) = delete; + +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_TYPE_DESCRIPTOR_HPP diff --git a/include/fastdds/dds/xtypes/dynamic_types/Types.hpp b/include/fastdds/dds/xtypes/dynamic_types/Types.hpp new file mode 100644 index 00000000000..544fa49427a --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/Types.hpp @@ -0,0 +1,83 @@ +// Copyright 2023 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 Types.hpp + */ + +#ifndef _FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_TYPES_HPP_ +#define _FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_TYPES_HPP_ + +#include "detail/dynamic_language_binding.hpp" +#include "type_traits.hpp" + +namespace eprosima { +namespace fastdds { +namespace dds { + +constexpr MemberId MEMBER_ID_INVALID {0x0FFFFFFF}; + +class DynamicData; + +template<> +struct traits : public object_traits +{ + using base_type = DynamicData; +}; + +class DynamicDataFactory; + +template<> +struct traits : public object_traits +{ + using base_type = DynamicDataFactory; +}; + +class DynamicType; + +template<> +struct traits : public object_traits +{ + using base_type = DynamicType; +}; + +class DynamicTypeBuilder; + +template<> +struct traits : public object_traits +{ + using base_type = DynamicTypeBuilder; +}; + +class DynamicTypeBuilderFactory; + +template<> +struct traits : public object_traits +{ + using base_type = DynamicTypeBuilderFactory; +}; + +class DynamicTypeMember; + +template<> +struct traits : public object_traits +{ + using base_type = DynamicTypeMember; +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // _FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_TYPES_HPP_ diff --git a/include/fastdds/dds/xtypes/dynamic_types/VerbatimTextDescriptor.hpp b/include/fastdds/dds/xtypes/dynamic_types/VerbatimTextDescriptor.hpp new file mode 100644 index 00000000000..7b38ccf8b31 --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/VerbatimTextDescriptor.hpp @@ -0,0 +1,133 @@ +// Copyright 2023 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. + +#ifndef FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_VERBATIM_TEXT_DESCRIPTOR_HPP +#define FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_VERBATIM_TEXT_DESCRIPTOR_HPP + +#include + +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +class FASTDDS_EXPORTED_API VerbatimTextDescriptor +{ +public: + + /*! + * Returns the location within the generated output at which the output text should be inserted. + * @return The location. + */ + virtual std::string& placement() = 0; + + /*! + * Returns the location within the generated output at which the output text should be inserted. + * @return The location. + */ + virtual const std::string& placement() const = 0; + + /*! + * Sets the location within the generated output at which the output text should be inserted. + * @param[in] placement The location. + */ + virtual void placement( + const std::string& placement) = 0; + + /*! + * Sets the location within the generated output at which the output text should be inserted. + * @param[in] placement The location. + */ + virtual void placement( + std::string&& placement) = 0; + + /*! + * Returns the literal output text. + * @return The text. + */ + virtual std::string& text() = 0; + + /*! + * Returns the literal output text. + * @return The text. + */ + virtual const std::string& text() const = 0; + + /*! + * Sets the literal output text. + * @param[in] text The text. + */ + virtual void text( + const std::string& text) = 0; + + /*! + * Sets the literal output text. + * @param[in] text The text. + */ + virtual void text( + std::string&& text) = 0; + + /*! + * Overwrites the contents of this descriptor with those of another descriptor. + * @param[in] descriptor reference. + * @return @ref ReturnCode_t + * @retval RETCODE_OK when the copy was successful. + * @retval RETCODE_BAD_PARAMETER when descriptor reference is nil. + */ + virtual ReturnCode_t copy_from( + traits::ref_type descriptor) = 0; + + /*! + * Compares. + * @param[in] descriptor reference to compare to. + * @return \b bool `true` on equality + */ + virtual bool equals( + traits::ref_type descriptor) = 0; + + /*! + * Indicates whether the states of all of this descriptor's properties are consistent. + * @return \b bool `true` if consistent. + */ + virtual bool is_consistent() = 0; + +protected: + + VerbatimTextDescriptor() = default; + + VerbatimTextDescriptor( + const VerbatimTextDescriptor& type) = default; + + VerbatimTextDescriptor( + VerbatimTextDescriptor&& type) = default; + + virtual ~VerbatimTextDescriptor() = default; + +private: + + VerbatimTextDescriptor& operator =( + const VerbatimTextDescriptor& type) = delete; + + VerbatimTextDescriptor& operator =( + VerbatimTextDescriptor&& type) = delete; +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_VERBATIM_TEXT_DESCRIPTOR_HPP diff --git a/include/fastdds/dds/xtypes/dynamic_types/detail/dynamic_language_binding.hpp b/include/fastdds/dds/xtypes/dynamic_types/detail/dynamic_language_binding.hpp new file mode 100644 index 00000000000..fb0d0fdea46 --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/detail/dynamic_language_binding.hpp @@ -0,0 +1,170 @@ +// 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 dynamic_language_binding.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_DYNAMIC_LANGUAGE_BINDING_HPP_ +#define _FAST_DDS_GENERATED_DYNAMIC_LANGUAGE_BINDING_HPP_ + +#include +#include +#include +#include +#include + +#include + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(DYNAMIC_LANGUAGE_BINDING_SOURCE) +#define DYNAMIC_LANGUAGE_BINDING_DllAPI __declspec( dllexport ) +#else +#define DYNAMIC_LANGUAGE_BINDING_DllAPI __declspec( dllimport ) +#endif // DYNAMIC_LANGUAGE_BINDING_SOURCE +#else +#define DYNAMIC_LANGUAGE_BINDING_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define DYNAMIC_LANGUAGE_BINDING_DllAPI +#endif // _WIN32 + +namespace eprosima { + +namespace fastdds { + +namespace dds { + + +typedef std::vector IncludePathSeq; + +typedef eprosima::fastcdr::fixed_string<256> ObjectName; + +typedef std::vector BoundSeq; + +typedef uint8_t TypeKind; + +const TypeKind TK_NONE = 0x00; +const TypeKind TK_BOOLEAN = 0x01; +const TypeKind TK_BYTE = 0x02; +const TypeKind TK_INT16 = 0x03; +const TypeKind TK_INT32 = 0x04; +const TypeKind TK_INT64 = 0x05; +const TypeKind TK_UINT16 = 0x06; +const TypeKind TK_UINT32 = 0x07; +const TypeKind TK_UINT64 = 0x08; +const TypeKind TK_FLOAT32 = 0x09; +const TypeKind TK_FLOAT64 = 0x0A; +const TypeKind TK_FLOAT128 = 0x0B; +const TypeKind TK_INT8 = 0x0C; +const TypeKind TK_UINT8 = 0x0D; +const TypeKind TK_CHAR8 = 0x10; +const TypeKind TK_CHAR16 = 0x11; +const TypeKind TK_STRING8 = 0x20; +const TypeKind TK_STRING16 = 0x21; +const TypeKind TK_ALIAS = 0x30; +const TypeKind TK_ENUM = 0x40; +const TypeKind TK_BITMASK = 0x41; +const TypeKind TK_ANNOTATION = 0x50; +const TypeKind TK_STRUCTURE = 0x51; +const TypeKind TK_UNION = 0x52; +const TypeKind TK_BITSET = 0x53; +const TypeKind TK_SEQUENCE = 0x60; +const TypeKind TK_ARRAY = 0x61; +const TypeKind TK_MAP = 0x62; +typedef std::map Parameters; + +/*! + * @brief This class represents the enumeration ExtensibilityKind defined by the user in the IDL file. + * @ingroup dynamic_language_binding + */ +enum class ExtensibilityKind : uint32_t +{ + FINAL, + APPENDABLE, + MUTABLE +}; +/*! + * @brief This class represents the enumeration TryConstructKind defined by the user in the IDL file. + * @ingroup dynamic_language_binding + */ +enum class TryConstructKind : uint32_t +{ + USE_DEFAULT, + DISCARD, + TRIM +}; +typedef uint32_t MemberId; + +typedef std::vector UnionCaseLabelSeq; + +typedef std::vector Int32Seq; + +typedef std::vector UInt32Seq; + +typedef std::vector Int8Seq; + +typedef std::vector UInt8Seq; + +typedef std::vector Int16Seq; + +typedef std::vector UInt16Seq; + +typedef std::vector Int64Seq; + +typedef std::vector UInt64Seq; + +typedef std::vector Float32Seq; + +typedef std::vector Float64Seq; + +typedef std::vector Float128Seq; + +typedef std::vector CharSeq; + +typedef std::vector WcharSeq; + +typedef std::vector BooleanSeq; + +typedef std::vector ByteSeq; + +typedef std::vector StringSeq; + +typedef std::vector WstringSeq; + + +} // namespace dds + +} // namespace fastdds + +} // namespace eprosima + + +#endif // _FAST_DDS_GENERATED_DYNAMIC_LANGUAGE_BINDING_HPP_ + + diff --git a/include/fastdds/dds/xtypes/dynamic_types/detail/dynamic_language_binding.idl b/include/fastdds/dds/xtypes/dynamic_types/detail/dynamic_language_binding.idl new file mode 100644 index 00000000000..c36032ad8db --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/detail/dynamic_language_binding.idl @@ -0,0 +1,89 @@ +// The content of this file, was extracted from DDS-XTypes v1.3 standard. + +module DDS +{ + typedef sequence IncludePathSeq; + typedef string<256> ObjectName; + + // Inserted until defined in standard. + typedef sequence BoundSeq; + + // ---------- TypeKinds (begin) ------------------- + typedef octet TypeKind; + + // Primitive TKs + const TypeKind TK_NONE= 0x00; + const TypeKind TK_BOOLEAN= 0x01; + const TypeKind TK_BYTE= 0x02; + const TypeKind TK_INT16= 0x03; + const TypeKind TK_INT32= 0x04; + const TypeKind TK_INT64= 0x05; + const TypeKind TK_UINT16= 0x06; + const TypeKind TK_UINT32= 0x07; + const TypeKind TK_UINT64= 0x08; + const TypeKind TK_FLOAT32= 0x09; + const TypeKind TK_FLOAT64= 0x0A; + const TypeKind TK_FLOAT128= 0x0B; + const TypeKind TK_INT8= 0x0C; + const TypeKind TK_UINT8= 0x0D; + const TypeKind TK_CHAR8= 0x10; + const TypeKind TK_CHAR16= 0x11; + + // String TKs + const TypeKind TK_STRING8= 0x20; + const TypeKind TK_STRING16= 0x21; + + // Constructed/Named types + const TypeKind TK_ALIAS = 0x30; + + // Enumerated TKs + const TypeKind TK_ENUM= 0x40; + const TypeKind TK_BITMASK= 0x41; + + // Structured TKs + const TypeKind TK_ANNOTATION = 0x50; + const TypeKind TK_STRUCTURE= 0x51; + const TypeKind TK_UNION= 0x52; + const TypeKind TK_BITSET= 0x53; + + // Collection TKs + const TypeKind TK_SEQUENCE= 0x60; + const TypeKind TK_ARRAY= 0x61; + const TypeKind TK_MAP= 0x62; + // ---------- TypeKinds (end) ------------------- + + typedef map Parameters; + + enum ExtensibilityKind { + FINAL, + APPENDABLE, + MUTABLE + }; + + enum TryConstructKind { + USE_DEFAULT, + DISCARD, + TRIM + }; + + typedef unsigned long MemberId; + typedef sequence UnionCaseLabelSeq; + + typedef sequenceInt32Seq; + typedef sequenceUInt32Seq; + typedef sequenceInt8Seq; + typedef sequenceUInt8Seq; + typedef sequenceInt16Seq; + typedef sequenceUInt16Seq; + typedef sequenceInt64Seq; + typedef sequenceUInt64Seq; + typedef sequenceFloat32Seq; + typedef sequenceFloat64Seq; + typedef sequenceFloat128Seq; + typedef sequenceCharSeq; + typedef sequenceWcharSeq; + typedef sequenceBooleanSeq; + typedef sequenceByteSeq; + typedef sequenceStringSeq; + typedef sequenceWstringSeq; +}; diff --git a/include/fastdds/dds/xtypes/dynamic_types/detail/type_traits.hpp b/include/fastdds/dds/xtypes/dynamic_types/detail/type_traits.hpp new file mode 100644 index 00000000000..d3b4dbddd39 --- /dev/null +++ b/include/fastdds/dds/xtypes/dynamic_types/detail/type_traits.hpp @@ -0,0 +1,65 @@ +// Copyright 2023 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. + +#ifndef _FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DETAIL_TYPE_TRAITS_HPP_ +#define _FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DETAIL_TYPE_TRAITS_HPP_ + +#include + +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +template +struct traits +{ + using ref_type = typename ::std::shared_ptr; + using weak_ref_type = typename ::std::weak_ptr; + + template::value>::type> + inline static std::shared_ptr<_Tp> narrow ( + ref_type obj) + { + return std::dynamic_pointer_cast<_Tp>(obj); + } + + FASTDDS_EXPORTED_API static std::shared_ptr make_shared(); + +}; + +template +struct object_traits +{ + using ref_type = typename ::std::shared_ptr; + using weak_ref_type = typename ::std::weak_ptr; + + template::value>::type> + inline static std::shared_ptr<_Tp> narrow ( + ref_type obj) + { + return std::dynamic_pointer_cast<_Tp>(obj); + } + +}; + +} // namespace dds +} // namespace fastdds +} // namespace eprosima + +#endif // _FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_DETAIL_TYPE_TRAITS_HPP_ + diff --git a/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp b/include/fastdds/dds/xtypes/dynamic_types/type_traits.hpp similarity index 55% rename from src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp rename to include/fastdds/dds/xtypes/dynamic_types/type_traits.hpp index d0e7477ac19..5ce20f7cda8 100644 --- a/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp +++ b/include/fastdds/dds/xtypes/dynamic_types/type_traits.hpp @@ -1,4 +1,4 @@ -// Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// Copyright 2023 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. @@ -12,22 +12,23 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include -#include -#include +#ifndef _FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_TYPE_TRAITS_HPP_ +#define _FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_TYPE_TRAITS_HPP_ namespace eprosima { -namespace fastrtps { -namespace types { +namespace fastdds { +namespace dds { -DynamicTypeBuilder_ptr::DynamicTypeBuilder_ptr(DynamicTypeBuilder* pType) - : Base(pType, [](DynamicTypeBuilder* pType) -{ - DynamicTypeBuilderFactory::get_instance()->delete_builder(pType); -}) -{ -} +template +struct traits; -} // namespace types -} // namespace fastrtps +template +struct object_traits; + +} // namespace dds +} // namespace fastdds } // namespace eprosima + +#include "detail/type_traits.hpp" + +#endif // _FASTDDS_DDS_XTYPES_DYNAMIC_TYPES_TYPE_TRAITS_HPP_ diff --git a/include/fastdds/dds/xtypes/exception/Exception.hpp b/include/fastdds/dds/xtypes/exception/Exception.hpp new file mode 100644 index 00000000000..31d15ffc2c7 --- /dev/null +++ b/include/fastdds/dds/xtypes/exception/Exception.hpp @@ -0,0 +1,79 @@ +// Copyright 2023 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 + * This file is based on the DDS-PSM-CXX Exception.hpp file. + */ + +#ifndef _FASTDDS_DDS_XTYPES_EXCEPTION_EXCEPTION_HPP_ +#define _FASTDDS_DDS_XTYPES_EXCEPTION_EXCEPTION_HPP_ + +#include +#include + +#include + +namespace eprosima { +namespace fastdds { +namespace dds { +namespace xtypes { + +/** + * @brief Exception: base class for specified DDS Exceptions. + */ +class Exception +{ +protected: + + Exception() = default; + +public: + + FASTDDS_EXPORTED_API virtual ~Exception() throw() = default; + + /** + * @brief Retrieve information about the exception that was thrown. + * + * @return Exception information. + */ + FASTDDS_EXPORTED_API virtual const char* what() const throw() = 0; + +}; + +/** + * @brief Application is passing an invalid argument. + */ +class InvalidArgumentError : public Exception, public std::invalid_argument +{ +public: + + FASTDDS_EXPORTED_API explicit InvalidArgumentError( + const std::string& msg); + + FASTDDS_EXPORTED_API InvalidArgumentError( + const InvalidArgumentError& src); + + FASTDDS_EXPORTED_API virtual ~InvalidArgumentError() throw(); + + FASTDDS_EXPORTED_API virtual const char* what() const throw(); + +}; + +} // xtypes +} // dds +} // fastdds +} // eprosima + +#endif // _FASTDDS_DDS_XTYPES_EXCEPTION_EXCEPTION_HPP_ diff --git a/include/fastdds/dds/xtypes/type_representation/ITypeObjectRegistry.hpp b/include/fastdds/dds/xtypes/type_representation/ITypeObjectRegistry.hpp new file mode 100644 index 00000000000..287ce381f90 --- /dev/null +++ b/include/fastdds/dds/xtypes/type_representation/ITypeObjectRegistry.hpp @@ -0,0 +1,144 @@ +// Copyright 2023 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 + * This file contains the required classes to keep a TypeObject/TypeIdentifier registry. + */ + +#ifndef _FASTDDS_DDS_XTYPES_TYPE_REPRESENTATION_ITYPEOBJECTREGISTRY_HPP_ +#define _FASTDDS_DDS_XTYPES_TYPE_REPRESENTATION_ITYPEOBJECTREGISTRY_HPP_ + +#include + +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +namespace xtypes { + +struct TypeObjectPair +{ + // Minimal TypeObject + TypeObject minimal_type_object; + // Complete TypeObject + TypeObject complete_type_object; +}; + +class ITypeObjectRegistry +{ +public: + + /** + * @brief Register a local TypeObject. + * The MinimalTypeObject is generated from the CompleteTypeObject, and both are registered into the registry + * with the corresponding TypeIdentifiers and TypeObject serialized sizes. + * + * @pre type_name must not be empty. + * @pre complete_type_object must be consistent (only checked in Debug build mode). + * + * @param[in] type_name Name of the type being registered. + * @param[in] complete_type_object CompleteTypeObject related to the given type name. + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeObject registered with the + * given type_name. + * RETCODE_PRECONDITION_NOT_MET if the given type_name is empty or if the type_object + * is inconsistent. + */ + virtual FASTDDS_EXPORTED_API ReturnCode_t register_type_object( + const std::string& type_name, + const CompleteTypeObject& complete_type_object) = 0; + + /** + * @brief Register an indirect hash TypeIdentifier. + * + * @pre TypeIdentifier must not be a direct hash TypeIdentifier. + * @pre TypeIdentifier must be consistent (only checked in Debug build mode). + * @pre type_name must not be empty. + * + * @param[in] type_name Name of the type being registered. + * @param[in] type_identifier TypeIdentier related to the given type name. + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeIdentifier registered with + * the given type_name. + * RETCODE_PRECONDITION_NOT_MET if the given TypeIdentifier is inconsistent or a direct hash + * TypeIdentifier or if the given type_name is empty. + */ + virtual FASTDDS_EXPORTED_API ReturnCode_t register_type_identifier( + const std::string& type_name, + const TypeIdentifier& type_identifier) = 0; + + /** + * @brief Get the TypeObjects related to the given type name. + * + * @pre type_name must not be empty. + * + * @param[in] type_name Name of the type being queried. + * @param[out] type_objects Both complete and minimal TypeObjects related with the given type_name. + * @return ReturnCode_t RETCODE_OK if the TypeObjects are found in the registry. + * RETCODE_NO_DATA if the given type_name has not been registered. + * RETCODE_BAD_PARAMETER if the type_name correspond to a indirect hash TypeIdentifier. + * RETCODE_PRECONDITION_NOT_MET if the type_name is empty. + */ + virtual FASTDDS_EXPORTED_API ReturnCode_t get_type_objects( + const std::string& type_name, + TypeObjectPair& type_objects) = 0; + + /** + * @brief Get the TypeIdentifiers related to the given type name. + * + * @pre type_name must not be empty. + * + * @param[in] type_name Name of the type being queried. + * @param[out] type_identifiers For direct hash TypeIdentifiers, both minimal and complete TypeIdentifiers are + * returned. + * For indirect hash TypeIdentifiers, only the corresponding TypeIdentifier is returned + * @return ReturnCode_t RETCODE_OK if the TypeIdentifiers are found in the registry. + * RETCODE_NO_DATA if the type_name has not been registered. + * RETCODE_PRECONDITION_NOT_MET if the type_name is empty. + */ + virtual FASTDDS_EXPORTED_API ReturnCode_t get_type_identifiers( + const std::string& type_name, + TypeIdentifierPair& type_identifiers) = 0; + + /** + * @brief Get the TypeObject related to the given TypeIdentifier. + * + * @pre TypeIdentifier must be a direct hash TypeIdentifier. + * + * @param[in] type_identifier TypeIdentifier being queried. + * @param[out] type_object TypeObject related with the given TypeIdentifier. + * @return ReturnCode_t RETCODE_OK if the TypeObject is found within the registry. + * RETCODE_NO_DATA if the given TypeIdentifier is not found in the registry. + * RETCODE_PRECONDITION_NOT_MET if the TypeIdentifier is not a direct hash. + */ + virtual FASTDDS_EXPORTED_API ReturnCode_t get_type_object( + const TypeIdentifier& type_identifier, + TypeObject& type_object) = 0; + +}; + + +} // xtypes +} // dds +} // fastdds +} // eprosima + +#endif // _FASTDDS_DDS_XTYPES_TYPE_REPRESENTATION_ITYPEOBJECTREGISTRY_HPP_ + + diff --git a/test/blackbox/types/TestIncludeRegression3361.cxx b/include/fastdds/dds/xtypes/type_representation/TypeObject.hpp similarity index 53% rename from test/blackbox/types/TestIncludeRegression3361.cxx rename to include/fastdds/dds/xtypes/type_representation/TypeObject.hpp index bd999acb638..af46c4f8dbe 100644 --- a/test/blackbox/types/TestIncludeRegression3361.cxx +++ b/include/fastdds/dds/xtypes/type_representation/TypeObject.hpp @@ -13,36 +13,18 @@ // limitations under the License. /*! - * @file TestIncludeRegression3361.cpp - * This source file contains the implementation of the described types in the IDL file. + * @file TypeObject.h + * This header file contains the declaration of the described types in the IDL file. * * This file was generated by the tool fastddsgen. */ -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 +#ifndef _FASTDDS_DDS_XTYPES_TYPE_REPRESENTATION_TYPEOBJECT_HPP_ +#define _FASTDDS_DDS_XTYPES_TYPE_REPRESENTATION_TYPEOBJECT_HPP_ -#include "TestIncludeRegression3361.h" +#include +#include +#include -#if FASTCDR_VERSION_MAJOR > 1 +#endif // _FASTDDS_DDS_XTYPES_TYPE_REPRESENTATION_TYPEOBJECT_HPP_ -#include "TestIncludeRegression3361TypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - -namespace TestModule { - - -} // namespace TestModule -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/include/fastdds/dds/xtypes/type_representation/TypeObjectUtils.hpp b/include/fastdds/dds/xtypes/type_representation/TypeObjectUtils.hpp new file mode 100644 index 00000000000..ebc37899b0d --- /dev/null +++ b/include/fastdds/dds/xtypes/type_representation/TypeObjectUtils.hpp @@ -0,0 +1,3057 @@ +// Copyright 2023 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 + * This file contains static functions to help build a TypeObject. + */ + +#ifndef _FASTDDS_DDS_XTYPES_TYPE_REPRESENTATION_TYPEOBJECTUTILS_HPP_ +#define _FASTDDS_DDS_XTYPES_TYPE_REPRESENTATION_TYPEOBJECTUTILS_HPP_ + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace eprosima { +namespace fastdds { +namespace dds { + +class DynamicTypeBuilderFactoryImpl; + +namespace xtypes { + +class TypeObjectRegistry; + +using ReturnCode_t = eprosima::fastdds::dds::ReturnCode_t; + +class TypeObjectUtils +{ +public: + + /** + * @brief Build TypeObjectHashId instance. + * + * @param[in] discriminator TypeObjectHashId discriminator to be set. + * @param[in] hash StronglyConnectedComponent equivalence hash to be set. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if the given discriminator is not + * EK_COMPLETE/EK_MINIMAL. + * @return const TypeObjectHashId instance. + */ + FASTDDS_EXPORTED_API static const TypeObjectHashId build_type_object_hash_id( + uint8_t discriminator, + const EquivalenceHash& hash); + + /** + * @brief Build CollectionElementFlag instance. + * + * @param[in] try_construct_kind try_construct annotation value. + * @param[in] external external annotation value. + * @return CollectionElementFlag instance. + */ + FASTDDS_EXPORTED_API static CollectionElementFlag build_collection_element_flag( + TryConstructKind try_construct_kind, + bool external); + + /** + * @brief Build StructMemberFlag instance. + * + * @param[in] try_construct_kind try_construct annotation value. + * @param[in] optional optional annotation value. + * @param[in] must_understand must_understand annotation value. + * @param[in] key key annotation value. + * @param[in] external external annotation value. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if both key and optional flags are + * enabled. + * @return StructMemberFlag instance. + */ + FASTDDS_EXPORTED_API static StructMemberFlag build_struct_member_flag( + TryConstructKind try_construct_kind, + bool optional, + bool must_understand, + bool key, + bool external); + + /** + * @brief Build UnionMemberFlag instance. + * + * @param[in] try_construct_kind try_construct annotation value. + * @param[in] default_member is default member. + * @param[in] external external annotation value. + * @return UnionMemberFlag instance. + */ + FASTDDS_EXPORTED_API static UnionMemberFlag build_union_member_flag( + TryConstructKind try_construct_kind, + bool default_member, + bool external); + + /** + * @brief Build UnionDiscriminatorFlag instance. + * + * @param[in] try_construct_kind try_construct annotation value. + * @param[in] key key annotation value. + * @return UnionDiscriminatorFlag instance. + */ + FASTDDS_EXPORTED_API static UnionDiscriminatorFlag build_union_discriminator_flag( + TryConstructKind try_construct_kind, + bool key); + + /** + * @brief Build EnumeratedLiteralFlag instance. + * + * @param[in] default_literal default_literal annotation value. + * @return EnumeratedLiteralFlag instance. + */ + FASTDDS_EXPORTED_API static EnumeratedLiteralFlag build_enumerated_literal_flag( + bool default_literal); + + /** + * AnnotationParameterFlag: Unused. No flags apply. + * AliasMemberFlag: Unused. No flags apply. + * BitflagFlag: Unused. No flags apply. + * BitsetMemberFlag: Unused. No flags apply. + */ + + /** + * @brief Build StructTypeFlag instance. + * + * @param[in] extensibility_kind extensibility annotation value. + * @param[in] nested nested annotation value. + * @param[in] autoid_hash autoid annotation has HASH value. + * @return StructTypeFlag instance. + */ + FASTDDS_EXPORTED_API static StructTypeFlag build_struct_type_flag( + ExtensibilityKind extensibility_kind, + bool nested, + bool autoid_hash); + + /** + * @brief Build UnionTypeFlag instance. + * + * @param[in] extensibility_kind extensibility annotation value. + * @param[in] nested nested annotation value. + * @param[in] autoid_hash autoid annotation has HASH value. + * @return UnionTypeFlag instance. + */ + FASTDDS_EXPORTED_API static UnionTypeFlag build_union_type_flag( + ExtensibilityKind extensibility_kind, + bool nested, + bool autoid_hash); + + /** + * CollectionTypeFlag: Unused. No flags apply. + * AnnotationTypeFlag: Unused. No flags apply. + * AliasTypeFlag: Unused. No flags apply. + * EnumTypeFlag: Unused. No flags apply. + * BitmaskTypeFlag: Unused. No flags apply. + * BitsetTypeFlag: Unused. No flags apply. + */ + + /*************** Indirect Hash TypeIdentifiers ***************************/ + + /** + * @brief Build StringSTypeDefn instance. + * + * @pre bound > 0 (INVALID_SBOUND) + * @param[in] bound Bound for the small string/wstring. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if bound is 0. + * @return const StringSTypeDefn instance. + */ + FASTDDS_EXPORTED_API static const StringSTypeDefn build_string_s_type_defn( + SBound bound); + + /** + * @brief Build StringLTypeDefn instance. + * + * @pre bound > 255 + * @param[in] bound Bound for the large string/wstring. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if bound is lower than 256. + * @return const StringLTypeDefn instance. + */ + FASTDDS_EXPORTED_API static const StringLTypeDefn build_string_l_type_defn( + LBound bound); + + /** + * @brief Build PlainCollectionHeader instance. + * + * @param[in] equiv_kind EquivalenceKind: EK_MINIMAL/EK_COMPLETE/EK_BOTH + * @param[in] element_flags CollectionElementFlags to be set. This element must be constructed with the corresponding + * builder to ensure its consistency. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError if the given element_flags are inconsistent. + * This exception is only thrown in Debug build mode. + * @return const PlainCollectionHeader instance. + */ + FASTDDS_EXPORTED_API static const PlainCollectionHeader build_plain_collection_header( + EquivalenceKind equiv_kind, + CollectionElementFlag element_flags); + + /** + * @brief Build PlainSequenceSElemDefn instance. + * + * @pre bound > 0 (INVALID_SBOUND) + * @pre element_identifier has been initialized. + * @param[in] header PlainCollectionHeader to be set. + * @param[in] bound Sequence bound. + * @param[in] element_identifier Sequence element TypeIdentifier. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception + * 1. The given bound is 0. + * 2. The given TypeIdentifier EquivalenceKind is not consistent with the one contained in the header. + * 3. Inconsistent header (only in Debug build mode). + * 4. Inconsistent element_identifier (only in Debug build mode). + * @return const PlainSequenceSElemDefn instance. + */ + FASTDDS_EXPORTED_API static const PlainSequenceSElemDefn build_plain_sequence_s_elem_defn( + const PlainCollectionHeader& header, + SBound s_bound, + const eprosima::fastcdr::external& element_identifier); + + /** + * @brief Build PlainSequenceLElemDefn instance. + * + * @pre bound > 255 + * @pre element_identifier has been initialized. + * @param[in] header PlainCollectionHeader to be set. + * @param[in] bound Sequence bound. + * @param[in] element_identifier Sequence element TypeIdentifier. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception + * 1. Bound lower than 256. + * 2. The given TypeIdentifier EquivalenceKind is not consistent with the one contained in the header. + * 3. Inconsistent header (only in Debug build mode). + * 4. Inconsistent element_identifier (only in Debug build mode). + * @return const PlainSequenceLElemDefn instance. + */ + FASTDDS_EXPORTED_API static const PlainSequenceLElemDefn build_plain_sequence_l_elem_defn( + const PlainCollectionHeader& header, + LBound bound, + const eprosima::fastcdr::external& element_identifier); + + /** + * @brief Add dimension bound to the array bound sequence. + * + * @tparam array Either a SBoundSeq or LBoundSeq. + * @tparam element Either a SBound or LBound. + * @param[in out] array_bound_seq Sequence with the array bounds. + * @param[in] dimension_bound Dimension bound to be added into the sequence. + */ + template + static void add_array_dimension( + std::vector& array_bound_seq, + element dimension_bound) + { + if (dimension_bound == INVALID_LBOUND) + { + throw InvalidArgumentError("bound parameter must be greater than 0"); + } + array_bound_seq.push_back(dimension_bound); + } + + /** + * @brief Build PlainArraySElemDefn instance. + * + * @pre Any element in array_bound_seq must be greater than 0 (INVALID_SBOUND) + * @pre element_identifier has been initialized. + * @param[in] header PlainCollectionHeader to be set. + * @param[in] array_bound_seq Bounds for the array dimensions. + * @param[in] element_identifier Array element TypeIdentifier. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception + * 1. Any given bound in array_bound_seq is 0. + * 2. The given TypeIdentifier EquivalenceKind is not consistent with the one contained in the header. + * 3. Inconsistent header (only in Debug build mode). + * 4. Inconsistent element_identifier (only in Debug build mode). + * @return const PlainArraySElemDefn instance. + */ + FASTDDS_EXPORTED_API static const PlainArraySElemDefn build_plain_array_s_elem_defn( + const PlainCollectionHeader& header, + const SBoundSeq& array_bound_seq, + const eprosima::fastcdr::external& element_identifier); + + /** + * @brief Build PlainArrayLElemDefn instance. + * + * @pre At least one element of array_bound_seq must be greater than 255 and no element must be 0 (INVALID_SBOUND) + * @pre element_identifier has been initialized. + * @param[in] header PlainCollectionHeader to be set. + * @param[in] array_bound_seq Bounds for the array dimensions. + * @param[in] element_identifier Array element TypeIdentifier. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception + * 1. Any given bound in array_bound_seq is 0. + * 2. There is no dimension with a bound greater than 255. + * 3. The given TypeIdentifier EquivalenceKind is not consistent with the one contained in the header. + * 4. Inconsistent header (only in Debug build mode). + * 5. Inconsistent element_identifier (only in Debug build mode). + * @return const PlainArrayLElemDefn instance. + */ + FASTDDS_EXPORTED_API static const PlainArrayLElemDefn build_plain_array_l_elem_defn( + const PlainCollectionHeader& header, + const LBoundSeq& array_bound_seq, + const eprosima::fastcdr::external& element_identifier); + + /** + * @brief Build PlainMapSTypeDefn instance. + * + * @pre bound > 0 (INVALID_SBOUND) + * @pre Both element_identifier and key_identifier have been initialized. + * @param[in] header PlainCollectionHeader to be set. + * @param[in] bound Map bound. + * @param[in] element_identifier Map element TypeIdentifier. + * @param[in] key_flags Flags applying to map key. + * @param[in] key_identifier Map key TypeIdentifier. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception + * 1. Given bound is zero (INVALID_SBOUND) + * 2. Inconsistent element_identifier EquivalenceKind with the one contained in the header. + * 3. Direct hash key_identifier or indirect hash TypeIdentifier with exception to string/wstring. + * XTypes v1.3 Clause 7.2.2.4.3: Implementers of this specification need only support key elements + * of signed and unsigned integer types and of narrow and wide string types. + * 4. Inconsistent key_flags. + * 5. Inconsistent header (only in Debug build mode). + * 6. Inconsistent element_identifier or key_identifier (only in Debug build mode). + * @return const PlainMapSTypeDefn instance. + */ + FASTDDS_EXPORTED_API static const PlainMapSTypeDefn build_plain_map_s_type_defn( + const PlainCollectionHeader& header, + const SBound bound, + const eprosima::fastcdr::external& element_identifier, + const CollectionElementFlag key_flags, + const eprosima::fastcdr::external& key_identifier); + + /** + * @brief Build PlainMapLTypeDefn instance. + * + * @pre bound > 255 + * @pre Both element_identifier and key_identifier have been initialized. + * @param[in] header PlainCollectionHeader to be set. + * @param[in] bound Map bound. + * @param[in] element_identifier Map element TypeIdentifier. + * @param[in] key_flags Flags applying to map key. + * @param[in] key_identifier Map key TypeIdentifier. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception + * 1. Given bound is lower than 256 + * 2. Inconsistent element_identifier EquivalenceKind with the one contained in the header. + * 3. Direct hash key_identifier or indirect hash TypeIdentifier with exception to string/wstring. + * XTypes v1.3 Clause 7.2.2.4.3: Implementers of this specification need only support key elements + * of signed and unsigned integer types and of narrow and wide string types. + * 4. Inconsistent key_flags. + * 5. Inconsistent header (only in Debug build mode). + * 6. Inconsistent element_identifier or key_identifier (only in Debug build mode). + * @return const PlainMapLTypeDefn instance. + */ + FASTDDS_EXPORTED_API static const PlainMapLTypeDefn build_plain_map_l_type_defn( + const PlainCollectionHeader& header, + const LBound bound, + const eprosima::fastcdr::external& element_identifier, + const CollectionElementFlag key_flags, + const eprosima::fastcdr::external& key_identifier); + + /** + * @brief Build StronglyConnectedComponentId instance. + * + * @param[in] sc_component_id Strongly Connected Component (SCC) ID. + * @param[in] scc_length Number of components within SCC. + * @param[in] scc_index Identify specific component within SCC. + * @return const StronglyConnectedComponentId instance. + */ + FASTDDS_EXPORTED_API static const StronglyConnectedComponentId build_strongly_connected_component_id( + const TypeObjectHashId& sc_component_id, + int32_t scc_length, + int32_t scc_index); + + /** + * @brief Build ExtendedTypeDefn instance (empty. Available for future extension). + * + * @return const ExtendedTypeDefn instance. + */ + FASTDDS_EXPORTED_API static const ExtendedTypeDefn build_extended_type_defn(); + + /*************** Register Indirect Hash TypeIdentifiers ***************************/ + /** + * Primitive types are registered when TypeObjectRegistry is instantiated. + */ + + /** + * @brief Register small string/wstring TypeIdentifier into TypeObjectRegistry. + * + * @param[in] string StringSTypeDefn union member to set. + * @param[in] type_name Type name to be registered. + * @param[in] wstring Flag to build a wstring. Default false. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if the given member is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeIdentifier registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_s_string_type_identifier( + const StringSTypeDefn& string, + const std::string& type_name, + bool wstring = false); + + /** + * @brief Register large string/wstring TypeIdentifier into TypeObjectRegistry. + * + * @param[in] string StringLTypeDefn union member to set. + * @param[in] type_name Type name to be registered. + * @param[in] wstring Flag to build a wstring. Default false. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if the given member is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeIdentifier registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_l_string_type_identifier( + const StringLTypeDefn& string, + const std::string& type_name, + bool wstring = false); + + /** + * @brief Register small sequence TypeIdentifier into TypeObjectRegistry. + * + * @param[in] plain_seq PlainSequenceSElemDefn union member to set. + * @param[in] type_name Type name to be registered. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if the given member is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeIdentifier registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_s_sequence_type_identifier( + const PlainSequenceSElemDefn& plain_seq, + const std::string& type_name); + + /** + * @brief Register large sequence TypeIdentifier into TypeObjectRegistry. + * + * @param[in] plain_seq PlainSequenceLElemDefn union member to set. + * @param[in] type_name Type name to be registered. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if the given member is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeIdentifier registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_l_sequence_type_identifier( + const PlainSequenceLElemDefn& plain_seq, + const std::string& type_name); + + /** + * @brief Register small array TypeIdentifier into TypeObjectRegistry. + * + * @param[in] plain_array PlainArraySElemDefn union member to set. + * @param[in] type_name Type name to be registered. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if the given member is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeIdentifier registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_s_array_type_identifier( + const PlainArraySElemDefn& plain_array, + const std::string& type_name); + + /** + * @brief Register large array TypeIdentifier into TypeObjectRegistry. + * + * @param[in] plain_array PlainArrayLElemDefn union member to set. + * @param[in] type_name Type name to be registered. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if the given member is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeIdentifier registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_l_array_type_identifier( + const PlainArrayLElemDefn& plain_array, + const std::string& type_name); + + /** + * @brief Register small map TypeIdentifier into TypeObjectRegistry. + * + * @param[in] plain_map PlainMapSTypeDefn union member to set. + * @param[in] type_name Type name to be registered. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if the given member is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeIdentifier registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_s_map_type_identifier( + const PlainMapSTypeDefn& plain_map, + const std::string& type_name); + + /** + * @brief Register large map TypeIdentifier into TypeObjectRegistry. + * + * @param[in] plain_map PlainMapLTypeDefn union member to set. + * @param[in] type_name Type name to be registered. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if the given member is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeIdentifier registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_l_map_type_identifier( + const PlainMapLTypeDefn& plain_map, + const std::string& type_name); + + /** + * @brief Register StronglyConnectedComponent TypeIdentifier into TypeObjectRegistry. + * + * @param[in] scc StronglyConnectedComponent union member to set. + * @param[in] type_name Type name to be registered. + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeIdentifier registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_scc_type_identifier( + const StronglyConnectedComponentId& scc, + const std::string& type_name); + + /*************** Annotation usage ***************************/ + /** + * @brief Build ExtendedAnnotationParameterValue instance (empty. Available for future extension). + * + * @return const ExtendedAnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const ExtendedAnnotationParameterValue build_extended_annotation_parameter_value(); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] boolean_value Boolean value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + bool boolean_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] byte_value Byte value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value_byte( + uint8_t byte_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] int8_value Int8 value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + int8_t int8_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] uint8_value Unsigned int8 value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + uint8_t uint8_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] int16_value Short value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + int16_t int16_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] uint16_value Unsigned short value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + uint16_t uint16_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] int32_value Long value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + int32_t int32_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] uint32_value Unsigned long value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + uint32_t uint32_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] int64_value Long long value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + int64_t int64_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] uint64_value Unsigned long long value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + uint64_t uint64_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] float32_value Float value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + float float32_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] float64_value Double value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + double float64_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] float128_value Long double value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + long double float128_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] char_value Char value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + char char_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] wchar_value Wide char value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + wchar_t wchar_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] enumerated_value Enumerated value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value_enum( + int32_t enumerated_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] string8_value String value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + const eprosima::fastcdr::fixed_string<128>& string8_value); + + /** + * @brief Build AnnotationParameterValue instance. + * + * @param[in] string16_value Wide string value to set in the union. + * @return const AnnotationParameterValue instance. + */ + FASTDDS_EXPORTED_API static const AnnotationParameterValue build_annotation_parameter_value( + const std::wstring& string16_value); + + /** + * @brief Build AppliedAnnotationParameter instance. + * + * @param[in] paramname_hash Parameter name hash. + * @param[in] value Parameter value. + * @return const AppliedAnnotationParameter instance. + */ + FASTDDS_EXPORTED_API static const AppliedAnnotationParameter build_applied_annotation_parameter( + const NameHash& paramname_hash, + const AnnotationParameterValue& value); + + /** + * @brief Add AppliedAnnotationParameter to the sequence. + * + * @param[in out] param_seq AppliedAnnotationParameter sequence to be modified. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if the parameter being added has + * already been included in the sequence. + * @param[in] param AppliedAnnotationParameter to be added. + */ + FASTDDS_EXPORTED_API static void add_applied_annotation_parameter( + AppliedAnnotationParameterSeq& param_seq, + const AppliedAnnotationParameter& param); + + /** + * @brief Build AppliedAnnotation instance. + * + * @param[in] annotation_typeid Annotation TypeIdentifier. + * @param[in] param_seq Annotation parameters. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Given annotation_typeid TypeIdentifier does not correspond to an annotation TypeObject (only in + * Debug build mode). + * 2. Given AppliedAnnotationParameterSeq is inconsistent (only in Debug build mode). + * 3. Given annotation TypeIdentifier corresponds to a builtin annotation and the given parameters are + * inconsistent (only in Debug build mode). + * @return const AppliedAnnotation instance. + */ + FASTDDS_EXPORTED_API static const AppliedAnnotation build_applied_annotation( + const TypeIdentifier& annotation_typeid, + const eprosima::fastcdr::optional& param_seq); + + /** + * @brief Add AppliedAnnotation to the sequence. + * + * @param[in out] ann_custom_seq AppliedAnnotation sequence to be modified. + * @param[in] ann_custom AppliedAnnotation to be added. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Given AppliedAnnotation is not consistent (only in Debug build mode). + * 2. Given AppliedAnnotation is already present in the sequence. + */ + FASTDDS_EXPORTED_API static void add_applied_annotation( + AppliedAnnotationSeq& ann_custom_seq, + const AppliedAnnotation& ann_custom); + + /** + * @brief Build AppliedVerbatimAnnotation instance. + * + * @param[in] placement Verbatim annotation placement parameter. + * @param[in] language Verbatim annotation language parameter. + * @param[in] text Verbatim annotation text parameter. + * @return const AppliedVerbatimAnnotation instance. + */ + FASTDDS_EXPORTED_API static const AppliedVerbatimAnnotation build_applied_verbatim_annotation( + PlacementKind placement, + const eprosima::fastcdr::fixed_string<32>& language, + const std::string& text); + + /*************** Aggregate types: ***************************/ + /** + * @brief Build AppliedBuiltinMemberAnnotations instance. + * + * @param[in] unit Unit annotation value. + * @param[in] min Min annotation value. + * @param[in] max Max annotation value. + * @param[in] hash_id Hashid annotation value. + * @return const AppliedBuiltinMemberAnnotations instance. + */ + FASTDDS_EXPORTED_API static const AppliedBuiltinMemberAnnotations build_applied_builtin_member_annotations( + const eprosima::fastcdr::optional& unit, + const eprosima::fastcdr::optional& min, + const eprosima::fastcdr::optional& max, + const eprosima::fastcdr::optional& hash_id); + + /** + * @brief Build CommonStructMember instance. + * + * @param[in] member_id Member identifier. + * @param[in] member_flags Member flags: optional, must_understand, key, and external. + * @param[in] member_type_id Member TypeIdentifier. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception: + * 1. The given flags are not consistent (only in Debug build mode). + * 2. The given TypeIdentifier is not consistent (only in Debug build mode). + * @return const CommonStructMember instance. + */ + FASTDDS_EXPORTED_API static const CommonStructMember build_common_struct_member( + MemberId member_id, + StructMemberFlag member_flags, + const TypeIdentifier& member_type_id); + + /** + * @brief Build CompleteMemberDetail instance. + * + * @param[in] name Member name. + * @param[in] ann_builtin Member builtin annotations. + * @param[in] ann_custom Member custom annotations. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Empty member name. + * 2. Given AppliedAnnotationSeq is not consistent (only Debug build mode). + * @return const CompleteMemberDetail instance. + */ + FASTDDS_EXPORTED_API static const CompleteMemberDetail build_complete_member_detail( + const MemberName& name, + const eprosima::fastcdr::optional& ann_builtin, + const eprosima::fastcdr::optional& ann_custom); + + /** + * MinimalMemberDetail constructed from CompleteMemberDetail + */ + + /** + * @brief Build CompleteStructMember instance. + * + * @param[in] common CommonStructMember to be set. + * @param[in] detail CompleteMemberDetail to be set. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Given CommonStructMember is inconsistent (only Debug build mode). + * 2. Given CompleteMemberDetail is inconsistent (only Debug build mode). + * @return const CompleteMemberDetail instance. + */ + FASTDDS_EXPORTED_API static const CompleteStructMember build_complete_struct_member( + const CommonStructMember& common, + const CompleteMemberDetail& detail); + + /** + * @brief Add CompleteStructMember to the sequence. + * + * @param[in out] member_seq CompleteStructMember sequence to be modified. + * @param[in] ann_custom CompleteStructMember to be added. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Given CompleteStructMember is not consistent (only in Debug build mode). + * 2. There is already another member in the sequence with the same member id or the same member name + * (only in Debug build mode). + */ + FASTDDS_EXPORTED_API static void add_complete_struct_member( + CompleteStructMemberSeq& member_seq, + const CompleteStructMember& member); + + /** + * MinimalStructMember constructed from CompleteStructMember + */ + + /** + * @brief Build AppliedBuiltinTypeAnnotations instance. + * + * @param[in] verbatim AppliedVerbatimAnnotation to be set. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if the given verbatim annotation + * is inconsistent (only in Debug build mode). + * @return const AppliedBuiltinTypeAnnotations instance. + */ + FASTDDS_EXPORTED_API static const AppliedBuiltinTypeAnnotations build_applied_builtin_type_annotations( + const eprosima::fastcdr::optional& verbatim); + + /** + * MinimalTypeDetail constructed from CompleteTypeDetail: empty. Available for future extension. + */ + + /** + * @brief Build CompleteTypeDetail instance. + * + * @param[in] ann_builtin Verbatim annotation. + * @param[in] ann_custom Applied annotations. + * @param[in] type_name Name of the type. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Given type_name is empty. + * 2. any applied annotation is not consistent (only Debug build mode). + * @return const CompleteTypeDetail instance. + */ + FASTDDS_EXPORTED_API static const CompleteTypeDetail build_complete_type_detail( + const eprosima::fastcdr::optional& ann_builtin, + const eprosima::fastcdr::optional& ann_custom, + const QualifiedTypeName& type_name); + + /** + * @brief Build CompleteStructHeader instance. + * + * @param[in] base_type TypeIdentifier of the parent structure (inheritance). + * @param[in] detail CompleteTypeDetail. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Given TypeIdentifier is not consistent (direct HASH or empty TypeIdentifier). In Debug build + * mode the corresponding TypeObject is also checked in case of direct HASH TypeIdentifier. + * 2. Given CompleteTypeDetail is not consistent (only in Debug build mode). + * @return const CompleteStructHeader instance. + */ + FASTDDS_EXPORTED_API static const CompleteStructHeader build_complete_struct_header( + const TypeIdentifier& base_type, + const CompleteTypeDetail& detail); + + /** + * MinimalStructHeader constructed from CompleteStructHeader. + */ + + /** + * @brief Build CompleteStructType instance. + * + * @param[in] struct_flags StructTypeFlags. + * @param[in] header CompleteStructHeader. + * @param[in] member_seq Sequence of CompleteStructMembers. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Given StructTypeFlag is not consistent (only in Debug build mode). + * 2. Given CompleteStructHeader is not consistent (only in Debug build mode). + * 3. Given CompleteStructMemberSeq is not consistent (only in Debug build mode). + * 4. Given flags are not consistent with the builtin annotations. + * @return const CompleteStructType instance. + */ + FASTDDS_EXPORTED_API static const CompleteStructType build_complete_struct_type( + StructTypeFlag struct_flags, + const CompleteStructHeader& header, + const CompleteStructMemberSeq& member_seq); + + /** + * MinimalStructType constructed from CompleteStructType. + */ + + /*************** Union: *********************************************/ + + /** + * @brief Add label to the union case label sequence. + * + * @param[in out] label_seq Sequence to be modified. + * @param[in] label Label to be added. + */ + FASTDDS_EXPORTED_API static void add_union_case_label( + UnionCaseLabelSeq& label_seq, + int32_t label); + + /** + * @brief Build CommonUnionMember instance. + * + * @param[in] member_id Member identifier. + * @param[in] member_flags Member flags. + * @param[in] type_id Member TypeIdentifier. + * @param[in] label_seq Member applicable case labels. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Given UnionMemberFlags are not consistent (only Debug build mode). + * 2. Given TypeIdentifier is not consistent (only Debug build mode). + * @return const CommonUnionMember instance. + */ + FASTDDS_EXPORTED_API static const CommonUnionMember build_common_union_member( + MemberId member_id, + UnionMemberFlag member_flags, + const TypeIdentifier& type_id, + const UnionCaseLabelSeq& label_seq); + + /** + * @brief Build CompleteUnionMember instance. + * + * @param[in] common CommonUnionMember. + * @param[in] detail CompleteMemberDetail. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Given CommonUnionMember is not consistent (only in Debug build mode). + * 2. Given CompleteMemberDetail is not consistent (only in Debug build mode). + * @return const CompleteUnionMember instance. + */ + FASTDDS_EXPORTED_API static const CompleteUnionMember build_complete_union_member( + const CommonUnionMember& common, + const CompleteMemberDetail& detail); + + /** + * @brief Add CompleteUnionMember to sequence. + * + * @param[in out] complete_union_member_seq Sequence to be modified. + * @param[in] member Complete union member to be added. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Given CompleteUnionMember is not consistent (only in Debug build mode). + * 2. There is already another member in the sequence with the same member id or the same member name + * (only in Debug build mode). + * 3. If the given member is marked as default, if there is already another member marked as default + * (only in Debug build mode). + * 4. There are repeated union case labels (only in Debug build mode). + * 5. Member name is protected ("discriminator"). + */ + FASTDDS_EXPORTED_API static void add_complete_union_member( + CompleteUnionMemberSeq& complete_union_member_seq, + const CompleteUnionMember& member); + + /** + * MinimalUnionMember constructed from CompleteUnionMember. + */ + + /** + * @brief Build CommonDiscriminatorMember instance. + * + * @param[in] member_flags Discriminator flags. + * @param[in] type_id Discriminator TypeIdentifier. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Given discriminator flags are inconsistent (only in Debug build mode). + * 2. Given TypeIdentifier is not consistent. + * XTypes v1.3 Clause 7.2.2.4.4.3 The discriminator of a union must be one of the following types: + * Boolean, Byte, Char8, Char16, Int8, Uint8, Int16, Uint16, Int32, Uint32, Int64, Uint64, any + * enumerated type, any alias type that resolves, directly or indirectly, to one of the + * aforementioned types. + * @return const CommonDiscriminatorMember instance. + */ + FASTDDS_EXPORTED_API static const CommonDiscriminatorMember build_common_discriminator_member( + UnionDiscriminatorFlag member_flags, + const TypeIdentifier& type_id); + + /** + * @brief Build CompleteDiscriminatorMember instance. + * + * @param[in] common CommonDiscriminatorMember. + * @param[in] ann_builtin Verbatim annotation. + * @param[in] ann_custom Applied annotations. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Given CommonDiscriminatorMember is inconsistent (only in Debug build mode). + * 2. AppliedBuiltinTypeAnnotation is inconsistent (only in Debug build mode). + * 3. Any given AppliedAnnotation is inconsistent (only in Debug build mode). + * 4. CommonDiscriminatorMember is inconsistent with given builtin annotations. + * @return const CompleteDiscriminatorMember instance. + */ + FASTDDS_EXPORTED_API static const CompleteDiscriminatorMember build_complete_discriminator_member( + const CommonDiscriminatorMember& common, + const eprosima::fastcdr::optional& ann_builtin, + const eprosima::fastcdr::optional& ann_custom); + + /** + * MinimalDiscriminatorMember constructed from CompleteDiscriminatorMember. + */ + + /** + * @brief Build CompleteUnionHeader instance. + * + * @param detail CompleteTypeDetail. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if the given CompleteTypeDetail is + * not consistent (only in Debug build mode). + * @return const CompleteUnionHeader instance. + */ + FASTDDS_EXPORTED_API static const CompleteUnionHeader build_complete_union_header( + const CompleteTypeDetail& detail); + + /** + * MinimalUnionHeader constructed from CompleteUnionHeader. + */ + + /** + * @brief Build CompleteUnionType instance. + * + * @param[in] union_flags + * @param[in] header + * @param[in] discriminator + * @param[in] member_seq + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Given UnionTypeFlags are not consistent (only in Debug build mode). + * 2. Given CompleteUnionHeader is not consistent (only in Debug build mode). + * 3. Given CompleteDiscriminatorMember inconsistent (only in Debug build mode). + * 4. Given CompleteUnionMemberSeq is not consistent (only in Debug build mode). + * 5. Given flags are not consistent with the builtin annotations. + * @return const CompleteUnionType instance. + */ + FASTDDS_EXPORTED_API static const CompleteUnionType build_complete_union_type( + UnionTypeFlag union_flags, + const CompleteUnionHeader& header, + const CompleteDiscriminatorMember& discriminator, + const CompleteUnionMemberSeq& member_seq); + + /** + * MinimalUnionType constructed from CompleteUnionType. + */ + + /*************** Annotation: ****************************************/ + + /** + * @brief Build CommonAnnotationParameter instance. + * + * @param[in] member_flags AnnotationParameterFlag: empty. No flags apply. It must be zero. + * @param[in] member_type_id Member TypeIdentifier. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Given AnnotationParameterFlag are not empty. + * 2. Given TypeIdentifier is not consistent (only in Debug build mode). + * @return const CommonAnnotationParameter instance. + */ + FASTDDS_EXPORTED_API static const CommonAnnotationParameter build_common_annotation_parameter( + AnnotationParameterFlag member_flags, + const TypeIdentifier& member_type_id); + + /** + * @brief Build CompleteAnnotationParameter instance. + * + * @param[in] common CommonAnnotationParameter. + * @param[in] name Member name. + * @param[in] default_value Annotation default value. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Given CommonAnnotationParameter is inconsistent (only in Debug build mode). + * 2. CommonAnnotationParameter TypeIdentifier is inconsistent with AnnotationParameterValue type. + * 3. Given parameter name is empty. + * @return const CompleteAnnotationParameter instance. + */ + FASTDDS_EXPORTED_API static const CompleteAnnotationParameter build_complete_annotation_parameter( + const CommonAnnotationParameter& common, + const MemberName& name, + const AnnotationParameterValue& default_value); + + /** + * @brief Add CompleteAnnotationParameter to sequence. + * + * @param[in out] sequence Sequence to be modified. + * @param[in] param Complete annotation parameter to be added. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Given CompleteAnnotationParameter is not consistent (only in Debug build mode). + * 2. There is already another member in the sequence with the same member id or the same member name + * (only in Debug build mode). + */ + FASTDDS_EXPORTED_API static void add_complete_annotation_parameter( + CompleteAnnotationParameterSeq& sequence, + const CompleteAnnotationParameter& param); + + /** + * MinimalAnnotationParameter constructed from CompleteAnnotationParameter. + */ + + /** + * @brief Build CompleteAnnotationHeader instance. + * + * @param[in] annotation_name Qualified annotation type name. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError if the annotation_name is empty. + * @return const CompleteAnnotationHeader instance. + */ + FASTDDS_EXPORTED_API static const CompleteAnnotationHeader build_complete_annotation_header( + const QualifiedTypeName& annotation_name); + + /** + * MinimalAnnotationHeader constructed from CompleteAnnotationHeader: empty. Available for future extension. + */ + + /** + * @brief Build CompleteAnnotationType instance. + * + * @param[in] annotation_flag Unused. No flags apply. It must be 0. + * @param[in] header CompleteAnnotationHeader. + * @param[in] member_seq CompleteAnnotationParameter sequence. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Any annotation flag is set. + * 2. Given header is inconsistent (only in Debug build mode). + * 3. Any CompleteAnnotationParameter in the sequence is inconsistent (only in Debug build mode). + * @return const CompleteAnnotationType instance. + */ + FASTDDS_EXPORTED_API static const CompleteAnnotationType build_complete_annotation_type( + AnnotationTypeFlag annotation_flag, + const CompleteAnnotationHeader& header, + const CompleteAnnotationParameterSeq& member_seq); + + /** + * MinimalAnnotationType constructed from CompleteAnnotationType. + */ + + /*************** Alias: *********************************************/ + + /** + * @brief Build CommonAliasBody instance. + * + * @param[in] related_flags AliasMemberFlag: unused. No flags apply. It must be 0. + * @param[in] related_type Related TypeIdentifier. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Any alias member flag is set. + * 2. Non-consistent TypeIdentifier (only in Debug build mode). + * @return const CommonAliasBody instance. + */ + FASTDDS_EXPORTED_API static const CommonAliasBody build_common_alias_body( + AliasMemberFlag related_flags, + const TypeIdentifier& related_type); + + /** + * @brief Build CompleteAliasBody instance. + * + * @param[in] common CommonAliasBody. + * @param[in] ann_builtin Applied builtin member annotations: unit, max, min, range, hashid + * @param[in] ann_custom Applied custom annotations + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Given CommonAliasBody is inconsistent (only Debug build mode). + * 2. AppliedAnnotationSeq is inconsistent (only Debug build mode). + * 3. @hashid builtin annotation is set. + * @return const CompleteAliasBody instance. + */ + FASTDDS_EXPORTED_API static const CompleteAliasBody build_complete_alias_body( + const CommonAliasBody& common, + const eprosima::fastcdr::optional& ann_builtin, + const eprosima::fastcdr::optional& ann_custom); + + /** + * MinimalAliasBody constructed from CompleteAliasBody. + */ + + /** + * @brief Build CompleteAliasHeader instance. + * + * @param[in] detail Complete type detail. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if the given CompleteTypeDetail is + * inconsistent (only in Debug build mode). + * @return const CompleteAliasHeader instance. + */ + FASTDDS_EXPORTED_API static const CompleteAliasHeader build_complete_alias_header( + const CompleteTypeDetail& detail); + + /** + * MinimalAliasHeader constructed from CompleteAliasHeader: empty. Available for future extension. + */ + + /** + * @brief Build CompleteAliasType instance. + * + * @param[in] alias_flags Alias type flags: unused. No flags apply. It must be zero. + * @param[in] header CompleteAliasHeader. + * @param[in] body CompleteAliasBody. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Any alias type flag is set. + * 2. Inconsistent header and/or body (only in Debug build mode). + * @return const CompleteAliasType instance. + */ + FASTDDS_EXPORTED_API static const CompleteAliasType build_complete_alias_type( + AliasTypeFlag alias_flags, + const CompleteAliasHeader& header, + const CompleteAliasBody& body); + + /** + * MinimalAliasType constructed from CompleteAliasType. + */ + + /*************** Collections: ***************************************/ + + /** + * @brief Build CompleteElementDetail instance. + * + * @param[in] ann_builtin Applied builtin member annotations: unit, max, min, range, hashid + * @param[in] ann_custom Applied custom annotations + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. AppliedAnnotationSeq is inconsistent (only Debug build mode). + * 2. @hashid builtin annotation is applied. + * @return const CompleteElementDetail instance. + */ + FASTDDS_EXPORTED_API static const CompleteElementDetail build_complete_element_detail( + const eprosima::fastcdr::optional& ann_builtin, + const eprosima::fastcdr::optional& ann_custom); + + /** + * @brief Build CommonCollectionElement instance. + * + * @param[in] element_flags CollectionElementFlag. + * @param[in] type TypeIdentifier. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Given collection element flags are not consistent (only in Debug build mode). + * 2. Given TypeIdentifier is not consistent (only in Debug build mode). + * @return const CommonCollectionElement instance + */ + FASTDDS_EXPORTED_API static const CommonCollectionElement build_common_collection_element( + CollectionElementFlag element_flags, + const TypeIdentifier& type); + + /** + * @brief Build CompleteCollectionElement instance. + * + * @param[in] common CommonCollectionElement. + * @param[in] detail CompleteElementDetail. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Given CommonCollectionElement is not consistent (only in Debug build mode). + * 2. Given CompleteElementDetail is not consistent (only in Debug build mode). + * @return const CompleteCollectionElement instance + */ + FASTDDS_EXPORTED_API static const CompleteCollectionElement build_complete_collection_element( + const CommonCollectionElement& common, + const CompleteElementDetail& detail); + + /** + * MinimalCollectionElement constructed from CompleteCollectionElement. + */ + + /** + * @brief Build CommonCollectionHeader instance. + * + * @param[in] bound Collection bound. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if the given bound is not + * consistent. + * @return const CommonCollectionHeader instance. + */ + FASTDDS_EXPORTED_API static const CommonCollectionHeader build_common_collection_header( + LBound bound); + + /** + * @brief Build CompleteCollectionHeader instance. + * + * @param[in] common CommonCollectionHeader + * @param[in] detail CompleteTypeDetail + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Given CommonCollectionHeader is inconsistent (only in Debug build mode). + * 2. Given CompleteTypeDetail is inconsistent (only in Debug build mode). + * @return const CompleteCollectionHeader instance. + */ + FASTDDS_EXPORTED_API static const CompleteCollectionHeader build_complete_collection_header( + const CommonCollectionHeader& common, + const eprosima::fastcdr::optional& detail); + + /** + * MinimalCollectionHeader constructed from CompleteCollectionHeader. + */ + + /*************** Sequence: ******************************************/ + + /** + * @brief Build CompleteSequenceType instance. + * + * @param[in] collection_flag collection type flag: unused. No flags apply. It must be 0. + * @param[in] header CompleteCollectionHeader. + * @param[in] element CompleteCollectionElement. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Any collection flag is set. + * 2. Given header is inconsistent (only in Debug build mode). + * 3. Given element is inconsistent (only in Debug build mode). + * @return const CompleteSequenceType instance + */ + FASTDDS_EXPORTED_API static const CompleteSequenceType build_complete_sequence_type( + CollectionTypeFlag collection_flag, + const CompleteCollectionHeader& header, + const CompleteCollectionElement& element); + + /** + * MinimalSequenceType constructed from CompleteSequenceType. + */ + + /*************** Array: *********************************************/ + + /** + * @brief Build CommonArrayHeader instance. + * + * @param[in] bound_seq Sequence of the dimension's bounds. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if any given bound is 0 (invalid). + * @return const CommonArrayHeader instance. + */ + FASTDDS_EXPORTED_API static const CommonArrayHeader build_common_array_header( + const LBoundSeq& bound_seq); + + /** + * @brief Build CompleteArrayHeader instance. + * + * @param[in] common CommonArrayHeader. + * @param[in] detail CompleteTypeDetail. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Given CommonArrayHeader is inconsistent (only in Debug build mode). + * 2. Given CompleteTypeDetail is inconsistent (only in Debug build mode). + * @return const CompleteArrayHeader instance. + */ + FASTDDS_EXPORTED_API static const CompleteArrayHeader build_complete_array_header( + const CommonArrayHeader& common, + const CompleteTypeDetail& detail); + + /** + * MinimalArrayHeader constructed from CompleteArrayHeader. + */ + + /** + * @brief Build CompleteArrayType instance. + * + * @param[in] collection_flag collection type flag: unused. No flags apply. It must be 0. + * @param[in] header CompleteArrayHeader. + * @param[in] element CompleteCollectionElement. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Any collection flag is set. + * 2. Given header is inconsistent (only in Debug build mode). + * 3. Given element is inconsistent (only in Debug build mode). + * @return const CompleteArrayType instance. + */ + FASTDDS_EXPORTED_API static const CompleteArrayType build_complete_array_type( + CollectionTypeFlag collection_flag, + const CompleteArrayHeader& header, + const CompleteCollectionElement& element); + + /** + * MinimalArrayType constructed from CompleteArrayType. + */ + + /*************** Map: ***********************************************/ + + /** + * @brief Build CompleteMapType instance. + * + * @param[in] collection_flag collection type flag: unused. No flags apply. It must be 0. + * @param[in] header CompleteArrayHeader. + * @param[in] key CompleteCollectionElement describing map key. + * @param[in] element CompleteCollectionElement describing map element. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Any collection flag is set. + * 2. Given header is inconsistent (only in Debug build mode). + * 3. Given key TypeIdentifier is inconsistent. + * 4. Given key description is inconsistent (only in Debug build mode). + * 5. Given element is inconsistent (only in Debug build mode). + * @return const CompleteMapType instance. + */ + FASTDDS_EXPORTED_API static const CompleteMapType build_complete_map_type( + CollectionTypeFlag collection_flag, + const CompleteCollectionHeader& header, + const CompleteCollectionElement& key, + const CompleteCollectionElement& element); + + /** + * MinimalMapType constructed from CompleteMapType. + */ + + /*************** Enumeration: **************************************/ + + /** + * @brief Build CommonEnumeratedLiteral instance. + * + * @param[in] value Enumerated literal value. + * @param[in] flags Enumerated literal flags: only default flag apply. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if any other flag different from + * default is set (only in Debug build mode). + * @return const CommonEnumeratedLiteral instance. + */ + FASTDDS_EXPORTED_API static const CommonEnumeratedLiteral build_common_enumerated_literal( + int32_t value, + EnumeratedLiteralFlag flags); + + /** + * @brief Build CompleteEnumeratedLiteral instance. + * + * @param[in] common CommonEnumeratedLiteral. + * @param[in] detail CompleteMemberDetail. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Given CommonEnumeratedLiteral is inconsistent (only in Debug build mode). + * 2. Given CompleteMemberDetail is inconsistent (only in Debug build mode). + * @return const CompleteEnumeratedLiteral instance. + */ + FASTDDS_EXPORTED_API static const CompleteEnumeratedLiteral build_complete_enumerated_literal( + const CommonEnumeratedLiteral& common, + const CompleteMemberDetail& detail); + + /** + * @brief Add CompleteEnumeratedLiteral to sequence. + * + * @param[in] sequence Sequence to be modified. + * @param[in out] enum_literal CompleteEnumeratedLiteral to be added. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Given CommonEnumeratedLiteral is not consistent (only in Debug build mode). + * 2. There is already another literal in the sequence with the same value or the same member name + * (only in Debug build mode). + */ + FASTDDS_EXPORTED_API static void add_complete_enumerated_literal( + CompleteEnumeratedLiteralSeq& sequence, + const CompleteEnumeratedLiteral& enum_literal); + + /** + * MinimalEnumeratedLiteral constructed from CompleteEnumeratedLiteral. + */ + + /** + * @brief Build CommonEnumeratedHeader instance. + * + * @param[in] bit_bound XTypes v1.3 Clause 7.3.1.2.1.5 It is important to note that the value member of the + * [@bit_bound] annotation may take any value from 1 to 32, inclusive, when this annotation is + * applied to an enumerated type. + * @param[in] bitmask Flag in case that the header being built corresponds to a Bitmask. By default is false. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if the given bit_bound is not + * consistent. + * @return const CommonEnumeratedHeader instance. + */ + FASTDDS_EXPORTED_API static const CommonEnumeratedHeader build_common_enumerated_header( + BitBound bit_bound, + bool bitmask = false); + + /** + * @brief Build CompleteEnumeratedHeader instance. + * + * @param[in] common CommonEnumeratedHeader. + * @param[in] detail CompleteTypeDetail. + * @param[in] bitmask flag set if the given header corresponds to a bitmask. Only required in Debug build mode. + * Set to false by default. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Given CommonEnumeratedHeader is inconsistent (only in Debug build mode). + * 2. Given CompleteTypeDetail is inconsistent (only in Debug build mode). + * @return const CompleteEnumeratedHeader instance. + */ + FASTDDS_EXPORTED_API static const CompleteEnumeratedHeader build_complete_enumerated_header( + const CommonEnumeratedHeader& common, + const CompleteTypeDetail& detail, + bool bitmask = false); + + /** + * MinimalEnumeratedHeader constructed from CompleteEnumeratedHeader. + */ + + /** + * @brief Build CompleteEnumeratedType instance. + * + * @param[in] enum_flags Enumeration flags: unused. No flags apply. It must be 0. + * @param[in] header CompleteEnumeratedHeader. + * @param[in] literal_seq Sequence of CompleteEnumeratedLiterals. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Any flag is set. + * 2. Given CompleteEnumeratedHeader is inconsistent (only in Debug build mode). + * 3. Given CompleteEnumeratedLiteralSeq is inconsistent (only in Debug build mode). + * @return const CompleteEnumeratedType instance. + */ + FASTDDS_EXPORTED_API static const CompleteEnumeratedType build_complete_enumerated_type( + EnumTypeFlag enum_flags, + const CompleteEnumeratedHeader& header, + const CompleteEnumeratedLiteralSeq& literal_seq); + + /** + * MinimalEnumeratedType constructed from CompleteEnumeratedType. + */ + + /*************** Bitmask: *******************************************/ + + /** + * @brief Build CommonBitflag instance. + * + * @param[in] position Bit position in the bitmask. + * @param[in] flags Bit flags: unused. No flags apply. It must be 0. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. any given flag is set. + * 2. given position is inconsistent. XTypes v1.3 Clause 7.2.2.4.1.2 Each bit in this subset is + * identified by name and by an index, numbered from 0 to (bound-1). The bound must be greater than + * zero and no greater than 64. + * @return const CommonBitflag instance. + */ + FASTDDS_EXPORTED_API static const CommonBitflag build_common_bitflag( + uint16_t position, + BitflagFlag flags); + + /** + * @brief Build CompleteBitflag instance. + * + * @param[in] common CommonBitflag. + * @param[in] detail CompleteMemberDetail. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Given CommonBitflag is inconsistent (only in Debug build mode). + * 2. Given CompleteMemberDetail is inconsistent (only in Debug build mode). + * 3. Non-applicable builtin annotations applied. + * @return const CompleteBitflag instance. + */ + FASTDDS_EXPORTED_API static const CompleteBitflag build_complete_bitflag( + const CommonBitflag& common, + const CompleteMemberDetail& detail); + + /** + * @brief Add complete bitflag to the sequence. + * + * @param[in out] sequence Sequence to be modified. + * @param[in] bitflag CompleteBitflag to be added. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Given bitflag is inconsistent (only in Debug build mode). + * 2. There is already another bitflag in the sequence with the same position or the same name + * (only in Debug build mode). + */ + FASTDDS_EXPORTED_API static void add_complete_bitflag( + CompleteBitflagSeq& sequence, + const CompleteBitflag& bitflag); + + /** + * MinimalBitflag constructed from CompleteBitflag. + */ + + /** + * CommonBitmaskHeader is not used. + * CompleteBitmaskHeader is defined as CompleteEnumeratedHeader. + * MinimalBitmaskHeader is defined as MinimalEnumeratedHeader. + */ + + /** + * @brief Build CompleteBitmaskType instance. + * + * @param[in] bitmask_flags Bitmask flags: unused. No flags apply. It must be 0. + * @param[in] header CompleteBitmaskHeader/CompleteEnumeratedHeader + * @param[in] flag_seq Sequence of CompleteBitflag. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. any given flag is set. + * 2. Given header is inconsistent (only in Debug build mode). + * 3. Given Bitflag sequence is inconsistent (only in Debug build mode). + * @return const CompleteBitmaskType instance. + */ + FASTDDS_EXPORTED_API static const CompleteBitmaskType build_complete_bitmask_type( + BitmaskTypeFlag bitmask_flags, + const CompleteBitmaskHeader& header, + const CompleteBitflagSeq& flag_seq); + + /*************** Bitset: ********************************************/ + + /** + * @brief Build CommonBitfield instance. + * + * @param[in] position Bitfield starting position bit. + * @param[in] flags Bitfield flags: unused. No flags apply. It must be 0. + * @param[in] bitcount Bitfield number of bits. IDL v4.2 Clause 7.4.13.4.3.2 The first one () is + * the number of bits that can be stored (its [bitfield] size). The maximum value is 64. + * @param[in] holder_type Type used to manipulate the bitfield. IDL v4.2 Clause 7.4.13.4.3.2 The second optional one + * () specifies the type that will be used to manipulate the bit field as a + * whole. This type can be boolean, octet or any integer type either signed or unsigned. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Given position is not consistent. + * 2. Any flag is set. + * 3. Given bitcount is not consistent. + * 4. Given holder_type is not consistent. + * @return const CommonBitfield instance. + */ + FASTDDS_EXPORTED_API static const CommonBitfield build_common_bitfield( + uint16_t position, + BitsetMemberFlag flags, + uint8_t bitcount, + TypeKind holder_type); + + /** + * @brief Build CompleteBitfield instance. + * + * @param[in] common CommonBitfield. + * @param[in] detail CompleteMemberDetail. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Given CommonBitfield is inconsistent (only Debug build mode). + * 2. Give CompleteMemberDetail is inconsistent (only Debug build mode). + * 3. Non-applicable builtin annotations are applied. + * @return const CompleteBitfield instance. + */ + FASTDDS_EXPORTED_API static const CompleteBitfield build_complete_bitfield( + const CommonBitfield& common, + const CompleteMemberDetail& detail); + + /** + * @brief Add complete bitfield to the sequence. + * + * @param[in out] sequence Sequence to be modified. + * @param[in] bitfield CompleteBitfield to be added. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Given bitfield is inconsistent (only in Debug build mode). + * 2. There is another bitfield with the same name and/or the same position. + */ + FASTDDS_EXPORTED_API static void add_complete_bitfield( + CompleteBitfieldSeq& sequence, + const CompleteBitfield& bitfield); + + /** + * MinimalBitfield constructed from CompleteBitfield. + */ + + /** + * @brief Build CompleteBitsetHeader instance. + * + * @param[in] detail CompleteTypeDetail + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if the given CompleteTypeDetail is + * inconsistent (only in Debug build mode). + * @return const CompleteBitsetHeader instance. + */ + FASTDDS_EXPORTED_API static const CompleteBitsetHeader build_complete_bitset_header( + const CompleteTypeDetail& detail); + + /** + * MinimalBitsetHeader constructed from CompleteBitsetHeader. + */ + + /** + * @brief Build CompleteBitsetType instance. + * + * @param[in] bitset_flags Bitset flags: unused. No flags apply. It must be 0. + * @param[in] header CompleteBitsetHeader. + * @param[in] field_seq Sequence of complete bitfields. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if: + * 1. Any given flag is set. + * 2. Given header is inconsistent (only in Debug build mode). + * 3. Given bitfield sequence is inconsistent (only in Debug build mode). + * @return const CompleteBitsetType instance. + */ + FASTDDS_EXPORTED_API static const CompleteBitsetType build_complete_bitset_type( + BitsetTypeFlag bitset_flags, + const CompleteBitsetHeader& header, + const CompleteBitfieldSeq& field_seq); + + /** + * MinimalBitsetType constructed from CompleteBitsetType. + */ + + /*************** Type Object: ***************************************/ + + /** + * @brief Build CompleteExtendedType instance. (empty. Available for future extension) + * + * @return const CompleteExtendedType instance. + */ + FASTDDS_EXPORTED_API static const CompleteExtendedType build_complete_extended_type(); + + /** + * @brief Register alias TypeObject into TypeObjectRegistry. + * CompleteAliasType is provided and the minimal TypeObject is constructed from the complete one. + * + * @param[in] alias_type CompleteAliasType. + * @param[in] type_name Name to be registered in the registry. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if the given type is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeObject registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_alias_type_object( + const CompleteAliasType& alias_type, + const std::string& type_name); + + /** + * @brief Register annotation TypeObject into TypeObjectRegistry. + * CompleteAnnotationType is provided and the minimal TypeObject is constructed from the complete one. + * + * @param[in] annotation_type CompleteAnnotationType. + * @param[in] type_name Name to be registered in the registry. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if the given type is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeObject registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_annotation_type_object( + const CompleteAnnotationType& annotation_type, + const std::string& type_name); + + /** + * @brief Register structure TypeObject into TypeObjectRegistry. + * CompleteStructType is provided and the minimal TypeObject is constructed from the complete one. + * + * @param[in] struct_type CompleteStructType. + * @param[in] type_name Name to be registered in the registry. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if the given type is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeObject registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_struct_type_object( + const CompleteStructType& struct_type, + const std::string& type_name); + + /** + * @brief Register union TypeObject into TypeObjectRegistry. + * CompleteUnionType is provided and the minimal TypeObject is constructed from the complete one. + * + * @param[in] union_type CompleteUnionType. + * @param[in] type_name Name to be registered in the registry. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if the given type is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeObject registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_union_type_object( + const CompleteUnionType& union_type, + const std::string& type_name); + + /** + * @brief Register bitset TypeObject into TypeObjectRegistry. + * CompleteBitsetType is provided and the minimal TypeObject is constructed from the complete one. + * + * @param[in] bitset_type CompleteBitsetType. + * @param[in] type_name Name to be registered in the registry. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if the given type is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeObject registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_bitset_type_object( + const CompleteBitsetType& bitset_type, + const std::string& type_name); + + /** + * @brief Register sequence TypeObject into TypeObjectRegistry. + * CompleteSequenceType is provided and the minimal TypeObject is constructed from the complete one. + * + * @param[in] sequence_type CompleteSequenceType. + * @param[in] type_name Name to be registered in the registry. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if the given type is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeObject registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_sequence_type_object( + const CompleteSequenceType& sequence_type, + const std::string& type_name); + + /** + * @brief Register array TypeObject into TypeObjectRegistry. + * CompleteArrayType is provided and the minimal TypeObject is constructed from the complete one. + * + * @param[in] array_type CompleteArrayType. + * @param[in] type_name Name to be registered in the registry. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if the given type is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeObject registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_array_type_object( + const CompleteArrayType& array_type, + const std::string& type_name); + + /** + * @brief Register map TypeObject into TypeObjectRegistry. + * CompleteMapType is provided and the minimal TypeObject is constructed from the complete one. + * + * @param[in] map_type CompleteMapType. + * @param[in] type_name Name to be registered in the registry. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if the given type is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeObject registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_map_type_object( + const CompleteMapType& map_type, + const std::string& type_name); + + /** + * @brief Register enumeration TypeObject into TypeObjectRegistry. + * CompleteEnumeratedType is provided and the minimal TypeObject is constructed from the complete one. + * + * @param[in] enumerated_type CompleteEnumeratedType. + * @param[in] type_name Name to be registered in the registry. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if the given type is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeObject registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_enumerated_type_object( + const CompleteEnumeratedType& enumerated_type, + const std::string& type_name); + + /** + * @brief Register bitmask TypeObject into TypeObjectRegistry. + * CompleteBitmaskType is provided and the minimal TypeObject is constructed from the complete one. + * + * @param[in] bitmask_type CompleteBitmaskType. + * @param[in] type_name Name to be registered in the registry. + * @exception eprosima::fastdds::dds::xtypesv1_3::InvalidArgumentError exception if the given type is inconsistent + * (only in Debug build mode). + * @return ReturnCode_t RETCODE_OK if correctly registered in TypeObjectRegistry. + * RETCODE_BAD_PARAMETER if there is already another different TypeObject registered with + * the given type_name. + * RETCODE_BAD_PARAMETER if type_name is empty. + */ + FASTDDS_EXPORTED_API static ReturnCode_t build_and_register_bitmask_type_object( + const CompleteBitmaskType& bitmask_type, + const std::string& type_name); + + /*************** Auxiliary public methods ***************************/ + + /** + * @brief Calculate the MD5 hash of the provided name. + * + * @param[in] name String which hash is calculated. + * @return const NameHash Hash of the given string. + */ + FASTDDS_EXPORTED_API static const NameHash name_hash( + const std::string& name); + +private: + + friend class TypeObjectRegistry; + friend class eprosima::fastdds::dds::DynamicTypeBuilderFactoryImpl; + + // Class with only static methods + TypeObjectUtils() = delete; + ~TypeObjectUtils() = delete; + +protected: + + /*************** Auxiliary methods ***************************/ + + /** + * @brief Set the try construct behavior in a given MemberFlag + * + * @param[in out] member_flag Bitmask to be set. + * @param[in] try_construct_kind TryConstructKind. + */ + static void set_try_construct_behavior( + MemberFlag& member_flag, + TryConstructKind try_construct_kind); + + /** + * @brief Set the TypeFlag object. + * + * @param[in out] type_flag Bitmask to be set. + * @param[in] extensibility_kind ExtensibilityKind + * @param[in] nested nested annotation value. + * @param[in] autoid_hash autoid annotation has HASH value. + */ + static void set_type_flag( + TypeFlag& type_flag, + ExtensibilityKind extensibility_kind, + bool nested, + bool autoid_hash); + + /** + * @brief Set the extensibility kind in a given TypeFlag. + * + * @param[in out] type_flag Bitmask to be set. + * @param[in] extensibility_kind ExtensibilityKind. + */ + static void set_extensibility_kind( + TypeFlag& type_flag, + ExtensibilityKind extensibility_kind); + + /** + * @brief Check if a given TypeIdentifier is fully-descriptive. + * XTypes v1.3 Clause 7.3.4.6.1 Fully-descriptive TypeIdentifiers + * Some TypeIdentifiers do not involve computing the Hash of any TypeObject. These are called + * Fully-descriptive TypeIdentifiers because they fully describe the Type. These are: + * - The TypeIdentifiers for Primitive and String types. + * - The TypeIdentifiers of plain collections where the element (and key) TypeIdentifier is a fully + * descriptive TypeIdentifier. They are recognized by the contained PlainCollectionHeader having + * EquivalenceKind set to EK_BOTH. + * + * @param[in] type_identifier TypeIdentifier to check. + * @return true if the given TypeIdentifier is fully-descriptive. false otherwise. + */ + static bool is_fully_descriptive_type_identifier( + const TypeIdentifier& type_identifier); + + /** + * @brief Check if a given TypeIdentifier is direct hash. + * XTypes v1.3 Clause 7.3.4.6.3 + * These are HASH TypeIdentifiers with discriminator EK_MINIMAL, EK_COMPLETE or + * TI_STRONGLY_CONNECTED_COMPONENT. + * + * @param[in] type_identifier TypeIdentifier to check. + * @return true if the given TypeIdentifier is direct hash. false otherwise. + */ + static bool is_direct_hash_type_identifier( + const TypeIdentifier& type_identifier); + + /** + * @brief Check if a given TypeIdentifier is indirect hash. + * XTypes v1.3 Clause 7.3.4.6.4 + * These are the TypeIdentifiers for plain collections with the element type identified using a HASH + * TypeIdentifier. They are distinguished by: + * 1. Having discriminator TI_PLAIN_SEQUENCE_SMALL, TI_PLAIN_SEQUENCE_LARGE, TI_PLAIN_ARRAY_SMALL, + * TI_PLAIN_ARRAY_LARGE, TI_PLAIN_MAP_SMALL, or TI_PLAIN_MAP_LARGE. + * 2. Having the contained PlainCollectionHeader with EquivalenceKind EK_MINIMAL or EK_COMPLETE. + * + * @param[in] type_identifier TypeIdentifier to check. + * @return true if the given TypeIdentifier is indirect hash. false otherwise. + */ + static bool is_indirect_hash_type_identifier( + const TypeIdentifier& type_identifier); + + /*************** Consistency methods (Debug) ***************************/ + + /** + * TypeObjectHashId is always consistent. Default constructor already sets the discriminator to one valid value. + * Union setters prevent changing the discriminator value without setting the corresponding union member. + */ + + /** + * @brief Check LBound consistency: must be greater than 255. + * + * @param[in] bound LBound to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given LBound is not + * consistent. + */ + static void l_bound_consistency( + LBound bound); + + /** + * @brief Check that the array_bound_seq is consistent: non-empty. + * + * @tparam T Either SBoundSeq or LBoundSeq + * @param[in] array Sequence to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given array is not + * consistent. + */ + template + static void array_bound_seq_consistency( + const T& array) + { + if (array.empty()) + { + throw InvalidArgumentError("array_bound_seq parameter must not be empty"); + } + for (auto bound : array) + { + if (INVALID_LBOUND == bound) + { + throw InvalidArgumentError("bound parameter must be greater than 0"); + } + } + } + + /** + * @brief Check LBoundSeq consistency. + * + * @param[in] bound_seq Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given LBoundSeq is + * not consistent. + */ + static void l_bound_seq_consistency( + const LBoundSeq& bound_seq); + + /** + * @brief Check CollectionElementFlag consistency. + * + * @param[in] collection_element_flag CollectionElementFlag to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given CollectionElementFlag + * is not consistent. + */ + static void collection_element_flag_consistency( + CollectionElementFlag collection_element_flag); + + /** + * @brief Check StructMemberFlag consistency: MemberFlag consistency (try construct annotation). + * XTypes v1.3 Clause 7.2.2.4.4.4.8 Key members shall never be optional, and they shall always have their + * "must understand" attribute set to true. + * + * @param[in] member_flags MemberFlag to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given StructMemberFlag is not + * consistent. + */ + static void struct_member_flag_consistency( + StructMemberFlag member_flags); + + /** + * @brief Check UnionMemberFlag consistency. + * + * @param[in] union_member_flag UnionMemberFlag to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given UnionMemberFlag + * is not consistent. + */ + static void union_member_flag_consistency( + UnionMemberFlag union_member_flag); + + /** + * @brief Check UnionDiscriminatorFlag consistency. + * + * @param[in] union_discriminator_flag UnionDiscriminatorFlag to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given UnionDiscriminatorFlag + * is not consistent. + */ + static void union_discriminator_flag_consistency( + UnionDiscriminatorFlag union_discriminator_flag); + + /** + * @brief Check EnumeratedLiteralFlag consistency: any flag different from default are not set. + * + * @param[in] enumerated_literal_flag Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given EnumeratedLiteralFlag + * is not consistent. + */ + static void enumerated_literal_flag_consistency( + EnumeratedLiteralFlag enumerated_literal_flag); + + /** + * @brief Check TypeFlag consistency: exactly one extensibility flag is set. + * + * @param[in] type_flag Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given TypeFlag + * is not consistent. + */ + static void type_flag_consistency( + TypeFlag type_flag); + + /** + * @brief Check empty flags consistency. + * + * @tparam T Either MemberFlag or TypeFlag. + * @param[in] flags Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * flags are not consistent: empty (0). + */ + template + static void empty_flags_consistency( + T flags) + { + if (flags != 0) + { + throw InvalidArgumentError("Flags should be empty. No flags apply"); + } + } + + /** + * @brief Check EquivalenceKind consistency. + * + * @param[in] equiv_kind Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given EquivalenceKind + * is not consistent. + */ + static void equivalence_kind_consistency( + EquivalenceKind equiv_kind); + + /** + * @brief Check PlainCollectionHeader consistency: + * - CollectionElementFlag consistent + * - Consistent EquivalenceKind + * + * @param[in] header PlainCollectionHeader to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given PlainCollectionHeader + * is not consistent. + */ + static void plain_collection_header_consistency( + const PlainCollectionHeader& header); + + /** + * @brief Check consistency between a given PlainCollectionHeader and the related TypeIdentifier: + * 1. TypeIdentifier initialized + * 2. Consistency of EquivalenceKinds + * + * @param[in] header PlainCollectionHeader to be checked. + * @param[in] element_identifier TypeIdentifier to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given parameters are not + * consistent. + */ + static void plain_collection_type_identifier_header_consistency( + const PlainCollectionHeader& header, + const TypeIdentifier& element_identifier); + + /** + * @brief Retrieves the equivalence kind of a component within a map. + * + * @param[in] identifier TypeIdentifier of the component to be checked. + * @return EK_COMPLETE if the component equivalence kind is EK_COMPLETE. + * @return EK_MINIMAL if the component equivalence kind is EK_MINIMAL. + * @return EK_BOTH if the component equivalence kind is EK_BOTH. + * @return TK_NONE if the component type is invalid. + */ + static EquivalenceKind get_map_component_equiv_kind_for_consistency( + const TypeIdentifier& identifier); + + /** + * @brief Check consistency between a given PlainCollectionHeader of a map and the related TypeIdentifier: + * 1. Key TypeIdentifier is valid + * 2. TypeIdentifier initialized + * 3. Consistency of EquivalenceKinds + * + * @param[in] header PlainCollectionHeader of the map to be checked. + * @param[in] type_identifier TypeIdentifier to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given parameters are not + * consistent. + */ + static void plain_map_type_components_consistency( + const PlainCollectionHeader& header, + const TypeIdentifier& type_identifier); + + /** + * @brief Check map key_identifier consistency. + * XTypes v1.3 Clause 7.2.2.4.3: Implementers of this specification need only support key elements of signed + * and unsigned integer types and of narrow and wide string types. + * In Debug build mode, this method also checks that the string/wstring bound is consistent. + * + * @param[in] key_identifier TypeIdentifier to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given TypeIdentifier is not + * consistent. + */ + static void map_key_type_identifier_consistency( + const TypeIdentifier& key_identifier); + + /** + * @brief Check StringLTypeDefn consistency. + * + * @param[in] string Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given StringLTypeDefn is not + * consistent. + */ + static void string_ldefn_consistency( + const StringLTypeDefn& string); + + /** + * @brief Check PlainSequenceSElemDefn consistency. + * + * @param[in] plain_seq Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given PlainSequenceSElemDefn + * is not consistent. + */ + static void seq_sdefn_consistency( + const PlainSequenceSElemDefn& plain_seq); + + /** + * @brief Check PlainSequenceLElemDefn consistency. + * + * @param[in] plain_seq Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given PlainSequenceLElemDefn + * is not consistent. + */ + static void seq_ldefn_consistency( + const PlainSequenceLElemDefn& plain_seq); + + /** + * @brief Check PlainArraySElemDefn consistency. + * + * @param[in] plain_array Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given PlainArraySElemDefn is + * not consistent. + */ + static void array_sdefn_consistency( + const PlainArraySElemDefn& plain_array); + + /** + * @brief Check PlainArrayLElemDefn consistency. + * + * @param[in] plain_array Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given PlainArrayLElemDefn is + * not consistent. + */ + static void array_ldefn_consistency( + const PlainArrayLElemDefn& plain_array); + + /** + * @brief Check PlainMapSTypeDefn consistency. + * + * @param[in] plain_map Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given PlainMapSTypeDefn is + * not consistent. + */ + static void map_sdefn_consistency( + const PlainMapSTypeDefn& plain_map); + + /** + * @brief Check PlainMapLTypeDefn consistency. + * + * @param[in] plain_map Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given PlainMapLTypeDefn is + * not consistent. + */ + static void map_ldefn_consistency( + const PlainMapLTypeDefn& plain_map); + + /** + * @brief Check direct hash TypeIdentifier consistency. + * + * @param[in] equivalence_hash Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given TypeIdentifier is + * not consistent. + */ + static void direct_hash_type_identifier_consistency( + const TypeIdentifier& type_id); + + /** + * @brief Check TypeIdentifier consistency. + * + * @param[in] plain_map Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given TypeIdentifier is + * not consistent. + */ + static void type_identifier_consistency( + const TypeIdentifier& type_identifier); + + /** + * @brief Check AppliedAnnotationParameterSeq consistency. + * + * @param[in] applied_annotation_parameter_seq Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * AppliedAnnotationParameterSeq is not consistent. + */ + static void applied_annotation_parameter_seq_consistency( + const AppliedAnnotationParameterSeq& applied_annotation_parameter_seq); + + /** + * @brief Check AppliedAnnotation TypeIdentifier consistency. + * + * @param[in] annotation_type_id Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * AppliedAnnotation TypeIdentifier is not consistent. + */ + static void applied_annotation_type_identifier_consistency( + const TypeIdentifier& annotation_type_id); + + /** + * @brief Check AppliedAnnotation consistency. + * + * @param[in] applied_annotation Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given AppliedAnnotation is + * not consistent. + */ + static void applied_annotation_consistency( + const AppliedAnnotation& applied_annotation); + + /** + * @brief Check AppliedAnnotationSeq consistency. + * + * @param[in] applied_annotation_seq Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given AppliedAnnotationSeq is + * not consistent. + */ + static void applied_annotation_seq_consistency( + const AppliedAnnotationSeq& applied_annotation_seq); + + /** + * @brief Check AppliedVerbatimAnnotation consistency. + * + * @param[in] applied_verbatim_annotation Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * AppliedVerbatimAnnotation is not consistent. + */ + static void applied_verbatim_annotation_consistency( + const AppliedVerbatimAnnotation& applied_verbatim_annotation); + + /** + * @brief Check CommonStructMember consistency. + * + * @param[in] common_struct_member Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given CommonStructMember is + * not consistent. + */ + static void common_struct_member_consistency( + const CommonStructMember& common_struct_member); + + /** + * @brief Check CompleteMemberDetail consistency. + * + * @param[in] complete_member_detail Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given CompleteMemberDetail is + * not consistent. + */ + static void complete_member_detail_consistency( + const CompleteMemberDetail& complete_member_detail); + + /** + * @brief Check cross-consistency between CommonStructMember and CompleteMemberDetail. + * + * @param[in] common_struct_member CommonStructMember to be checked. + * @param[in] complete_member_detail CompleteMemberDetail to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the @hashid builtin applied + * annotation is set and inconsistent with the member id. + */ + static void common_struct_member_and_complete_member_detail_consistency( + const CommonStructMember& common_struct_member, + const CompleteMemberDetail& complete_member_detail); + + /** + * @brief Check consistency between a string value and the MemberId (algorithm XTypes v1.3 Clause 7.3.1.2.1.1) + * + * @param[in] member_id MemberId to be checked. + * @param[in] string_value String provided with either @hashid annotation or the member name. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given data is inconsistent. + */ + static void string_member_id_consistency( + MemberId member_id, + const std::string& string_value); + + /** + * @brief Check CompleteStructMember consistency. + * + * @param[in] complete_struct_member Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given CompleteStructMember is + * not consistent. + */ + static void complete_struct_member_consistency( + const CompleteStructMember& complete_struct_member); + + /** + * @brief Check CompleteStructMemberSeq consistency. + * + * @param[in] complete_struct_member_seq Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given CompleteStructMemberSeq + * is not consistent. + */ + static void complete_struct_member_seq_consistency( + const CompleteStructMemberSeq& complete_struct_member_seq); + + /** + * @brief Check AppliedBuiltinTypeAnnotations consistency. + * + * @param[in] applied_builtin_type_annotations Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * AppliedBuiltinTypeAnnotations is not consistent. + */ + static void applied_builtin_type_annotations_consistency( + const AppliedBuiltinTypeAnnotations& applied_builtin_type_annotations); + + /** + * @brief Check CompleteTypeDetail consistency. + * + * @param[in] complete_type_detail Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given CompleteTypeDetail is + * not consistent. + */ + static void complete_type_detail_consistency( + const CompleteTypeDetail& complete_type_detail); + + /** + * @brief Check CompleteStructHeader base_type TypeIdentifier consistency. + * + * @param[in] base_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given TypeIdentifier is + * not consistent. + */ + static void structure_base_type_consistency( + const TypeIdentifier& base_type); + + /** + * @brief Check CompleteStructHeader consistency. + * + * @param[in] complete_struct_header Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given CompleteStructHeader + * is not consistent. + */ + static void complete_struct_header_consistency( + const CompleteStructHeader& complete_struct_header); + + /** + * @brief Check CompleteStructType consistency. + * + * @param[in] complete_struct_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given CompleteStructType + * is not consistent. + */ + static void complete_struct_type_consistency( + const CompleteStructType& complete_struct_type); + + /** + * @brief Check MinimalStructType consistency. + * + * @param[in] minimal_struct_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given MinimalStructType + * is not consistent. + */ + static void minimal_struct_type_consistency( + const MinimalStructType& minimal_struct_type); + + /** + * @brief Check UnionCaseLabelSeq consistency. + * + * @param[in] union_case_label_seq Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given UnionCaseLabelSeq + * is not consistent. + */ + static void union_case_label_seq_consistency( + const UnionCaseLabelSeq& union_case_label_seq); + + /** + * @brief Check CommonUnionMember consistency. + * + * @param[in] common_union_member Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given CommonUnionMember + * is not consistent. + */ + static void common_union_member_consistency( + const CommonUnionMember& common_union_member); + + /** + * @brief Check cross-consistency between CommonStructMember and CompleteMemberDetail. + * + * @param[in] common_struct_member CommonStructMember to be checked. + * @param[in] complete_member_detail CompleteMemberDetail to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the @hashid builtin annotation is + * set and the member id is not consistent. + */ + static void common_union_member_complete_member_detail_consistency( + const CommonUnionMember& common_union_member, + const CompleteMemberDetail& complete_member_detail); + + /** + * @brief Check CompleteUnionMember consistency. + * + * @param[in] complete_union_member Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given CompleteUnionMember + * is not consistent. + */ + static void complete_union_member_consistency( + const CompleteUnionMember& complete_union_member); + + /** + * @brief Check CompleteUnionMemberSeq consistency. + * + * @param[in] complete_union_member_seq Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given CompleteUnionMemberSeq + * is not consistent. + */ + static void complete_union_member_seq_consistency( + const CompleteUnionMemberSeq& complete_union_member_seq); + + /** + * @brief Check discriminator TypeIdentifier consistency. + * + * @param[in] type_id Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given TypeIdentifier + * is not consistent. + */ + static void common_discriminator_member_type_identifier_consistency( + const TypeIdentifier& type_id); + + /** + * @brief Check CommonDiscriminatorMember consistency. + * + * @param[in] common_discriminator_member Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CommonDiscriminatorMember is not consistent. + */ + static void common_discriminator_member_consistency( + const CommonDiscriminatorMember& common_discriminator_member); + + /** + * @brief Check CompleteDiscriminatorMember consistency. + * + * @param[in] complete_discriminator_member Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteDiscriminatorMember is not consistent. + */ + static void complete_discriminator_member_consistency( + const CompleteDiscriminatorMember& complete_discriminator_member); + + /** + * @brief Check CompleteUnionHeader consistency. + * + * @param[in] complete_union_header Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteUnionHeader is not consistent. + */ + static void complete_union_header_consistency( + const CompleteUnionHeader& complete_union_header); + + /** + * @brief Check CompleteUnionType consistency. + * + * @param[in] complete_union_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteUnionType is not consistent. + */ + static void complete_union_type_consistency( + const CompleteUnionType& complete_union_type); + + /** + * @brief Check MinimalUnionType consistency. + * + * @param[in] minimal_union_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * MinimalUnionType is not consistent. + */ + static void minimal_union_type_consistency( + const MinimalUnionType& minimal_union_type); + + /** + * @brief Check that the annotation value is of the same type as the given TypeIdentifier. + * + * @param type_id TypeIdentifier. + * @param value AnnotationParameterValue. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given TypeIdentifier is not + * consistent with the given value. + */ + static void common_annotation_parameter_type_identifier_default_value_consistency( + const TypeIdentifier& type_id, + const AnnotationParameterValue& value); + + /** + * @brief Check CommonAnnotationParameter consistency. + * + * @param[in] common_annotation_parameter Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CommonAnnotationParameter is not consistent. + */ + static void common_annotation_parameter_consistency( + const CommonAnnotationParameter& common_annotation_parameter); + + /** + * @brief Check CompleteAnnotationParameter consistency. + * + * @param[in] complete_annotation_parameter Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteAnnotationParameter is not consistent. + */ + static void complete_annotation_parameter_consistency( + const CompleteAnnotationParameter& complete_annotation_parameter); + + /** + * @brief Check CompleteAnnotationParameterSeq consistency. + * + * @param[in] complete_annotation_parameter_seq Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteAnnotationParameterSeq is not consistent. + */ + static void complete_annotation_parameter_seq_consistency( + const CompleteAnnotationParameterSeq& complete_annotation_parameter_seq); + + /** + * @brief Check CompleteAnnotationHeader consistency. + * + * @param[in] complete_annotation_header Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteAnnotationHeader is not consistent. + */ + static void complete_annotation_header_consistency( + const CompleteAnnotationHeader& complete_annotation_header); + + /** + * @brief Check CompleteAnnotationType consistency. + * + * @param[in] complete_annotation_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteAnnotationType is not consistent. + */ + static void complete_annotation_type_consistency( + const CompleteAnnotationType& complete_annotation_type); + + /** + * @brief Check MinimalAnnotationType consistency. + * + * @param[in] minimal_annotation_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * MinimalAnnotationType is not consistent. + */ + static void minimal_annotation_type_consistency( + const MinimalAnnotationType& minimal_annotation_type); + + /** + * @brief Check CommonAliasBody consistency. + * + * @param[in] common_alias_body Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CommonAliasBody is not consistent. + */ + static void common_alias_body_consistency( + const CommonAliasBody& common_alias_body); + + /** + * @brief Check that @hashid builtin annotation has not been set. + * + * @param[in] ann_builtin Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * AppliedBuiltinMemberAnnotations is not consistent. + */ + static void hashid_builtin_annotation_not_applied_consistency( + const eprosima::fastcdr::optional& ann_builtin); + + /** + * @brief Check CompleteAliasBody consistency. + * + * @param[in] complete_alias_body Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteAliasBody is not consistent. + */ + static void complete_alias_body_consistency( + const CompleteAliasBody& complete_alias_body); + + /** + * @brief Check CompleteAliasHeader consistency. + * + * @param[in] complete_alias_header Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteAliasHeader is not consistent. + */ + static void complete_alias_header_consistency( + const CompleteAliasHeader& complete_alias_header); + + /** + * @brief Check CompleteAliasType consistency. + * + * @param[in] complete_alias_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteAliasType is not consistent. + */ + static void complete_alias_type_consistency( + const CompleteAliasType& complete_alias_type); + + /** + * @brief Check MinimalAliasType consistency. + * + * @param[in] minimal_alias_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * MinimalAliasType is not consistent. + */ + static void minimal_alias_type_consistency( + const MinimalAliasType& minimal_alias_type); + + /** + * @brief Check CompleteElementDetail consistency. + * + * @param[in] complete_element_detail Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteElementDetail is not consistent. + */ + static void complete_element_detail_consistency( + const CompleteElementDetail& complete_element_detail); + + /** + * @brief Check CommonCollectionElement consistency. + * + * @param[in] common_collection_element Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CommonCollectionElement is not consistent. + */ + static void common_collection_element_consistency( + const CommonCollectionElement& common_collection_element); + + /** + * @brief Check CompleteCollectionElement consistency. + * + * @param[in] complete_collection_element Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteCollectionElement is not consistent. + */ + static void complete_collection_element_consistency( + const CompleteCollectionElement& complete_collection_element); + + /** + * @brief Check CompleteCollectionHeader consistency. + * + * @param[in] complete_collection_header Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteCollectionHeader is not consistent. + */ + static void complete_collection_header_consistency( + const CompleteCollectionHeader& complete_collection_header); + + /** + * @brief Check CompleteSequenceType consistency. + * + * @param[in] complete_sequence_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteSequenceType is not consistent. + */ + static void complete_sequence_type_consistency( + const CompleteSequenceType& complete_sequence_type); + + /** + * @brief Check MinimalSequenceType consistency. + * + * @param[in] minimal_sequence_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * MinimalSequenceType is not consistent. + */ + static void minimal_sequence_type_consistency( + const MinimalSequenceType& minimal_sequence_type); + + /** + * @brief Check CommonArrayHeader consistency. + * + * @param[in] common_array_header Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CommonArrayHeader is not consistent. + */ + static void common_array_header_consistency( + const CommonArrayHeader& common_array_header); + + /** + * @brief Check CompleteArrayHeader consistency. + * + * @param[in] complete_array_header Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteArrayHeader is not consistent. + */ + static void complete_array_header_consistency( + const CompleteArrayHeader& complete_array_header); + + /** + * @brief Check CompleteArrayType consistency. + * + * @param[in] complete_array_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteArrayType is not consistent. + */ + static void complete_array_type_consistency( + const CompleteArrayType& complete_array_type); + + /** + * @brief Check MinimalArrayType consistency. + * + * @param[in] minimal_array_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * MinimalArrayType is not consistent. + */ + static void minimal_array_type_consistency( + const MinimalArrayType& minimal_array_type); + + /** + * @brief Check CompleteMapType consistency. + * + * @param[in] complete_map_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteMapType is not consistent. + */ + static void complete_map_type_consistency( + const CompleteMapType& complete_map_type); + + /** + * @brief Check MinimalMapType consistency. + * + * @param[in] minimal_map_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * MinimalMapType is not consistent. + */ + static void minimal_map_type_consistency( + const MinimalMapType& minimal_map_type); + + /** + * @brief Check CommonEnumeratedLiteral consistency. + * + * @param[in] common_enumerated_literal Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CommonEnumeratedLiteral is not consistent. + */ + static void common_enumerated_literal_consistency( + const CommonEnumeratedLiteral& common_enumerated_literal); + + /** + * @brief Check CompleteEnumeratedLiteral consistency. + * + * @param[in] complete_enumerated_literal Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteEnumeratedLiteral is not consistent. + */ + static void complete_enumerated_literal_consistency( + const CompleteEnumeratedLiteral& complete_enumerated_literal); + + /** + * @brief Check CompleteEnumeratedLiteralSeq consistency. + * + * @param[in] complete_enumerated_literal_seq Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteEnumeratedLiteralSeq is not consistent. + */ + static void complete_enumerated_literal_seq_consistency( + const CompleteEnumeratedLiteralSeq& complete_enumerated_literal_seq); + + /** + * @brief Check enumeration BitBound consistency. + * + * @param[in] bit_bound Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * BitBound is not consistent. + */ + static void enum_bit_bound_consistency( + BitBound bit_bound); + + /** + * @brief Check bitmask BitBound consistency. + * + * @param[in] bit_bound Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * BitBound is not consistent. + */ + static void bitmask_bit_bound_consistency( + BitBound bit_bound); + + /** + * @brief Check CommonEnumeratedHeader consistency. + * + * @param[in] common_enumerated_header Instance to be checked. + * @param[in] bitmask flag in case that the header corresponds to a Bitmask. By default is false. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CommonEnumeratedHeader is not consistent. + */ + static void common_enumerated_header_consistency( + const CommonEnumeratedHeader& common_enumerated_header, + bool bitmask = false); + + /** + * @brief Check CompleteEnumeratedHeader consistency. + * + * @param[in] complete_enumerated_header Instance to be checked. + * @param[in] bitmask Flag in case that the header corresponds to a Bitmask. By default is false. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteEnumeratedHeader is not consistent. + */ + static void complete_enumerated_header_consistency( + const CompleteEnumeratedHeader& complete_enumerated_header, + bool bitmask = false); + + /** + * @brief Check CompleteEnumeratedType consistency. + * + * @param[in] complete_enumerated_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteEnumeratedType is not consistent. + */ + static void complete_enumerated_type_consistency( + const CompleteEnumeratedType& complete_enumerated_type); + + /** + * @brief Check MinimalEnumeratedType consistency. + * + * @param[in] minimal_enumerated_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * MinimalEnumeratedType is not consistent. + */ + static void minimal_enumerated_type_consistency( + const MinimalEnumeratedType& minimal_enumerated_type); + + /** + * @brief Check bitflag position consistency. + * + * @param[in] position Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * bitflag position is not consistent. + */ + static void bit_position_consistency( + uint16_t position); + + /** + * @brief Check CommonBitflag consistency. + * + * @param[in] common_bitflag Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CommonBitflag is not consistent. + */ + static void common_bitflag_consistency( + const CommonBitflag& common_bitflag); + + /** + * @brief Check CompleteBitflag consistency. + * + * @param[in] complete_bitflag Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteBitflag is not consistent. + */ + static void complete_bitflag_consistency( + const CompleteBitflag& complete_bitflag); + + /** + * @brief Check CompleteBitflagSeq consistency. + * + * @param[in] complete_bitflag_seq Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteBitflagSeq is not consistent. + */ + static void complete_bitflag_seq_consistency( + const CompleteBitflagSeq& complete_bitflag_seq); + + /** + * @brief Check CompleteBitmaskType consistency. + * + * @param[in] complete_bitmask_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteBitmaskType is not consistent. + */ + static void complete_bitmask_type_consistency( + const CompleteBitmaskType& complete_bitmask_type); + + /** + * @brief Check MinimalBitmaskType consistency. + * + * @param[in] minimal_bitmask_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * MinimalBitmaskType is not consistent. + */ + static void minimal_bitmask_type_consistency( + const MinimalBitmaskType& minimal_bitmask_type); + + /** + * @brief Check consistency between the holder type and the bitcount. + * + * @param[in] holder_type TypeKind of the bitfield holder type. + * @param[in] bitcount Bitfield number of bits. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given data is inconsistent. + */ + static void bitfield_holder_type_consistency( + TypeKind holder_type, + uint8_t bitcount); + + /** + * @brief Check CommonBitfield consistency. + * + * @param[in] common_bitfield Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CommonBitfield is not consistent. + */ + static void common_bitfield_consistency( + const CommonBitfield& common_bitfield); + + /** + * @brief Check CompleteBitfield consistency. + * + * @param[in] complete_bitfield Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteBitfield is not consistent. + */ + static void complete_bitfield_consistency( + const CompleteBitfield& complete_bitfield); + + /** + * @brief Check CompleteBitfieldSeq consistency. + * + * @param[in] complete_bitfield_seq Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteBitfieldSeq is not consistent. + */ + static void complete_bitfield_seq_consistency( + const CompleteBitfieldSeq& complete_bitfield_seq); + + /** + * @brief Check CompleteBitsetHeader consistency. + * + * @param[in] complete_bitset_header Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteBitsetHeader is not consistent. + */ + static void complete_bitset_header_consistency( + const CompleteBitsetHeader& complete_bitset_header); + + /** + * @brief Check CompleteBitsetType consistency. + * + * @param[in] complete_bitset_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteBitsetType is not consistent. + */ + static void complete_bitset_type_consistency( + const CompleteBitsetType& complete_bitset_type); + + /** + * @brief Check MinimalBitsetType consistency. + * + * @param[in] minimal_bitset_type Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * MinimalBitsetType is not consistent. + */ + static void minimal_bitset_type_consistency( + const MinimalBitsetType& minimal_bitset_type); + + /** + * @brief Check CompleteTypeObject consistency. + * + * @param[in] complete_type_object Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * CompleteTypeObject is not consistent. + */ + static void complete_type_object_consistency( + const CompleteTypeObject& complete_type_object); + + /** + * @brief Check MinimalTypeObject consistency. + * + * @param[in] minimal_type_object Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * MinimalTypeObject is not consistent. + */ + static void minimal_type_object_consistency( + const MinimalTypeObject& minimal_type_object); + + /** + * @brief Check TypeObject consistency. + * + * @param[in] type_object Instance to be checked. + * @exception eprosima::fastdds::dds::xtypes::InvalidArgumentError exception if the given + * TypeObject is not consistent. + */ + static void type_object_consistency( + const TypeObject& type_object); + +}; + +} // xtypes +} // dds +} // fastdds +} // eprosima + +#endif // _FASTDDS_DDS_XTYPES_TYPE_REPRESENTATION_TYPEOBJECTUTILS_HPP_ diff --git a/include/fastdds/dds/xtypes/type_representation/detail/dds-xtypes_typeobject.idl b/include/fastdds/dds/xtypes/type_representation/detail/dds-xtypes_typeobject.idl new file mode 100644 index 00000000000..0d4b5798529 --- /dev/null +++ b/include/fastdds/dds/xtypes/type_representation/detail/dds-xtypes_typeobject.idl @@ -0,0 +1,1077 @@ +/* dds-xtypes_typeobject.idl */ + +// The types in this file shall be serialized with XCDR encoding version 2 +module DDS { module XTypes { + + // ---------- Equivalence Kinds ------------------- + typedef octet EquivalenceKind; + const octet EK_MINIMAL = 0xF1; // 0x1111 0001 + const octet EK_COMPLETE = 0xF2; // 0x1111 0010 + const octet EK_BOTH = 0xF3; // 0x1111 0011 + + // ---------- TypeKinds (begin) ------------------- + typedef octet TypeKind; + + // Primitive TKs + const octet TK_NONE = 0x00; + const octet TK_BOOLEAN = 0x01; + const octet TK_BYTE = 0x02; + const octet TK_INT16 = 0x03; + const octet TK_INT32 = 0x04; + const octet TK_INT64 = 0x05; + const octet TK_UINT16 = 0x06; + const octet TK_UINT32 = 0x07; + const octet TK_UINT64 = 0x08; + const octet TK_FLOAT32 = 0x09; + const octet TK_FLOAT64 = 0x0A; + const octet TK_FLOAT128 = 0x0B; + const octet TK_INT8 = 0x0C; + const octet TK_UINT8 = 0x0D; + const octet TK_CHAR8 = 0x10; + const octet TK_CHAR16 = 0x11; + + // String TKs + const octet TK_STRING8 = 0x20; + const octet TK_STRING16 = 0x21; + + // Constructed/Named types + const octet TK_ALIAS = 0x30; + + // Enumerated TKs + const octet TK_ENUM = 0x40; + const octet TK_BITMASK = 0x41; + + // Structured TKs + const octet TK_ANNOTATION = 0x50; + const octet TK_STRUCTURE = 0x51; + const octet TK_UNION = 0x52; + const octet TK_BITSET = 0x53; + + // Collection TKs + const octet TK_SEQUENCE = 0x60; + const octet TK_ARRAY = 0x61; + const octet TK_MAP = 0x62; + // ---------- TypeKinds (end) ------------------- + + // ---------- Extra TypeIdentifiers (begin) ------------ + typedef octet TypeIdentiferKind; + const octet TI_STRING8_SMALL = 0x70; + const octet TI_STRING8_LARGE = 0x71; + const octet TI_STRING16_SMALL = 0x72; + const octet TI_STRING16_LARGE = 0x73; + + const octet TI_PLAIN_SEQUENCE_SMALL = 0x80; + const octet TI_PLAIN_SEQUENCE_LARGE = 0x81; + + const octet TI_PLAIN_ARRAY_SMALL = 0x90; + const octet TI_PLAIN_ARRAY_LARGE = 0x91; + + const octet TI_PLAIN_MAP_SMALL = 0xA0; + const octet TI_PLAIN_MAP_LARGE = 0xA1; + + const octet TI_STRONGLY_CONNECTED_COMPONENT = 0xB0; + // ---------- Extra TypeIdentifiers (end) -------------- + + // The name of some element (e.g. type, type member, module) + // Valid characters are alphanumeric plus the "_" cannot start with digit + const long MEMBER_NAME_MAX_LENGTH = 256; + typedef string MemberName; + + // Qualified type name includes the name of containing modules + // using "::" as separator. No leading "::". E.g. "MyModule::MyType" + const long TYPE_NAME_MAX_LENGTH = 256; + typedef string QualifiedTypeName; + + // Every type has an ID. Those of the primitive types are pre-defined. + typedef octet PrimitiveTypeId; + + // First 14 bytes of MD5 of the serialized TypeObject using XCDR + // version 2 with Little Endian encoding + typedef octet EquivalenceHash[14]; + + // First 4 bytes of MD5 of of a member name converted to bytes + // using UTF-8 encoding and without a 'nul' terminator. + // Example: the member name "color" has NameHash {0x70, 0xDD, 0xA5, 0xDF} + typedef octet NameHash[4]; + + // Long Bound of a collection type + typedef unsigned long LBound; + typedef sequence LBoundSeq; + const LBound INVALID_LBOUND = 0; + + // Short Bound of a collection type + typedef octet SBound; + typedef sequence SBoundSeq; + const SBound INVALID_SBOUND = 0; + + @extensibility(FINAL) @nested + union TypeObjectHashId switch (octet) { + case EK_COMPLETE: + case EK_MINIMAL: + EquivalenceHash hash; + }; + + // Flags that apply to struct/union/collection/enum/bitmask/bitset + // members/elements and DO affect type assignability + // Depending on the flag it may not apply to members of all types + // When not all, the applicable member types are listed + @bit_bound(16) + bitmask MemberFlag { + @position(0) TRY_CONSTRUCT1, // T1 | 00 = INVALID, 01 = DISCARD + @position(1) TRY_CONSTRUCT2, // T2 | 10 = USE_DEFAULT, 11 = TRIM + @position(2) IS_EXTERNAL, // X StructMember, UnionMember, + // CollectionElement + @position(3) IS_OPTIONAL, // O StructMember + @position(4) IS_MUST_UNDERSTAND, // M StructMember + @position(5) IS_KEY, // K StructMember, UnionDiscriminator + @position(6) IS_DEFAULT // D UnionMember, EnumerationLiteral + }; + typedef MemberFlag CollectionElementFlag; // T1, T2, X + typedef MemberFlag StructMemberFlag; // T1, T2, O, M, K, X + typedef MemberFlag UnionMemberFlag; // T1, T2, D, X + typedef MemberFlag UnionDiscriminatorFlag; // T1, T2, K + typedef MemberFlag EnumeratedLiteralFlag; // D + typedef MemberFlag AnnotationParameterFlag; // Unused. No flags apply + typedef MemberFlag AliasMemberFlag; // Unused. No flags apply + typedef MemberFlag BitflagFlag; // Unused. No flags apply + typedef MemberFlag BitsetMemberFlag; // Unused. No flags apply + + // Mask used to remove the flags that do no affect assignability + // Selects T1, T2, O, M, K, D + const unsigned short MemberFlagMinimalMask = 0x003f; + + // Flags that apply to type declarationa and DO affect assignability + // Depending on the flag it may not apply to all types + // When not all, the applicable types are listed + @bit_bound(16) + bitmask TypeFlag { + @position(0) IS_FINAL, // F | + @position(1) IS_APPENDABLE, // A |- Struct, Union + @position(2) IS_MUTABLE, // M | (exactly one flag) + + @position(3) IS_NESTED, // N Struct, Union + @position(4) IS_AUTOID_HASH // H Struct + }; + typedef TypeFlag StructTypeFlag; // All flags apply + typedef TypeFlag UnionTypeFlag; // All flags apply + typedef TypeFlag CollectionTypeFlag; // Unused. No flags apply + typedef TypeFlag AnnotationTypeFlag; // Unused. No flags apply + typedef TypeFlag AliasTypeFlag; // Unused. No flags apply + typedef TypeFlag EnumTypeFlag; // Unused. No flags apply + typedef TypeFlag BitmaskTypeFlag; // Unused. No flags apply + typedef TypeFlag BitsetTypeFlag; // Unused. No flags apply + + // Mask used to remove the flags that do no affect assignability + const unsigned short TypeFlagMinimalMask = 0x0007; // Selects M, A, F + + // Forward declaration + union TypeIdentifier; + + // 1 Byte + @extensibility(FINAL) @nested + struct StringSTypeDefn { + SBound bound; + }; + + // 4 Bytes + @extensibility(FINAL) @nested + struct StringLTypeDefn { + LBound bound; + }; + + @extensibility(FINAL) @nested + struct PlainCollectionHeader { + EquivalenceKind equiv_kind; + CollectionElementFlag element_flags; + }; + + @extensibility(FINAL) @nested + struct PlainSequenceSElemDefn { + PlainCollectionHeader header; + SBound bound; + @external TypeIdentifier element_identifier; + }; + + @extensibility(FINAL) @nested + struct PlainSequenceLElemDefn { + PlainCollectionHeader header; + LBound bound; + @external TypeIdentifier element_identifier; + }; + + @extensibility(FINAL) @nested + struct PlainArraySElemDefn { + PlainCollectionHeader header; + SBoundSeq array_bound_seq; + @external TypeIdentifier element_identifier; + }; + + @extensibility(FINAL) @nested + struct PlainArrayLElemDefn { + PlainCollectionHeader header; + LBoundSeq array_bound_seq; + @external TypeIdentifier element_identifier; + }; + + @extensibility(FINAL) @nested + struct PlainMapSTypeDefn { + PlainCollectionHeader header; + SBound bound; + @external TypeIdentifier element_identifier; + CollectionElementFlag key_flags; + @external TypeIdentifier key_identifier; + }; + + @extensibility(FINAL) @nested + struct PlainMapLTypeDefn { + PlainCollectionHeader header; + LBound bound; + @external TypeIdentifier element_identifier; + CollectionElementFlag key_flags; + @external TypeIdentifier key_identifier; + }; + + // Used for Types that have cyclic depencencies with other types + @extensibility(APPENDABLE) @nested + struct StronglyConnectedComponentId { + TypeObjectHashId sc_component_id; // Hash StronglyConnectedComponent + long scc_length; // StronglyConnectedComponent.length + long scc_index ; // identify type in Strongly Connected Comp. + }; + + // Future extensibility + @extensibility(MUTABLE) @nested + struct ExtendedTypeDefn { + // Empty. Available for future extension + }; + + + + // The TypeIdentifier uniquely identifies a type (a set of equivalent + // types according to an equivalence relationship: COMPLETE, MNIMAL). + // + // In some cases (primitive types, strings, plain types) the identifier + // is a explicit description of the type. + // In other cases the Identifier is a Hash of the type description + // + // In the case of primitive types and strings the implied equivalence + // relation is the identity. + // + // For Plain Types and Hash-defined TypeIdentifiers there are three + // possibilities: MINIMAL, COMPLETE, and COMMON: + // - MINIMAL indicates the TypeIdentifier identifies equivalent types + // according to the MINIMAL equivalence relation + // - COMPLETE indicates the TypeIdentifier identifies equivalent types + // according to the COMPLETE equivalence relation + // - COMMON indicates the TypeIdentifier identifies equivalent types + // according to both the MINIMAL and the COMMON equivalence relation. + // This means the TypeIdentifier is the same for both relationships + // + @extensibility(FINAL) @nested + union TypeIdentifier switch (octet) { + // ============ Primitive types - use TypeKind ==================== + // All primitive types fall here. + // Commented-out because Unions cannot have cases with no member. + /* + case TK_NONE: + case TK_BOOLEAN: + case TK_BYTE_TYPE: + case TK_INT8_TYPE: + case TK_INT16_TYPE: + case TK_INT32_TYPE: + case TK_INT64_TYPE: + case TK_UINT8_TYPE: + case TK_UINT16_TYPE: + case TK_UINT32_TYPE: + case TK_UINT64_TYPE: + case TK_FLOAT32_TYPE: + case TK_FLOAT64_TYPE: + case TK_FLOAT128_TYPE: + case TK_CHAR8_TYPE: + case TK_CHAR16_TYPE: + // No Value + */ + + // ============ Strings - use TypeIdentifierKind =================== + case TI_STRING8_SMALL: + case TI_STRING16_SMALL: + StringSTypeDefn string_sdefn; + + case TI_STRING8_LARGE: + case TI_STRING16_LARGE: + StringLTypeDefn string_ldefn; + + // ============ Plain collectios - use TypeIdentifierKind ========= + case TI_PLAIN_SEQUENCE_SMALL: + PlainSequenceSElemDefn seq_sdefn; + case TI_PLAIN_SEQUENCE_LARGE: + PlainSequenceLElemDefn seq_ldefn; + + case TI_PLAIN_ARRAY_SMALL: + PlainArraySElemDefn array_sdefn; + case TI_PLAIN_ARRAY_LARGE: + PlainArrayLElemDefn array_ldefn; + + case TI_PLAIN_MAP_SMALL: + PlainMapSTypeDefn map_sdefn; + case TI_PLAIN_MAP_LARGE: + PlainMapLTypeDefn map_ldefn; + + // ============ Types that are mutually dependent on each other === + case TI_STRONGLY_CONNECTED_COMPONENT: + StronglyConnectedComponentId sc_component_id; + + // ============ The remaining cases - use EquivalenceKind ========= + case EK_COMPLETE: + case EK_MINIMAL: + EquivalenceHash equivalence_hash; + + // =================== Future extensibility ============ + // Future extensions + default: + ExtendedTypeDefn extended_defn; + }; + typedef sequence TypeIdentifierSeq; + + + // --- Annotation usage: ----------------------------------------------- + + // ID of a type member + typedef unsigned long MemberId; + const unsigned long ANNOTATION_STR_VALUE_MAX_LEN = 128; + const unsigned long ANNOTATION_OCTETSEC_VALUE_MAX_LEN = 128; + + @extensibility(MUTABLE) @nested + struct ExtendedAnnotationParameterValue { + // Empty. Available for future extension + }; + + /* Literal value of an annotation member: either the default value in its + * definition or the value applied in its usage. + */ + @extensibility(FINAL) @nested + union AnnotationParameterValue switch (octet) { + case TK_BOOLEAN: + boolean boolean_value; + case TK_BYTE: + octet byte_value; + case TK_INT8: + int8 int8_value; + case TK_UINT8: + uint8 uint8_value; + case TK_INT16: + short int16_value; + case TK_UINT16: + unsigned short uint_16_value; + case TK_INT32: + long int32_value; + case TK_UINT32: + unsigned long uint32_value; + case TK_INT64: + long long int64_value; + case TK_UINT64: + unsigned long long uint64_value; + case TK_FLOAT32: + float float32_value; + case TK_FLOAT64: + double float64_value; + case TK_FLOAT128: + long double float128_value; + case TK_CHAR8: + char char_value; + case TK_CHAR16: + wchar wchar_value; + case TK_ENUM: + long enumerated_value; + case TK_STRING8: + string string8_value; + case TK_STRING16: + wstring string16_value; + default: + ExtendedAnnotationParameterValue extended_value; + }; + + // The application of an annotation to some type or type member + @extensibility(APPENDABLE) @nested + struct AppliedAnnotationParameter { + NameHash paramname_hash; + AnnotationParameterValue value; + }; + // Sorted by AppliedAnnotationParameter.paramname_hash + typedef + sequence AppliedAnnotationParameterSeq; + + @extensibility(APPENDABLE) @nested + struct AppliedAnnotation { + TypeIdentifier annotation_typeid; + @optional AppliedAnnotationParameterSeq param_seq; + }; + // Sorted by AppliedAnnotation.annotation_typeid + typedef sequence AppliedAnnotationSeq; + + // @verbatim(placement="", language="", text="") + @extensibility(FINAL) @nested + struct AppliedVerbatimAnnotation { + string<32> placement; + string<32> language; + string text; + }; + + + // --- Aggregate types: ------------------------------------------------ + @extensibility(APPENDABLE) @nested + struct AppliedBuiltinMemberAnnotations { + @optional string unit; // @unit("") + @optional AnnotationParameterValue min; // @min , @range + @optional AnnotationParameterValue max; // @max , @range + @optional string hash_id; // @hash_id("") + }; + + @extensibility(FINAL) @nested + struct CommonStructMember { + MemberId member_id; + StructMemberFlag member_flags; + TypeIdentifier member_type_id; + }; + + // COMPLETE Details for a member of an aggregate type + @extensibility(FINAL) @nested + struct CompleteMemberDetail { + MemberName name; + @optional AppliedBuiltinMemberAnnotations ann_builtin; + @optional AppliedAnnotationSeq ann_custom; + }; + + // MINIMAL Details for a member of an aggregate type + @extensibility(FINAL) @nested + struct MinimalMemberDetail { + NameHash name_hash; + }; + + // Member of an aggregate type + @extensibility(APPENDABLE) @nested + struct CompleteStructMember { + CommonStructMember common; + CompleteMemberDetail detail; + }; + // Ordered by the member_index + typedef sequence CompleteStructMemberSeq; + + // Member of an aggregate type + @extensibility(APPENDABLE) @nested + struct MinimalStructMember { + CommonStructMember common; + MinimalMemberDetail detail; + }; + // Ordered by common.member_id + typedef sequence MinimalStructMemberSeq; + + + @extensibility(APPENDABLE) @nested + struct AppliedBuiltinTypeAnnotations { + @optional AppliedVerbatimAnnotation verbatim; // @verbatim(...) + }; + + @extensibility(FINAL) @nested + struct MinimalTypeDetail { + // Empty. Available for future extension + }; + + @extensibility(FINAL) @nested + struct CompleteTypeDetail { + @optional AppliedBuiltinTypeAnnotations ann_builtin; + @optional AppliedAnnotationSeq ann_custom; + QualifiedTypeName type_name; + }; + + @extensibility(APPENDABLE) @nested + struct CompleteStructHeader { + TypeIdentifier base_type; + CompleteTypeDetail detail; + }; + + @extensibility(APPENDABLE) @nested + struct MinimalStructHeader { + TypeIdentifier base_type; + MinimalTypeDetail detail; + }; + + @extensibility(FINAL) @nested + struct CompleteStructType { + StructTypeFlag struct_flags; + CompleteStructHeader header; + CompleteStructMemberSeq member_seq; + }; + + @extensibility(FINAL) @nested + struct MinimalStructType { + StructTypeFlag struct_flags; + MinimalStructHeader header; + MinimalStructMemberSeq member_seq; + }; + + // --- Union: ---------------------------------------------------------- + + // Case labels that apply to a member of a union type + // Ordered by their values + typedef sequence UnionCaseLabelSeq; + + @extensibility(FINAL) @nested + struct CommonUnionMember { + MemberId member_id; + UnionMemberFlag member_flags; + TypeIdentifier type_id; + UnionCaseLabelSeq label_seq; + }; + + // Member of a union type + @extensibility(APPENDABLE) @nested + struct CompleteUnionMember { + CommonUnionMember common; + CompleteMemberDetail detail; + }; + // Ordered by member_index + typedef sequence CompleteUnionMemberSeq; + + // Member of a union type + @extensibility(APPENDABLE) @nested + struct MinimalUnionMember { + CommonUnionMember common; + MinimalMemberDetail detail; + }; + // Ordered by MinimalUnionMember.common.member_id + typedef sequence MinimalUnionMemberSeq; + + @extensibility(FINAL) @nested + struct CommonDiscriminatorMember { + UnionDiscriminatorFlag member_flags; + TypeIdentifier type_id; + }; + + // Member of a union type + @extensibility(APPENDABLE) @nested + struct CompleteDiscriminatorMember { + CommonDiscriminatorMember common; + @optional AppliedBuiltinTypeAnnotations ann_builtin; + @optional AppliedAnnotationSeq ann_custom; + }; + + // Member of a union type + @extensibility(APPENDABLE) @nested + struct MinimalDiscriminatorMember { + CommonDiscriminatorMember common; + }; + + @extensibility(APPENDABLE) @nested + struct CompleteUnionHeader { + CompleteTypeDetail detail; + }; + + @extensibility(APPENDABLE) @nested + struct MinimalUnionHeader { + MinimalTypeDetail detail; + }; + + @extensibility(FINAL) @nested + struct CompleteUnionType { + UnionTypeFlag union_flags; + CompleteUnionHeader header; + CompleteDiscriminatorMember discriminator; + CompleteUnionMemberSeq member_seq; + }; + + @extensibility(FINAL) @nested + struct MinimalUnionType { + UnionTypeFlag union_flags; + MinimalUnionHeader header; + MinimalDiscriminatorMember discriminator; + MinimalUnionMemberSeq member_seq; + }; + + // --- Annotation: ---------------------------------------------------- + @extensibility(FINAL) @nested + struct CommonAnnotationParameter { + AnnotationParameterFlag member_flags; + TypeIdentifier member_type_id; + }; + + // Member of an annotation type + @extensibility(APPENDABLE) @nested + struct CompleteAnnotationParameter { + CommonAnnotationParameter common; + MemberName name; + AnnotationParameterValue default_value; + }; + // Ordered by CompleteAnnotationParameter.name + typedef + sequence CompleteAnnotationParameterSeq; + + @extensibility(APPENDABLE) @nested + struct MinimalAnnotationParameter { + CommonAnnotationParameter common; + NameHash name_hash; + AnnotationParameterValue default_value; + }; + // Ordered by MinimalAnnotationParameter.name_hash + typedef + sequence MinimalAnnotationParameterSeq; + + @extensibility(APPENDABLE) @nested + struct CompleteAnnotationHeader { + QualifiedTypeName annotation_name; + }; + + @extensibility(APPENDABLE) @nested + struct MinimalAnnotationHeader { + // Empty. Available for future extension + }; + + @extensibility(FINAL) @nested + struct CompleteAnnotationType { + AnnotationTypeFlag annotation_flag; + CompleteAnnotationHeader header; + CompleteAnnotationParameterSeq member_seq; + }; + + @extensibility(FINAL) @nested + struct MinimalAnnotationType { + AnnotationTypeFlag annotation_flag; + MinimalAnnotationHeader header; + MinimalAnnotationParameterSeq member_seq; + }; + + + // --- Alias: ---------------------------------------------------------- + @extensibility(FINAL) @nested + struct CommonAliasBody { + AliasMemberFlag related_flags; + TypeIdentifier related_type; + }; + + @extensibility(APPENDABLE) @nested + struct CompleteAliasBody { + CommonAliasBody common; + @optional AppliedBuiltinMemberAnnotations ann_builtin; + @optional AppliedAnnotationSeq ann_custom; + }; + + @extensibility(APPENDABLE) @nested + struct MinimalAliasBody { + CommonAliasBody common; + }; + + @extensibility(APPENDABLE) @nested + struct CompleteAliasHeader { + CompleteTypeDetail detail; + }; + + @extensibility(APPENDABLE) @nested + struct MinimalAliasHeader { + // Empty. Available for future extension + }; + + @extensibility(FINAL) @nested + struct CompleteAliasType { + AliasTypeFlag alias_flags; + CompleteAliasHeader header; + CompleteAliasBody body; + }; + + @extensibility(FINAL) @nested + struct MinimalAliasType { + AliasTypeFlag alias_flags; + MinimalAliasHeader header; + MinimalAliasBody body; + }; + + // --- Collections: ---------------------------------------------------- + @extensibility(FINAL) @nested + struct CompleteElementDetail { + @optional AppliedBuiltinMemberAnnotations ann_builtin; + @optional AppliedAnnotationSeq ann_custom; + }; + + @extensibility(FINAL) @nested + struct CommonCollectionElement { + CollectionElementFlag element_flags; + TypeIdentifier type; + }; + + @extensibility(APPENDABLE) @nested + struct CompleteCollectionElement { + CommonCollectionElement common; + CompleteElementDetail detail; + }; + + @extensibility(APPENDABLE) @nested + struct MinimalCollectionElement { + CommonCollectionElement common; + }; + + @extensibility(FINAL) @nested + struct CommonCollectionHeader { + LBound bound; + }; + + @extensibility(APPENDABLE) @nested + struct CompleteCollectionHeader { + CommonCollectionHeader common; + @optional CompleteTypeDetail detail; // not present for anonymous + }; + + @extensibility(APPENDABLE) @nested + struct MinimalCollectionHeader { + CommonCollectionHeader common; + }; + + // --- Sequence: ------------------------------------------------------ + @extensibility(FINAL) @nested + struct CompleteSequenceType { + CollectionTypeFlag collection_flag; + CompleteCollectionHeader header; + CompleteCollectionElement element; + }; + + @extensibility(FINAL) @nested + struct MinimalSequenceType { + CollectionTypeFlag collection_flag; + MinimalCollectionHeader header; + MinimalCollectionElement element; + }; + + // --- Array: ------------------------------------------------------ + @extensibility(FINAL) @nested + struct CommonArrayHeader { + LBoundSeq bound_seq; + }; + + @extensibility(APPENDABLE) @nested + struct CompleteArrayHeader { + CommonArrayHeader common; + CompleteTypeDetail detail; + }; + + @extensibility(APPENDABLE) @nested + struct MinimalArrayHeader { + CommonArrayHeader common; + }; + + @extensibility(APPENDABLE) @nested + struct CompleteArrayType { + CollectionTypeFlag collection_flag; + CompleteArrayHeader header; + CompleteCollectionElement element; + }; + + @extensibility(FINAL) @nested + struct MinimalArrayType { + CollectionTypeFlag collection_flag; + MinimalArrayHeader header; + MinimalCollectionElement element; + }; + + // --- Map: ------------------------------------------------------ + @extensibility(FINAL) @nested + struct CompleteMapType { + CollectionTypeFlag collection_flag; + CompleteCollectionHeader header; + CompleteCollectionElement key; + CompleteCollectionElement element; + }; + + @extensibility(FINAL) @nested + struct MinimalMapType { + CollectionTypeFlag collection_flag; + MinimalCollectionHeader header; + MinimalCollectionElement key; + MinimalCollectionElement element; + }; + + // --- Enumeration: ---------------------------------------------------- + typedef unsigned short BitBound; + + // Constant in an enumerated type + @extensibility(APPENDABLE) @nested + struct CommonEnumeratedLiteral { + long value; + EnumeratedLiteralFlag flags; + }; + + // Constant in an enumerated type + @extensibility(APPENDABLE) @nested + struct CompleteEnumeratedLiteral { + CommonEnumeratedLiteral common; + CompleteMemberDetail detail; + }; + // Ordered by EnumeratedLiteral.common.value + typedef sequence CompleteEnumeratedLiteralSeq; + + // Constant in an enumerated type + @extensibility(APPENDABLE) @nested + struct MinimalEnumeratedLiteral { + CommonEnumeratedLiteral common; + MinimalMemberDetail detail; + }; + // Ordered by EnumeratedLiteral.common.value + typedef sequence MinimalEnumeratedLiteralSeq; + + @extensibility(FINAL) @nested + struct CommonEnumeratedHeader { + BitBound bit_bound; + }; + + @extensibility(APPENDABLE) @nested + struct CompleteEnumeratedHeader { + CommonEnumeratedHeader common; + CompleteTypeDetail detail; + }; + + @extensibility(APPENDABLE) @nested + struct MinimalEnumeratedHeader { + CommonEnumeratedHeader common; + }; + + // Enumerated type + @extensibility(FINAL) @nested + struct CompleteEnumeratedType { + EnumTypeFlag enum_flags; // unused + CompleteEnumeratedHeader header; + CompleteEnumeratedLiteralSeq literal_seq; + }; + + // Enumerated type + @extensibility(FINAL) @nested + struct MinimalEnumeratedType { + EnumTypeFlag enum_flags; // unused + MinimalEnumeratedHeader header; + MinimalEnumeratedLiteralSeq literal_seq; + }; + + // --- Bitmask: -------------------------------------------------------- + // Bit in a bit mask + @extensibility(FINAL) @nested + struct CommonBitflag { + unsigned short position; + BitflagFlag flags; + }; + + @extensibility(APPENDABLE) @nested + struct CompleteBitflag { + CommonBitflag common; + CompleteMemberDetail detail; + }; + // Ordered by Bitflag.position + typedef sequence CompleteBitflagSeq; + + @extensibility(APPENDABLE) @nested + struct MinimalBitflag { + CommonBitflag common; + MinimalMemberDetail detail; + }; + // Ordered by Bitflag.position + typedef sequence MinimalBitflagSeq; + + @extensibility(FINAL) @nested + struct CommonBitmaskHeader { + BitBound bit_bound; + }; + + typedef CompleteEnumeratedHeader CompleteBitmaskHeader; + + typedef MinimalEnumeratedHeader MinimalBitmaskHeader; + + @extensibility(APPENDABLE) @nested + struct CompleteBitmaskType { + BitmaskTypeFlag bitmask_flags; // unused + CompleteBitmaskHeader header; + CompleteBitflagSeq flag_seq; + }; + + @extensibility(APPENDABLE) @nested + struct MinimalBitmaskType { + BitmaskTypeFlag bitmask_flags; // unused + MinimalBitmaskHeader header; + MinimalBitflagSeq flag_seq; + }; + + // --- Bitset: ---------------------------------------------------------- + @extensibility(FINAL) @nested + struct CommonBitfield { + unsigned short position; + BitsetMemberFlag flags; + octet bitcount; + TypeKind holder_type; // Must be primitive integer type + }; + + @extensibility(APPENDABLE) @nested + struct CompleteBitfield { + CommonBitfield common; + CompleteMemberDetail detail; + }; + // Ordered by Bitfield.position + typedef sequence CompleteBitfieldSeq; + + @extensibility(APPENDABLE) @nested + struct MinimalBitfield { + CommonBitfield common; + NameHash name_hash; + }; + // Ordered by Bitfield.position + typedef sequence MinimalBitfieldSeq; + + @extensibility(APPENDABLE) @nested + struct CompleteBitsetHeader { + CompleteTypeDetail detail; + }; + + @extensibility(APPENDABLE) @nested + struct MinimalBitsetHeader { + // Empty. Available for future extension + }; + + @extensibility(APPENDABLE) @nested + struct CompleteBitsetType { + BitsetTypeFlag bitset_flags; // unused + CompleteBitsetHeader header; + CompleteBitfieldSeq field_seq; + }; + + @extensibility(APPENDABLE) @nested + struct MinimalBitsetType { + BitsetTypeFlag bitset_flags; // unused + MinimalBitsetHeader header; + MinimalBitfieldSeq field_seq; + }; + + // --- Type Object: --------------------------------------------------- + // The types associated with each case selection must have extensibility + // kind APPENDABLE or MUTABLE so that they can be extended in the future + + @extensibility(MUTABLE) @nested + struct CompleteExtendedType { + // Empty. Available for future extension + }; + + @extensibility(FINAL) @nested + union CompleteTypeObject switch (octet) { + case TK_ALIAS: + CompleteAliasType alias_type; + case TK_ANNOTATION: + CompleteAnnotationType annotation_type; + case TK_STRUCTURE: + CompleteStructType struct_type; + case TK_UNION: + CompleteUnionType union_type; + case TK_BITSET: + CompleteBitsetType bitset_type; + case TK_SEQUENCE: + CompleteSequenceType sequence_type; + case TK_ARRAY: + CompleteArrayType array_type; + case TK_MAP: + CompleteMapType map_type; + case TK_ENUM: + CompleteEnumeratedType enumerated_type; + case TK_BITMASK: + CompleteBitmaskType bitmask_type; + + // =================== Future extensibility ============ + default: + CompleteExtendedType extended_type; + }; + + @extensibility(MUTABLE) @nested + struct MinimalExtendedType { + // Empty. Available for future extension + }; + + + @extensibility(FINAL) @nested + union MinimalTypeObject switch (octet) { + case TK_ALIAS: + MinimalAliasType alias_type; + case TK_ANNOTATION: + MinimalAnnotationType annotation_type; + case TK_STRUCTURE: + MinimalStructType struct_type; + case TK_UNION: + MinimalUnionType union_type; + case TK_BITSET: + MinimalBitsetType bitset_type; + case TK_SEQUENCE: + MinimalSequenceType sequence_type; + case TK_ARRAY: + MinimalArrayType array_type; + case TK_MAP: + MinimalMapType map_type; + case TK_ENUM: + MinimalEnumeratedType enumerated_type; + case TK_BITMASK: + MinimalBitmaskType bitmask_type; + + // =================== Future extensibility ============ + default: + MinimalExtendedType extended_type; + }; + + @extensibility(APPENDABLE) @nested + union TypeObject switch (octet) { // EquivalenceKind + case EK_COMPLETE: + CompleteTypeObject complete; + case EK_MINIMAL: + MinimalTypeObject minimal; + }; + typedef sequence TypeObjectSeq; + + // Set of TypeObjects representing a strong component: Equivalence class + // for the Strong Connectivity relationship (mutual reachability between + // types). + // Ordered by fully qualified typename lexicographic order + typedef TypeObjectSeq StronglyConnectedComponent; + + @extensibility(FINAL) @nested + struct TypeIdentifierTypeObjectPair { + TypeIdentifier type_identifier; + TypeObject type_object; + }; + typedef + sequence TypeIdentifierTypeObjectPairSeq; + + @extensibility(FINAL) @nested + struct TypeIdentifierPair { + TypeIdentifier type_identifier1; + TypeIdentifier type_identifier2; + }; + typedef sequence TypeIdentifierPairSeq; + + @extensibility(APPENDABLE) @nested + struct TypeIdentfierWithSize { + DDS::XTypes::TypeIdentifier type_id; + unsigned long typeobject_serialized_size; + }; + typedef sequence TypeIdentfierWithSizeSeq; + + @extensibility(APPENDABLE) @nested + struct TypeIdentifierWithDependencies { + TypeIdentfierWithSize typeid_with_size; + // The total additional types related to minimal_type + long dependent_typeid_count; + sequence dependent_typeids; + }; + typedef + sequence TypeIdentifierWithDependenciesSeq; + + // This appears in the builtin DDS topics PublicationBuiltinTopicData + // and SubscriptionBuiltinTopicData + @extensibility(MUTABLE) @nested + struct TypeInformation { + @id(0x1001) TypeIdentifierWithDependencies minimal; + @id(0x1002) TypeIdentifierWithDependencies complete; + }; + typedef sequence TypeInformationSeq; + +}; // end of module XTypes +}; // end module DDS + + + diff --git a/include/fastdds/dds/xtypes/type_representation/detail/dds_xtypes_typeobject.hpp b/include/fastdds/dds/xtypes/type_representation/detail/dds_xtypes_typeobject.hpp new file mode 100644 index 00000000000..e230483cdce --- /dev/null +++ b/include/fastdds/dds/xtypes/type_representation/detail/dds_xtypes_typeobject.hpp @@ -0,0 +1,24387 @@ +// 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 dds_xtypes_typeobject.hpp + * This header file contains the declaration of the described types in the IDL file. + * + * This file was generated by the tool fastddsgen. + */ + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_XTYPES_DDS_XTYPES_TYPEOBJECT_HPP_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_XTYPES_DDS_XTYPES_TYPEOBJECT_HPP_ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#define eProsima_user_DllExport __declspec( dllexport ) +#else +#define eProsima_user_DllExport +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define eProsima_user_DllExport +#endif // _WIN32 + +#if defined(_WIN32) +#if defined(EPROSIMA_USER_DLL_EXPORT) +#if defined(DDS_XTYPES_TYPEOBJECT_SOURCE) +#define DDS_XTYPES_TYPEOBJECT_DllAPI __declspec( dllexport ) +#else +#define DDS_XTYPES_TYPEOBJECT_DllAPI __declspec( dllimport ) +#endif // DDS_XTYPES_TYPEOBJECT_SOURCE +#else +#define DDS_XTYPES_TYPEOBJECT_DllAPI +#endif // EPROSIMA_USER_DLL_EXPORT +#else +#define DDS_XTYPES_TYPEOBJECT_DllAPI +#endif // _WIN32 + +namespace eprosima { + +namespace fastdds { + +namespace dds { + + +namespace xtypes { + + +typedef uint8_t EquivalenceKind; + +const uint8_t EK_MINIMAL = 0xF1; +const uint8_t EK_COMPLETE = 0xF2; +const uint8_t EK_BOTH = 0xF3; +typedef uint8_t TypeKind; + +const uint8_t TK_NONE = 0x00; +const uint8_t TK_BOOLEAN = 0x01; +const uint8_t TK_BYTE = 0x02; +const uint8_t TK_INT16 = 0x03; +const uint8_t TK_INT32 = 0x04; +const uint8_t TK_INT64 = 0x05; +const uint8_t TK_UINT16 = 0x06; +const uint8_t TK_UINT32 = 0x07; +const uint8_t TK_UINT64 = 0x08; +const uint8_t TK_FLOAT32 = 0x09; +const uint8_t TK_FLOAT64 = 0x0A; +const uint8_t TK_FLOAT128 = 0x0B; +const uint8_t TK_INT8 = 0x0C; +const uint8_t TK_UINT8 = 0x0D; +const uint8_t TK_CHAR8 = 0x10; +const uint8_t TK_CHAR16 = 0x11; +const uint8_t TK_STRING8 = 0x20; +const uint8_t TK_STRING16 = 0x21; +const uint8_t TK_ALIAS = 0x30; +const uint8_t TK_ENUM = 0x40; +const uint8_t TK_BITMASK = 0x41; +const uint8_t TK_ANNOTATION = 0x50; +const uint8_t TK_STRUCTURE = 0x51; +const uint8_t TK_UNION = 0x52; +const uint8_t TK_BITSET = 0x53; +const uint8_t TK_SEQUENCE = 0x60; +const uint8_t TK_ARRAY = 0x61; +const uint8_t TK_MAP = 0x62; +typedef uint8_t TypeIdentiferKind; + +const uint8_t TI_STRING8_SMALL = 0x70; +const uint8_t TI_STRING8_LARGE = 0x71; +const uint8_t TI_STRING16_SMALL = 0x72; +const uint8_t TI_STRING16_LARGE = 0x73; +const uint8_t TI_PLAIN_SEQUENCE_SMALL = 0x80; +const uint8_t TI_PLAIN_SEQUENCE_LARGE = 0x81; +const uint8_t TI_PLAIN_ARRAY_SMALL = 0x90; +const uint8_t TI_PLAIN_ARRAY_LARGE = 0x91; +const uint8_t TI_PLAIN_MAP_SMALL = 0xA0; +const uint8_t TI_PLAIN_MAP_LARGE = 0xA1; +const uint8_t TI_STRONGLY_CONNECTED_COMPONENT = 0xB0; +const int32_t MEMBER_NAME_MAX_LENGTH = 256; +typedef eprosima::fastcdr::fixed_string MemberName; + +const int32_t TYPE_NAME_MAX_LENGTH = 256; +typedef eprosima::fastcdr::fixed_string QualifiedTypeName; + +typedef uint8_t PrimitiveTypeId; + +typedef std::array EquivalenceHash; + +typedef std::array NameHash; + +typedef uint32_t LBound; + +typedef std::vector LBoundSeq; + +const LBound INVALID_LBOUND = 0; +typedef uint8_t SBound; + +typedef std::vector SBoundSeq; + +const SBound INVALID_SBOUND = 0; +/*! + * @brief This class represents the union TypeObjectHashId defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class TypeObjectHashId +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TypeObjectHashId() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TypeObjectHashId() + { + if (member_destructor_) + { + member_destructor_(); + } + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object TypeObjectHashId that will be copied. + */ + eProsima_user_DllExport TypeObjectHashId( + const TypeObjectHashId& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + hash_() = x.m_hash; + break; + + } + } + + /*! + * @brief Move constructor. + * @param x Reference to the object TypeObjectHashId that will be copied. + */ + eProsima_user_DllExport TypeObjectHashId( + TypeObjectHashId&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + hash_() = std::move(x.m_hash); + break; + + } + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object TypeObjectHashId that will be copied. + */ + eProsima_user_DllExport TypeObjectHashId& operator =( + const TypeObjectHashId& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + hash_() = x.m_hash; + break; + + } + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object TypeObjectHashId that will be copied. + */ + eProsima_user_DllExport TypeObjectHashId& operator =( + TypeObjectHashId&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + hash_() = std::move(x.m_hash); + break; + + } + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x TypeObjectHashId object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TypeObjectHashId& x) const + { + bool ret_value {false}; + + if (m__d == x.m__d && + selected_member_ == x.selected_member_) + { + switch (selected_member_) + { + case 0x00000001: + ret_value = (m_hash == x.m_hash); + break; + + } + } + + return ret_value; + } + + /*! + * @brief Comparison operator. + * @param x TypeObjectHashId object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TypeObjectHashId& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + uint8_t __d) + { + bool valid_discriminator = false; + + switch (__d) + { + case EK_COMPLETE: + case EK_MINIMAL: + if (0x00000001 == selected_member_) + { + valid_discriminator = true; + } + break; + + } + + if (!valid_discriminator) + { + throw eprosima::fastcdr::exception::BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; + } + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport uint8_t _d() const + { + return m__d; + } + + /*! + * @brief This function copies the value in member hash + * @param _hash New value to be copied in member hash + */ + eProsima_user_DllExport void hash( + const EquivalenceHash& _hash) + { + hash_() = _hash; + m__d = EK_COMPLETE; + } + + /*! + * @brief This function moves the value in member hash + * @param _hash New value to be moved in member hash + */ + eProsima_user_DllExport void hash( + EquivalenceHash&& _hash) + { + hash_() = _hash; + m__d = EK_COMPLETE; + } + + /*! + * @brief This function returns a constant reference to member hash + * @return Constant reference to member hash + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const EquivalenceHash& hash() const + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_hash; + } + + /*! + * @brief This function returns a reference to member hash + * @return Reference to member hash + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport EquivalenceHash& hash() + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_hash; + } + + + void _default() + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0FFFFFFFu; + } + + +private: + + EquivalenceHash& hash_() + { + if (0x00000001 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000001; + member_destructor_ = [&]() {m_hash.~EquivalenceHash();}; + new(&m_hash) EquivalenceHash(); + ; + } + + return m_hash; + } + + + uint8_t m__d {0}; + + union + { + EquivalenceHash m_hash; + }; + + uint32_t selected_member_ {0x0FFFFFFFu}; + + std::function member_destructor_; +}; +/*! + * @brief This enumeration represents the MemberFlag bitflags defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +enum MemberFlagBits : uint16_t +{ + TRY_CONSTRUCT1 = 0x01ull << 0, + TRY_CONSTRUCT2 = 0x01ull << 1, + IS_EXTERNAL = 0x01ull << 2, + IS_OPTIONAL = 0x01ull << 3, + IS_MUST_UNDERSTAND = 0x01ull << 4, + IS_KEY = 0x01ull << 5, + IS_DEFAULT = 0x01ull << 6 +}; +typedef uint16_t MemberFlag; +typedef MemberFlag CollectionElementFlag; + +typedef MemberFlag StructMemberFlag; + +typedef MemberFlag UnionMemberFlag; + +typedef MemberFlag UnionDiscriminatorFlag; + +typedef MemberFlag EnumeratedLiteralFlag; + +typedef MemberFlag AnnotationParameterFlag; + +typedef MemberFlag AliasMemberFlag; + +typedef MemberFlag BitflagFlag; + +typedef MemberFlag BitsetMemberFlag; + +const uint16_t MemberFlagMinimalMask = 0x003f; +/*! + * @brief This enumeration represents the TypeFlag bitflags defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +enum TypeFlagBits : uint16_t +{ + IS_FINAL = 0x01ull << 0, + IS_APPENDABLE = 0x01ull << 1, + IS_MUTABLE = 0x01ull << 2, + IS_NESTED = 0x01ull << 3, + IS_AUTOID_HASH = 0x01ull << 4 +}; +typedef uint16_t TypeFlag; +typedef TypeFlag StructTypeFlag; + +typedef TypeFlag UnionTypeFlag; + +typedef TypeFlag CollectionTypeFlag; + +typedef TypeFlag AnnotationTypeFlag; + +typedef TypeFlag AliasTypeFlag; + +typedef TypeFlag EnumTypeFlag; + +typedef TypeFlag BitmaskTypeFlag; + +typedef TypeFlag BitsetTypeFlag; + +const uint16_t TypeFlagMinimalMask = 0x0007; +class TypeIdentifier; + +/*! + * @brief This class represents the structure StringSTypeDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class StringSTypeDefn +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport StringSTypeDefn() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~StringSTypeDefn() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object StringSTypeDefn that will be copied. + */ + eProsima_user_DllExport StringSTypeDefn( + const StringSTypeDefn& x) + { + m_bound = x.m_bound; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object StringSTypeDefn that will be copied. + */ + eProsima_user_DllExport StringSTypeDefn( + StringSTypeDefn&& x) noexcept + { + m_bound = x.m_bound; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object StringSTypeDefn that will be copied. + */ + eProsima_user_DllExport StringSTypeDefn& operator =( + const StringSTypeDefn& x) + { + + m_bound = x.m_bound; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object StringSTypeDefn that will be copied. + */ + eProsima_user_DllExport StringSTypeDefn& operator =( + StringSTypeDefn&& x) noexcept + { + + m_bound = x.m_bound; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x StringSTypeDefn object to compare. + */ + eProsima_user_DllExport bool operator ==( + const StringSTypeDefn& x) const + { + return (m_bound == x.m_bound); + } + + /*! + * @brief Comparison operator. + * @param x StringSTypeDefn object to compare. + */ + eProsima_user_DllExport bool operator !=( + const StringSTypeDefn& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member bound + * @param _bound New value for member bound + */ + eProsima_user_DllExport void bound( + SBound _bound) + { + m_bound = _bound; + } + + /*! + * @brief This function returns the value of member bound + * @return Value of member bound + */ + eProsima_user_DllExport SBound bound() const + { + return m_bound; + } + + /*! + * @brief This function returns a reference to member bound + * @return Reference to member bound + */ + eProsima_user_DllExport SBound& bound() + { + return m_bound; + } + + + +private: + + SBound m_bound{0}; + +}; +/*! + * @brief This class represents the structure StringLTypeDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class StringLTypeDefn +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport StringLTypeDefn() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~StringLTypeDefn() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object StringLTypeDefn that will be copied. + */ + eProsima_user_DllExport StringLTypeDefn( + const StringLTypeDefn& x) + { + m_bound = x.m_bound; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object StringLTypeDefn that will be copied. + */ + eProsima_user_DllExport StringLTypeDefn( + StringLTypeDefn&& x) noexcept + { + m_bound = x.m_bound; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object StringLTypeDefn that will be copied. + */ + eProsima_user_DllExport StringLTypeDefn& operator =( + const StringLTypeDefn& x) + { + + m_bound = x.m_bound; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object StringLTypeDefn that will be copied. + */ + eProsima_user_DllExport StringLTypeDefn& operator =( + StringLTypeDefn&& x) noexcept + { + + m_bound = x.m_bound; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x StringLTypeDefn object to compare. + */ + eProsima_user_DllExport bool operator ==( + const StringLTypeDefn& x) const + { + return (m_bound == x.m_bound); + } + + /*! + * @brief Comparison operator. + * @param x StringLTypeDefn object to compare. + */ + eProsima_user_DllExport bool operator !=( + const StringLTypeDefn& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member bound + * @param _bound New value for member bound + */ + eProsima_user_DllExport void bound( + LBound _bound) + { + m_bound = _bound; + } + + /*! + * @brief This function returns the value of member bound + * @return Value of member bound + */ + eProsima_user_DllExport LBound bound() const + { + return m_bound; + } + + /*! + * @brief This function returns a reference to member bound + * @return Reference to member bound + */ + eProsima_user_DllExport LBound& bound() + { + return m_bound; + } + + + +private: + + LBound m_bound{0}; + +}; +/*! + * @brief This class represents the structure PlainCollectionHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class PlainCollectionHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PlainCollectionHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PlainCollectionHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object PlainCollectionHeader that will be copied. + */ + eProsima_user_DllExport PlainCollectionHeader( + const PlainCollectionHeader& x) + { + m_equiv_kind = x.m_equiv_kind; + + m_element_flags = x.m_element_flags; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object PlainCollectionHeader that will be copied. + */ + eProsima_user_DllExport PlainCollectionHeader( + PlainCollectionHeader&& x) noexcept + { + m_equiv_kind = x.m_equiv_kind; + m_element_flags = std::move(x.m_element_flags); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object PlainCollectionHeader that will be copied. + */ + eProsima_user_DllExport PlainCollectionHeader& operator =( + const PlainCollectionHeader& x) + { + + m_equiv_kind = x.m_equiv_kind; + + m_element_flags = x.m_element_flags; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object PlainCollectionHeader that will be copied. + */ + eProsima_user_DllExport PlainCollectionHeader& operator =( + PlainCollectionHeader&& x) noexcept + { + + m_equiv_kind = x.m_equiv_kind; + m_element_flags = std::move(x.m_element_flags); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x PlainCollectionHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PlainCollectionHeader& x) const + { + return (m_equiv_kind == x.m_equiv_kind && + m_element_flags == x.m_element_flags); + } + + /*! + * @brief Comparison operator. + * @param x PlainCollectionHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PlainCollectionHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member equiv_kind + * @param _equiv_kind New value for member equiv_kind + */ + eProsima_user_DllExport void equiv_kind( + EquivalenceKind _equiv_kind) + { + m_equiv_kind = _equiv_kind; + } + + /*! + * @brief This function returns the value of member equiv_kind + * @return Value of member equiv_kind + */ + eProsima_user_DllExport EquivalenceKind equiv_kind() const + { + return m_equiv_kind; + } + + /*! + * @brief This function returns a reference to member equiv_kind + * @return Reference to member equiv_kind + */ + eProsima_user_DllExport EquivalenceKind& equiv_kind() + { + return m_equiv_kind; + } + + + /*! + * @brief This function copies the value in member element_flags + * @param _element_flags New value to be copied in member element_flags + */ + eProsima_user_DllExport void element_flags( + const CollectionElementFlag& _element_flags) + { + m_element_flags = _element_flags; + } + + /*! + * @brief This function moves the value in member element_flags + * @param _element_flags New value to be moved in member element_flags + */ + eProsima_user_DllExport void element_flags( + CollectionElementFlag&& _element_flags) + { + m_element_flags = std::move(_element_flags); + } + + /*! + * @brief This function returns a constant reference to member element_flags + * @return Constant reference to member element_flags + */ + eProsima_user_DllExport const CollectionElementFlag& element_flags() const + { + return m_element_flags; + } + + /*! + * @brief This function returns a reference to member element_flags + * @return Reference to member element_flags + */ + eProsima_user_DllExport CollectionElementFlag& element_flags() + { + return m_element_flags; + } + + + +private: + + EquivalenceKind m_equiv_kind{0}; + CollectionElementFlag m_element_flags{0}; + +}; +/*! + * @brief This class represents the structure PlainSequenceSElemDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class PlainSequenceSElemDefn +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PlainSequenceSElemDefn() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PlainSequenceSElemDefn() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object PlainSequenceSElemDefn that will be copied. + */ + eProsima_user_DllExport PlainSequenceSElemDefn( + const PlainSequenceSElemDefn& x) + { + m_header = x.m_header; + + m_bound = x.m_bound; + + m_element_identifier = x.m_element_identifier; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object PlainSequenceSElemDefn that will be copied. + */ + eProsima_user_DllExport PlainSequenceSElemDefn( + PlainSequenceSElemDefn&& x) noexcept + { + m_header = std::move(x.m_header); + m_bound = x.m_bound; + m_element_identifier = std::move(x.m_element_identifier); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object PlainSequenceSElemDefn that will be copied. + */ + eProsima_user_DllExport PlainSequenceSElemDefn& operator =( + const PlainSequenceSElemDefn& x) + { + + m_header = x.m_header; + + m_bound = x.m_bound; + + m_element_identifier = x.m_element_identifier; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object PlainSequenceSElemDefn that will be copied. + */ + eProsima_user_DllExport PlainSequenceSElemDefn& operator =( + PlainSequenceSElemDefn&& x) noexcept + { + + m_header = std::move(x.m_header); + m_bound = x.m_bound; + m_element_identifier = std::move(x.m_element_identifier); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x PlainSequenceSElemDefn object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PlainSequenceSElemDefn& x) const + { + return (m_header == x.m_header && + m_bound == x.m_bound && + m_element_identifier == x.m_element_identifier); + } + + /*! + * @brief Comparison operator. + * @param x PlainSequenceSElemDefn object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PlainSequenceSElemDefn& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const PlainCollectionHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + PlainCollectionHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const PlainCollectionHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport PlainCollectionHeader& header() + { + return m_header; + } + + + /*! + * @brief This function sets a value in member bound + * @param _bound New value for member bound + */ + eProsima_user_DllExport void bound( + SBound _bound) + { + m_bound = _bound; + } + + /*! + * @brief This function returns the value of member bound + * @return Value of member bound + */ + eProsima_user_DllExport SBound bound() const + { + return m_bound; + } + + /*! + * @brief This function returns a reference to member bound + * @return Reference to member bound + */ + eProsima_user_DllExport SBound& bound() + { + return m_bound; + } + + + /*! + * @brief This function copies the value in member element_identifier + * @param _element_identifier New value to be copied in member element_identifier + */ + eProsima_user_DllExport void element_identifier( + const eprosima::fastcdr::external& _element_identifier) + { + m_element_identifier = _element_identifier; + } + + /*! + * @brief This function moves the value in member element_identifier + * @param _element_identifier New value to be moved in member element_identifier + */ + eProsima_user_DllExport void element_identifier( + eprosima::fastcdr::external&& _element_identifier) + { + m_element_identifier = std::move(_element_identifier); + } + + /*! + * @brief This function returns a constant reference to member element_identifier + * @return Constant reference to member element_identifier + */ + eProsima_user_DllExport const eprosima::fastcdr::external& element_identifier() const + { + return m_element_identifier; + } + + /*! + * @brief This function returns a reference to member element_identifier + * @return Reference to member element_identifier + */ + eProsima_user_DllExport eprosima::fastcdr::external& element_identifier() + { + return m_element_identifier; + } + + + +private: + + PlainCollectionHeader m_header; + SBound m_bound{0}; + eprosima::fastcdr::external m_element_identifier; + +}; +/*! + * @brief This class represents the structure PlainSequenceLElemDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class PlainSequenceLElemDefn +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PlainSequenceLElemDefn() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PlainSequenceLElemDefn() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object PlainSequenceLElemDefn that will be copied. + */ + eProsima_user_DllExport PlainSequenceLElemDefn( + const PlainSequenceLElemDefn& x) + { + m_header = x.m_header; + + m_bound = x.m_bound; + + m_element_identifier = x.m_element_identifier; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object PlainSequenceLElemDefn that will be copied. + */ + eProsima_user_DllExport PlainSequenceLElemDefn( + PlainSequenceLElemDefn&& x) noexcept + { + m_header = std::move(x.m_header); + m_bound = x.m_bound; + m_element_identifier = std::move(x.m_element_identifier); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object PlainSequenceLElemDefn that will be copied. + */ + eProsima_user_DllExport PlainSequenceLElemDefn& operator =( + const PlainSequenceLElemDefn& x) + { + + m_header = x.m_header; + + m_bound = x.m_bound; + + m_element_identifier = x.m_element_identifier; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object PlainSequenceLElemDefn that will be copied. + */ + eProsima_user_DllExport PlainSequenceLElemDefn& operator =( + PlainSequenceLElemDefn&& x) noexcept + { + + m_header = std::move(x.m_header); + m_bound = x.m_bound; + m_element_identifier = std::move(x.m_element_identifier); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x PlainSequenceLElemDefn object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PlainSequenceLElemDefn& x) const + { + return (m_header == x.m_header && + m_bound == x.m_bound && + m_element_identifier == x.m_element_identifier); + } + + /*! + * @brief Comparison operator. + * @param x PlainSequenceLElemDefn object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PlainSequenceLElemDefn& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const PlainCollectionHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + PlainCollectionHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const PlainCollectionHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport PlainCollectionHeader& header() + { + return m_header; + } + + + /*! + * @brief This function sets a value in member bound + * @param _bound New value for member bound + */ + eProsima_user_DllExport void bound( + LBound _bound) + { + m_bound = _bound; + } + + /*! + * @brief This function returns the value of member bound + * @return Value of member bound + */ + eProsima_user_DllExport LBound bound() const + { + return m_bound; + } + + /*! + * @brief This function returns a reference to member bound + * @return Reference to member bound + */ + eProsima_user_DllExport LBound& bound() + { + return m_bound; + } + + + /*! + * @brief This function copies the value in member element_identifier + * @param _element_identifier New value to be copied in member element_identifier + */ + eProsima_user_DllExport void element_identifier( + const eprosima::fastcdr::external& _element_identifier) + { + m_element_identifier = _element_identifier; + } + + /*! + * @brief This function moves the value in member element_identifier + * @param _element_identifier New value to be moved in member element_identifier + */ + eProsima_user_DllExport void element_identifier( + eprosima::fastcdr::external&& _element_identifier) + { + m_element_identifier = std::move(_element_identifier); + } + + /*! + * @brief This function returns a constant reference to member element_identifier + * @return Constant reference to member element_identifier + */ + eProsima_user_DllExport const eprosima::fastcdr::external& element_identifier() const + { + return m_element_identifier; + } + + /*! + * @brief This function returns a reference to member element_identifier + * @return Reference to member element_identifier + */ + eProsima_user_DllExport eprosima::fastcdr::external& element_identifier() + { + return m_element_identifier; + } + + + +private: + + PlainCollectionHeader m_header; + LBound m_bound{0}; + eprosima::fastcdr::external m_element_identifier; + +}; +/*! + * @brief This class represents the structure PlainArraySElemDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class PlainArraySElemDefn +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PlainArraySElemDefn() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PlainArraySElemDefn() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object PlainArraySElemDefn that will be copied. + */ + eProsima_user_DllExport PlainArraySElemDefn( + const PlainArraySElemDefn& x) + { + m_header = x.m_header; + + m_array_bound_seq = x.m_array_bound_seq; + + m_element_identifier = x.m_element_identifier; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object PlainArraySElemDefn that will be copied. + */ + eProsima_user_DllExport PlainArraySElemDefn( + PlainArraySElemDefn&& x) noexcept + { + m_header = std::move(x.m_header); + m_array_bound_seq = std::move(x.m_array_bound_seq); + m_element_identifier = std::move(x.m_element_identifier); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object PlainArraySElemDefn that will be copied. + */ + eProsima_user_DllExport PlainArraySElemDefn& operator =( + const PlainArraySElemDefn& x) + { + + m_header = x.m_header; + + m_array_bound_seq = x.m_array_bound_seq; + + m_element_identifier = x.m_element_identifier; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object PlainArraySElemDefn that will be copied. + */ + eProsima_user_DllExport PlainArraySElemDefn& operator =( + PlainArraySElemDefn&& x) noexcept + { + + m_header = std::move(x.m_header); + m_array_bound_seq = std::move(x.m_array_bound_seq); + m_element_identifier = std::move(x.m_element_identifier); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x PlainArraySElemDefn object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PlainArraySElemDefn& x) const + { + return (m_header == x.m_header && + m_array_bound_seq == x.m_array_bound_seq && + m_element_identifier == x.m_element_identifier); + } + + /*! + * @brief Comparison operator. + * @param x PlainArraySElemDefn object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PlainArraySElemDefn& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const PlainCollectionHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + PlainCollectionHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const PlainCollectionHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport PlainCollectionHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member array_bound_seq + * @param _array_bound_seq New value to be copied in member array_bound_seq + */ + eProsima_user_DllExport void array_bound_seq( + const SBoundSeq& _array_bound_seq) + { + m_array_bound_seq = _array_bound_seq; + } + + /*! + * @brief This function moves the value in member array_bound_seq + * @param _array_bound_seq New value to be moved in member array_bound_seq + */ + eProsima_user_DllExport void array_bound_seq( + SBoundSeq&& _array_bound_seq) + { + m_array_bound_seq = std::move(_array_bound_seq); + } + + /*! + * @brief This function returns a constant reference to member array_bound_seq + * @return Constant reference to member array_bound_seq + */ + eProsima_user_DllExport const SBoundSeq& array_bound_seq() const + { + return m_array_bound_seq; + } + + /*! + * @brief This function returns a reference to member array_bound_seq + * @return Reference to member array_bound_seq + */ + eProsima_user_DllExport SBoundSeq& array_bound_seq() + { + return m_array_bound_seq; + } + + + /*! + * @brief This function copies the value in member element_identifier + * @param _element_identifier New value to be copied in member element_identifier + */ + eProsima_user_DllExport void element_identifier( + const eprosima::fastcdr::external& _element_identifier) + { + m_element_identifier = _element_identifier; + } + + /*! + * @brief This function moves the value in member element_identifier + * @param _element_identifier New value to be moved in member element_identifier + */ + eProsima_user_DllExport void element_identifier( + eprosima::fastcdr::external&& _element_identifier) + { + m_element_identifier = std::move(_element_identifier); + } + + /*! + * @brief This function returns a constant reference to member element_identifier + * @return Constant reference to member element_identifier + */ + eProsima_user_DllExport const eprosima::fastcdr::external& element_identifier() const + { + return m_element_identifier; + } + + /*! + * @brief This function returns a reference to member element_identifier + * @return Reference to member element_identifier + */ + eProsima_user_DllExport eprosima::fastcdr::external& element_identifier() + { + return m_element_identifier; + } + + + +private: + + PlainCollectionHeader m_header; + SBoundSeq m_array_bound_seq; + eprosima::fastcdr::external m_element_identifier; + +}; +/*! + * @brief This class represents the structure PlainArrayLElemDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class PlainArrayLElemDefn +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PlainArrayLElemDefn() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PlainArrayLElemDefn() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object PlainArrayLElemDefn that will be copied. + */ + eProsima_user_DllExport PlainArrayLElemDefn( + const PlainArrayLElemDefn& x) + { + m_header = x.m_header; + + m_array_bound_seq = x.m_array_bound_seq; + + m_element_identifier = x.m_element_identifier; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object PlainArrayLElemDefn that will be copied. + */ + eProsima_user_DllExport PlainArrayLElemDefn( + PlainArrayLElemDefn&& x) noexcept + { + m_header = std::move(x.m_header); + m_array_bound_seq = std::move(x.m_array_bound_seq); + m_element_identifier = std::move(x.m_element_identifier); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object PlainArrayLElemDefn that will be copied. + */ + eProsima_user_DllExport PlainArrayLElemDefn& operator =( + const PlainArrayLElemDefn& x) + { + + m_header = x.m_header; + + m_array_bound_seq = x.m_array_bound_seq; + + m_element_identifier = x.m_element_identifier; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object PlainArrayLElemDefn that will be copied. + */ + eProsima_user_DllExport PlainArrayLElemDefn& operator =( + PlainArrayLElemDefn&& x) noexcept + { + + m_header = std::move(x.m_header); + m_array_bound_seq = std::move(x.m_array_bound_seq); + m_element_identifier = std::move(x.m_element_identifier); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x PlainArrayLElemDefn object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PlainArrayLElemDefn& x) const + { + return (m_header == x.m_header && + m_array_bound_seq == x.m_array_bound_seq && + m_element_identifier == x.m_element_identifier); + } + + /*! + * @brief Comparison operator. + * @param x PlainArrayLElemDefn object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PlainArrayLElemDefn& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const PlainCollectionHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + PlainCollectionHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const PlainCollectionHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport PlainCollectionHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member array_bound_seq + * @param _array_bound_seq New value to be copied in member array_bound_seq + */ + eProsima_user_DllExport void array_bound_seq( + const LBoundSeq& _array_bound_seq) + { + m_array_bound_seq = _array_bound_seq; + } + + /*! + * @brief This function moves the value in member array_bound_seq + * @param _array_bound_seq New value to be moved in member array_bound_seq + */ + eProsima_user_DllExport void array_bound_seq( + LBoundSeq&& _array_bound_seq) + { + m_array_bound_seq = std::move(_array_bound_seq); + } + + /*! + * @brief This function returns a constant reference to member array_bound_seq + * @return Constant reference to member array_bound_seq + */ + eProsima_user_DllExport const LBoundSeq& array_bound_seq() const + { + return m_array_bound_seq; + } + + /*! + * @brief This function returns a reference to member array_bound_seq + * @return Reference to member array_bound_seq + */ + eProsima_user_DllExport LBoundSeq& array_bound_seq() + { + return m_array_bound_seq; + } + + + /*! + * @brief This function copies the value in member element_identifier + * @param _element_identifier New value to be copied in member element_identifier + */ + eProsima_user_DllExport void element_identifier( + const eprosima::fastcdr::external& _element_identifier) + { + m_element_identifier = _element_identifier; + } + + /*! + * @brief This function moves the value in member element_identifier + * @param _element_identifier New value to be moved in member element_identifier + */ + eProsima_user_DllExport void element_identifier( + eprosima::fastcdr::external&& _element_identifier) + { + m_element_identifier = std::move(_element_identifier); + } + + /*! + * @brief This function returns a constant reference to member element_identifier + * @return Constant reference to member element_identifier + */ + eProsima_user_DllExport const eprosima::fastcdr::external& element_identifier() const + { + return m_element_identifier; + } + + /*! + * @brief This function returns a reference to member element_identifier + * @return Reference to member element_identifier + */ + eProsima_user_DllExport eprosima::fastcdr::external& element_identifier() + { + return m_element_identifier; + } + + + +private: + + PlainCollectionHeader m_header; + LBoundSeq m_array_bound_seq; + eprosima::fastcdr::external m_element_identifier; + +}; +/*! + * @brief This class represents the structure PlainMapSTypeDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class PlainMapSTypeDefn +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PlainMapSTypeDefn() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PlainMapSTypeDefn() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object PlainMapSTypeDefn that will be copied. + */ + eProsima_user_DllExport PlainMapSTypeDefn( + const PlainMapSTypeDefn& x) + { + m_header = x.m_header; + + m_bound = x.m_bound; + + m_element_identifier = x.m_element_identifier; + + m_key_flags = x.m_key_flags; + + m_key_identifier = x.m_key_identifier; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object PlainMapSTypeDefn that will be copied. + */ + eProsima_user_DllExport PlainMapSTypeDefn( + PlainMapSTypeDefn&& x) noexcept + { + m_header = std::move(x.m_header); + m_bound = x.m_bound; + m_element_identifier = std::move(x.m_element_identifier); + m_key_flags = std::move(x.m_key_flags); + m_key_identifier = std::move(x.m_key_identifier); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object PlainMapSTypeDefn that will be copied. + */ + eProsima_user_DllExport PlainMapSTypeDefn& operator =( + const PlainMapSTypeDefn& x) + { + + m_header = x.m_header; + + m_bound = x.m_bound; + + m_element_identifier = x.m_element_identifier; + + m_key_flags = x.m_key_flags; + + m_key_identifier = x.m_key_identifier; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object PlainMapSTypeDefn that will be copied. + */ + eProsima_user_DllExport PlainMapSTypeDefn& operator =( + PlainMapSTypeDefn&& x) noexcept + { + + m_header = std::move(x.m_header); + m_bound = x.m_bound; + m_element_identifier = std::move(x.m_element_identifier); + m_key_flags = std::move(x.m_key_flags); + m_key_identifier = std::move(x.m_key_identifier); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x PlainMapSTypeDefn object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PlainMapSTypeDefn& x) const + { + return (m_header == x.m_header && + m_bound == x.m_bound && + m_element_identifier == x.m_element_identifier && + m_key_flags == x.m_key_flags && + m_key_identifier == x.m_key_identifier); + } + + /*! + * @brief Comparison operator. + * @param x PlainMapSTypeDefn object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PlainMapSTypeDefn& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const PlainCollectionHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + PlainCollectionHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const PlainCollectionHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport PlainCollectionHeader& header() + { + return m_header; + } + + + /*! + * @brief This function sets a value in member bound + * @param _bound New value for member bound + */ + eProsima_user_DllExport void bound( + SBound _bound) + { + m_bound = _bound; + } + + /*! + * @brief This function returns the value of member bound + * @return Value of member bound + */ + eProsima_user_DllExport SBound bound() const + { + return m_bound; + } + + /*! + * @brief This function returns a reference to member bound + * @return Reference to member bound + */ + eProsima_user_DllExport SBound& bound() + { + return m_bound; + } + + + /*! + * @brief This function copies the value in member element_identifier + * @param _element_identifier New value to be copied in member element_identifier + */ + eProsima_user_DllExport void element_identifier( + const eprosima::fastcdr::external& _element_identifier) + { + m_element_identifier = _element_identifier; + } + + /*! + * @brief This function moves the value in member element_identifier + * @param _element_identifier New value to be moved in member element_identifier + */ + eProsima_user_DllExport void element_identifier( + eprosima::fastcdr::external&& _element_identifier) + { + m_element_identifier = std::move(_element_identifier); + } + + /*! + * @brief This function returns a constant reference to member element_identifier + * @return Constant reference to member element_identifier + */ + eProsima_user_DllExport const eprosima::fastcdr::external& element_identifier() const + { + return m_element_identifier; + } + + /*! + * @brief This function returns a reference to member element_identifier + * @return Reference to member element_identifier + */ + eProsima_user_DllExport eprosima::fastcdr::external& element_identifier() + { + return m_element_identifier; + } + + + /*! + * @brief This function copies the value in member key_flags + * @param _key_flags New value to be copied in member key_flags + */ + eProsima_user_DllExport void key_flags( + const CollectionElementFlag& _key_flags) + { + m_key_flags = _key_flags; + } + + /*! + * @brief This function moves the value in member key_flags + * @param _key_flags New value to be moved in member key_flags + */ + eProsima_user_DllExport void key_flags( + CollectionElementFlag&& _key_flags) + { + m_key_flags = std::move(_key_flags); + } + + /*! + * @brief This function returns a constant reference to member key_flags + * @return Constant reference to member key_flags + */ + eProsima_user_DllExport const CollectionElementFlag& key_flags() const + { + return m_key_flags; + } + + /*! + * @brief This function returns a reference to member key_flags + * @return Reference to member key_flags + */ + eProsima_user_DllExport CollectionElementFlag& key_flags() + { + return m_key_flags; + } + + + /*! + * @brief This function copies the value in member key_identifier + * @param _key_identifier New value to be copied in member key_identifier + */ + eProsima_user_DllExport void key_identifier( + const eprosima::fastcdr::external& _key_identifier) + { + m_key_identifier = _key_identifier; + } + + /*! + * @brief This function moves the value in member key_identifier + * @param _key_identifier New value to be moved in member key_identifier + */ + eProsima_user_DllExport void key_identifier( + eprosima::fastcdr::external&& _key_identifier) + { + m_key_identifier = std::move(_key_identifier); + } + + /*! + * @brief This function returns a constant reference to member key_identifier + * @return Constant reference to member key_identifier + */ + eProsima_user_DllExport const eprosima::fastcdr::external& key_identifier() const + { + return m_key_identifier; + } + + /*! + * @brief This function returns a reference to member key_identifier + * @return Reference to member key_identifier + */ + eProsima_user_DllExport eprosima::fastcdr::external& key_identifier() + { + return m_key_identifier; + } + + + +private: + + PlainCollectionHeader m_header; + SBound m_bound{0}; + eprosima::fastcdr::external m_element_identifier; + CollectionElementFlag m_key_flags{0}; + eprosima::fastcdr::external m_key_identifier; + +}; +/*! + * @brief This class represents the structure PlainMapLTypeDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class PlainMapLTypeDefn +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport PlainMapLTypeDefn() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~PlainMapLTypeDefn() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object PlainMapLTypeDefn that will be copied. + */ + eProsima_user_DllExport PlainMapLTypeDefn( + const PlainMapLTypeDefn& x) + { + m_header = x.m_header; + + m_bound = x.m_bound; + + m_element_identifier = x.m_element_identifier; + + m_key_flags = x.m_key_flags; + + m_key_identifier = x.m_key_identifier; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object PlainMapLTypeDefn that will be copied. + */ + eProsima_user_DllExport PlainMapLTypeDefn( + PlainMapLTypeDefn&& x) noexcept + { + m_header = std::move(x.m_header); + m_bound = x.m_bound; + m_element_identifier = std::move(x.m_element_identifier); + m_key_flags = std::move(x.m_key_flags); + m_key_identifier = std::move(x.m_key_identifier); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object PlainMapLTypeDefn that will be copied. + */ + eProsima_user_DllExport PlainMapLTypeDefn& operator =( + const PlainMapLTypeDefn& x) + { + + m_header = x.m_header; + + m_bound = x.m_bound; + + m_element_identifier = x.m_element_identifier; + + m_key_flags = x.m_key_flags; + + m_key_identifier = x.m_key_identifier; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object PlainMapLTypeDefn that will be copied. + */ + eProsima_user_DllExport PlainMapLTypeDefn& operator =( + PlainMapLTypeDefn&& x) noexcept + { + + m_header = std::move(x.m_header); + m_bound = x.m_bound; + m_element_identifier = std::move(x.m_element_identifier); + m_key_flags = std::move(x.m_key_flags); + m_key_identifier = std::move(x.m_key_identifier); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x PlainMapLTypeDefn object to compare. + */ + eProsima_user_DllExport bool operator ==( + const PlainMapLTypeDefn& x) const + { + return (m_header == x.m_header && + m_bound == x.m_bound && + m_element_identifier == x.m_element_identifier && + m_key_flags == x.m_key_flags && + m_key_identifier == x.m_key_identifier); + } + + /*! + * @brief Comparison operator. + * @param x PlainMapLTypeDefn object to compare. + */ + eProsima_user_DllExport bool operator !=( + const PlainMapLTypeDefn& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const PlainCollectionHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + PlainCollectionHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const PlainCollectionHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport PlainCollectionHeader& header() + { + return m_header; + } + + + /*! + * @brief This function sets a value in member bound + * @param _bound New value for member bound + */ + eProsima_user_DllExport void bound( + LBound _bound) + { + m_bound = _bound; + } + + /*! + * @brief This function returns the value of member bound + * @return Value of member bound + */ + eProsima_user_DllExport LBound bound() const + { + return m_bound; + } + + /*! + * @brief This function returns a reference to member bound + * @return Reference to member bound + */ + eProsima_user_DllExport LBound& bound() + { + return m_bound; + } + + + /*! + * @brief This function copies the value in member element_identifier + * @param _element_identifier New value to be copied in member element_identifier + */ + eProsima_user_DllExport void element_identifier( + const eprosima::fastcdr::external& _element_identifier) + { + m_element_identifier = _element_identifier; + } + + /*! + * @brief This function moves the value in member element_identifier + * @param _element_identifier New value to be moved in member element_identifier + */ + eProsima_user_DllExport void element_identifier( + eprosima::fastcdr::external&& _element_identifier) + { + m_element_identifier = std::move(_element_identifier); + } + + /*! + * @brief This function returns a constant reference to member element_identifier + * @return Constant reference to member element_identifier + */ + eProsima_user_DllExport const eprosima::fastcdr::external& element_identifier() const + { + return m_element_identifier; + } + + /*! + * @brief This function returns a reference to member element_identifier + * @return Reference to member element_identifier + */ + eProsima_user_DllExport eprosima::fastcdr::external& element_identifier() + { + return m_element_identifier; + } + + + /*! + * @brief This function copies the value in member key_flags + * @param _key_flags New value to be copied in member key_flags + */ + eProsima_user_DllExport void key_flags( + const CollectionElementFlag& _key_flags) + { + m_key_flags = _key_flags; + } + + /*! + * @brief This function moves the value in member key_flags + * @param _key_flags New value to be moved in member key_flags + */ + eProsima_user_DllExport void key_flags( + CollectionElementFlag&& _key_flags) + { + m_key_flags = std::move(_key_flags); + } + + /*! + * @brief This function returns a constant reference to member key_flags + * @return Constant reference to member key_flags + */ + eProsima_user_DllExport const CollectionElementFlag& key_flags() const + { + return m_key_flags; + } + + /*! + * @brief This function returns a reference to member key_flags + * @return Reference to member key_flags + */ + eProsima_user_DllExport CollectionElementFlag& key_flags() + { + return m_key_flags; + } + + + /*! + * @brief This function copies the value in member key_identifier + * @param _key_identifier New value to be copied in member key_identifier + */ + eProsima_user_DllExport void key_identifier( + const eprosima::fastcdr::external& _key_identifier) + { + m_key_identifier = _key_identifier; + } + + /*! + * @brief This function moves the value in member key_identifier + * @param _key_identifier New value to be moved in member key_identifier + */ + eProsima_user_DllExport void key_identifier( + eprosima::fastcdr::external&& _key_identifier) + { + m_key_identifier = std::move(_key_identifier); + } + + /*! + * @brief This function returns a constant reference to member key_identifier + * @return Constant reference to member key_identifier + */ + eProsima_user_DllExport const eprosima::fastcdr::external& key_identifier() const + { + return m_key_identifier; + } + + /*! + * @brief This function returns a reference to member key_identifier + * @return Reference to member key_identifier + */ + eProsima_user_DllExport eprosima::fastcdr::external& key_identifier() + { + return m_key_identifier; + } + + + +private: + + PlainCollectionHeader m_header; + LBound m_bound{0}; + eprosima::fastcdr::external m_element_identifier; + CollectionElementFlag m_key_flags{0}; + eprosima::fastcdr::external m_key_identifier; + +}; +/*! + * @brief This class represents the structure StronglyConnectedComponentId defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class StronglyConnectedComponentId +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport StronglyConnectedComponentId() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~StronglyConnectedComponentId() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object StronglyConnectedComponentId that will be copied. + */ + eProsima_user_DllExport StronglyConnectedComponentId( + const StronglyConnectedComponentId& x) + { + m_sc_component_id = x.m_sc_component_id; + + m_scc_length = x.m_scc_length; + + m_scc_index = x.m_scc_index; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object StronglyConnectedComponentId that will be copied. + */ + eProsima_user_DllExport StronglyConnectedComponentId( + StronglyConnectedComponentId&& x) noexcept + { + m_sc_component_id = std::move(x.m_sc_component_id); + m_scc_length = x.m_scc_length; + m_scc_index = x.m_scc_index; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object StronglyConnectedComponentId that will be copied. + */ + eProsima_user_DllExport StronglyConnectedComponentId& operator =( + const StronglyConnectedComponentId& x) + { + + m_sc_component_id = x.m_sc_component_id; + + m_scc_length = x.m_scc_length; + + m_scc_index = x.m_scc_index; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object StronglyConnectedComponentId that will be copied. + */ + eProsima_user_DllExport StronglyConnectedComponentId& operator =( + StronglyConnectedComponentId&& x) noexcept + { + + m_sc_component_id = std::move(x.m_sc_component_id); + m_scc_length = x.m_scc_length; + m_scc_index = x.m_scc_index; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x StronglyConnectedComponentId object to compare. + */ + eProsima_user_DllExport bool operator ==( + const StronglyConnectedComponentId& x) const + { + return (m_sc_component_id == x.m_sc_component_id && + m_scc_length == x.m_scc_length && + m_scc_index == x.m_scc_index); + } + + /*! + * @brief Comparison operator. + * @param x StronglyConnectedComponentId object to compare. + */ + eProsima_user_DllExport bool operator !=( + const StronglyConnectedComponentId& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member sc_component_id + * @param _sc_component_id New value to be copied in member sc_component_id + */ + eProsima_user_DllExport void sc_component_id( + const TypeObjectHashId& _sc_component_id) + { + m_sc_component_id = _sc_component_id; + } + + /*! + * @brief This function moves the value in member sc_component_id + * @param _sc_component_id New value to be moved in member sc_component_id + */ + eProsima_user_DllExport void sc_component_id( + TypeObjectHashId&& _sc_component_id) + { + m_sc_component_id = std::move(_sc_component_id); + } + + /*! + * @brief This function returns a constant reference to member sc_component_id + * @return Constant reference to member sc_component_id + */ + eProsima_user_DllExport const TypeObjectHashId& sc_component_id() const + { + return m_sc_component_id; + } + + /*! + * @brief This function returns a reference to member sc_component_id + * @return Reference to member sc_component_id + */ + eProsima_user_DllExport TypeObjectHashId& sc_component_id() + { + return m_sc_component_id; + } + + + /*! + * @brief This function sets a value in member scc_length + * @param _scc_length New value for member scc_length + */ + eProsima_user_DllExport void scc_length( + int32_t _scc_length) + { + m_scc_length = _scc_length; + } + + /*! + * @brief This function returns the value of member scc_length + * @return Value of member scc_length + */ + eProsima_user_DllExport int32_t scc_length() const + { + return m_scc_length; + } + + /*! + * @brief This function returns a reference to member scc_length + * @return Reference to member scc_length + */ + eProsima_user_DllExport int32_t& scc_length() + { + return m_scc_length; + } + + + /*! + * @brief This function sets a value in member scc_index + * @param _scc_index New value for member scc_index + */ + eProsima_user_DllExport void scc_index( + int32_t _scc_index) + { + m_scc_index = _scc_index; + } + + /*! + * @brief This function returns the value of member scc_index + * @return Value of member scc_index + */ + eProsima_user_DllExport int32_t scc_index() const + { + return m_scc_index; + } + + /*! + * @brief This function returns a reference to member scc_index + * @return Reference to member scc_index + */ + eProsima_user_DllExport int32_t& scc_index() + { + return m_scc_index; + } + + + +private: + + TypeObjectHashId m_sc_component_id; + int32_t m_scc_length{0}; + int32_t m_scc_index{0}; + +}; +/*! + * @brief This class represents the structure ExtendedTypeDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class ExtendedTypeDefn +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ExtendedTypeDefn() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ExtendedTypeDefn() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object ExtendedTypeDefn that will be copied. + */ + eProsima_user_DllExport ExtendedTypeDefn( + const ExtendedTypeDefn& x) + { + static_cast(x); + } + + /*! + * @brief Move constructor. + * @param x Reference to the object ExtendedTypeDefn that will be copied. + */ + eProsima_user_DllExport ExtendedTypeDefn( + ExtendedTypeDefn&& x) noexcept + { + static_cast(x); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object ExtendedTypeDefn that will be copied. + */ + eProsima_user_DllExport ExtendedTypeDefn& operator =( + const ExtendedTypeDefn& x) + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object ExtendedTypeDefn that will be copied. + */ + eProsima_user_DllExport ExtendedTypeDefn& operator =( + ExtendedTypeDefn&& x) noexcept + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x ExtendedTypeDefn object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ExtendedTypeDefn& x) const + { + static_cast(x); + return true; + } + + /*! + * @brief Comparison operator. + * @param x ExtendedTypeDefn object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ExtendedTypeDefn& x) const + { + return !(*this == x); + } + + + +private: + + +}; +/*! + * @brief This class represents the union TypeIdentifier defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class TypeIdentifier +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TypeIdentifier() + { + extended_defn_(); + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TypeIdentifier() + { + if (member_destructor_) + { + member_destructor_(); + } + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object TypeIdentifier that will be copied. + */ + eProsima_user_DllExport TypeIdentifier( + const TypeIdentifier& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + string_sdefn_() = x.m_string_sdefn; + break; + + case 0x00000002: + string_ldefn_() = x.m_string_ldefn; + break; + + case 0x00000003: + seq_sdefn_() = x.m_seq_sdefn; + break; + + case 0x00000004: + seq_ldefn_() = x.m_seq_ldefn; + break; + + case 0x00000005: + array_sdefn_() = x.m_array_sdefn; + break; + + case 0x00000006: + array_ldefn_() = x.m_array_ldefn; + break; + + case 0x00000007: + map_sdefn_() = x.m_map_sdefn; + break; + + case 0x00000008: + map_ldefn_() = x.m_map_ldefn; + break; + + case 0x00000009: + sc_component_id_() = x.m_sc_component_id; + break; + + case 0x0000000a: + equivalence_hash_() = x.m_equivalence_hash; + break; + + case 0x0000000b: + extended_defn_() = x.m_extended_defn; + break; + + } + } + + /*! + * @brief Move constructor. + * @param x Reference to the object TypeIdentifier that will be copied. + */ + eProsima_user_DllExport TypeIdentifier( + TypeIdentifier&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + string_sdefn_() = std::move(x.m_string_sdefn); + break; + + case 0x00000002: + string_ldefn_() = std::move(x.m_string_ldefn); + break; + + case 0x00000003: + seq_sdefn_() = std::move(x.m_seq_sdefn); + break; + + case 0x00000004: + seq_ldefn_() = std::move(x.m_seq_ldefn); + break; + + case 0x00000005: + array_sdefn_() = std::move(x.m_array_sdefn); + break; + + case 0x00000006: + array_ldefn_() = std::move(x.m_array_ldefn); + break; + + case 0x00000007: + map_sdefn_() = std::move(x.m_map_sdefn); + break; + + case 0x00000008: + map_ldefn_() = std::move(x.m_map_ldefn); + break; + + case 0x00000009: + sc_component_id_() = std::move(x.m_sc_component_id); + break; + + case 0x0000000a: + equivalence_hash_() = std::move(x.m_equivalence_hash); + break; + + case 0x0000000b: + extended_defn_() = std::move(x.m_extended_defn); + break; + + } + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object TypeIdentifier that will be copied. + */ + eProsima_user_DllExport TypeIdentifier& operator =( + const TypeIdentifier& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + string_sdefn_() = x.m_string_sdefn; + break; + + case 0x00000002: + string_ldefn_() = x.m_string_ldefn; + break; + + case 0x00000003: + seq_sdefn_() = x.m_seq_sdefn; + break; + + case 0x00000004: + seq_ldefn_() = x.m_seq_ldefn; + break; + + case 0x00000005: + array_sdefn_() = x.m_array_sdefn; + break; + + case 0x00000006: + array_ldefn_() = x.m_array_ldefn; + break; + + case 0x00000007: + map_sdefn_() = x.m_map_sdefn; + break; + + case 0x00000008: + map_ldefn_() = x.m_map_ldefn; + break; + + case 0x00000009: + sc_component_id_() = x.m_sc_component_id; + break; + + case 0x0000000a: + equivalence_hash_() = x.m_equivalence_hash; + break; + + case 0x0000000b: + extended_defn_() = x.m_extended_defn; + break; + + } + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object TypeIdentifier that will be copied. + */ + eProsima_user_DllExport TypeIdentifier& operator =( + TypeIdentifier&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + string_sdefn_() = std::move(x.m_string_sdefn); + break; + + case 0x00000002: + string_ldefn_() = std::move(x.m_string_ldefn); + break; + + case 0x00000003: + seq_sdefn_() = std::move(x.m_seq_sdefn); + break; + + case 0x00000004: + seq_ldefn_() = std::move(x.m_seq_ldefn); + break; + + case 0x00000005: + array_sdefn_() = std::move(x.m_array_sdefn); + break; + + case 0x00000006: + array_ldefn_() = std::move(x.m_array_ldefn); + break; + + case 0x00000007: + map_sdefn_() = std::move(x.m_map_sdefn); + break; + + case 0x00000008: + map_ldefn_() = std::move(x.m_map_ldefn); + break; + + case 0x00000009: + sc_component_id_() = std::move(x.m_sc_component_id); + break; + + case 0x0000000a: + equivalence_hash_() = std::move(x.m_equivalence_hash); + break; + + case 0x0000000b: + extended_defn_() = std::move(x.m_extended_defn); + break; + + } + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x TypeIdentifier object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TypeIdentifier& x) const + { + bool ret_value {false}; + + if (m__d == x.m__d && + selected_member_ == x.selected_member_) + { + switch (selected_member_) + { + case 0x00000001: + ret_value = (m_string_sdefn == x.m_string_sdefn); + break; + + case 0x00000002: + ret_value = (m_string_ldefn == x.m_string_ldefn); + break; + + case 0x00000003: + ret_value = (m_seq_sdefn == x.m_seq_sdefn); + break; + + case 0x00000004: + ret_value = (m_seq_ldefn == x.m_seq_ldefn); + break; + + case 0x00000005: + ret_value = (m_array_sdefn == x.m_array_sdefn); + break; + + case 0x00000006: + ret_value = (m_array_ldefn == x.m_array_ldefn); + break; + + case 0x00000007: + ret_value = (m_map_sdefn == x.m_map_sdefn); + break; + + case 0x00000008: + ret_value = (m_map_ldefn == x.m_map_ldefn); + break; + + case 0x00000009: + ret_value = (m_sc_component_id == x.m_sc_component_id); + break; + + case 0x0000000a: + ret_value = (m_equivalence_hash == x.m_equivalence_hash); + break; + + case 0x0000000b: + ret_value = (m_extended_defn == x.m_extended_defn); + break; + + } + } + + return ret_value; + } + + /*! + * @brief Comparison operator. + * @param x TypeIdentifier object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TypeIdentifier& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + uint8_t __d) + { + bool valid_discriminator = false; + + switch (__d) + { + case TI_STRING8_SMALL: + case TI_STRING16_SMALL: + if (0x00000001 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TI_STRING8_LARGE: + case TI_STRING16_LARGE: + if (0x00000002 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TI_PLAIN_SEQUENCE_SMALL: + if (0x00000003 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TI_PLAIN_SEQUENCE_LARGE: + if (0x00000004 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TI_PLAIN_ARRAY_SMALL: + if (0x00000005 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TI_PLAIN_ARRAY_LARGE: + if (0x00000006 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TI_PLAIN_MAP_SMALL: + if (0x00000007 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TI_PLAIN_MAP_LARGE: + if (0x00000008 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TI_STRONGLY_CONNECTED_COMPONENT: + if (0x00000009 == selected_member_) + { + valid_discriminator = true; + } + break; + + case EK_COMPLETE: + case EK_MINIMAL: + if (0x0000000a == selected_member_) + { + valid_discriminator = true; + } + break; + + default: + if (0x0000000b == selected_member_) + { + valid_discriminator = true; + } + break; + + } + + if (!valid_discriminator) + { + throw eprosima::fastcdr::exception::BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; + } + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport uint8_t _d() const + { + return m__d; + } + + /*! + * @brief This function copies the value in member string_sdefn + * @param _string_sdefn New value to be copied in member string_sdefn + */ + eProsima_user_DllExport void string_sdefn( + const StringSTypeDefn& _string_sdefn) + { + string_sdefn_() = _string_sdefn; + m__d = TI_STRING8_SMALL; + } + + /*! + * @brief This function moves the value in member string_sdefn + * @param _string_sdefn New value to be moved in member string_sdefn + */ + eProsima_user_DllExport void string_sdefn( + StringSTypeDefn&& _string_sdefn) + { + string_sdefn_() = _string_sdefn; + m__d = TI_STRING8_SMALL; + } + + /*! + * @brief This function returns a constant reference to member string_sdefn + * @return Constant reference to member string_sdefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const StringSTypeDefn& string_sdefn() const + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_string_sdefn; + } + + /*! + * @brief This function returns a reference to member string_sdefn + * @return Reference to member string_sdefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport StringSTypeDefn& string_sdefn() + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_string_sdefn; + } + + + /*! + * @brief This function copies the value in member string_ldefn + * @param _string_ldefn New value to be copied in member string_ldefn + */ + eProsima_user_DllExport void string_ldefn( + const StringLTypeDefn& _string_ldefn) + { + string_ldefn_() = _string_ldefn; + m__d = TI_STRING8_LARGE; + } + + /*! + * @brief This function moves the value in member string_ldefn + * @param _string_ldefn New value to be moved in member string_ldefn + */ + eProsima_user_DllExport void string_ldefn( + StringLTypeDefn&& _string_ldefn) + { + string_ldefn_() = _string_ldefn; + m__d = TI_STRING8_LARGE; + } + + /*! + * @brief This function returns a constant reference to member string_ldefn + * @return Constant reference to member string_ldefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const StringLTypeDefn& string_ldefn() const + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_string_ldefn; + } + + /*! + * @brief This function returns a reference to member string_ldefn + * @return Reference to member string_ldefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport StringLTypeDefn& string_ldefn() + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_string_ldefn; + } + + + /*! + * @brief This function copies the value in member seq_sdefn + * @param _seq_sdefn New value to be copied in member seq_sdefn + */ + eProsima_user_DllExport void seq_sdefn( + const PlainSequenceSElemDefn& _seq_sdefn) + { + seq_sdefn_() = _seq_sdefn; + m__d = TI_PLAIN_SEQUENCE_SMALL; + } + + /*! + * @brief This function moves the value in member seq_sdefn + * @param _seq_sdefn New value to be moved in member seq_sdefn + */ + eProsima_user_DllExport void seq_sdefn( + PlainSequenceSElemDefn&& _seq_sdefn) + { + seq_sdefn_() = _seq_sdefn; + m__d = TI_PLAIN_SEQUENCE_SMALL; + } + + /*! + * @brief This function returns a constant reference to member seq_sdefn + * @return Constant reference to member seq_sdefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const PlainSequenceSElemDefn& seq_sdefn() const + { + if (0x00000003 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_seq_sdefn; + } + + /*! + * @brief This function returns a reference to member seq_sdefn + * @return Reference to member seq_sdefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport PlainSequenceSElemDefn& seq_sdefn() + { + if (0x00000003 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_seq_sdefn; + } + + + /*! + * @brief This function copies the value in member seq_ldefn + * @param _seq_ldefn New value to be copied in member seq_ldefn + */ + eProsima_user_DllExport void seq_ldefn( + const PlainSequenceLElemDefn& _seq_ldefn) + { + seq_ldefn_() = _seq_ldefn; + m__d = TI_PLAIN_SEQUENCE_LARGE; + } + + /*! + * @brief This function moves the value in member seq_ldefn + * @param _seq_ldefn New value to be moved in member seq_ldefn + */ + eProsima_user_DllExport void seq_ldefn( + PlainSequenceLElemDefn&& _seq_ldefn) + { + seq_ldefn_() = _seq_ldefn; + m__d = TI_PLAIN_SEQUENCE_LARGE; + } + + /*! + * @brief This function returns a constant reference to member seq_ldefn + * @return Constant reference to member seq_ldefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const PlainSequenceLElemDefn& seq_ldefn() const + { + if (0x00000004 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_seq_ldefn; + } + + /*! + * @brief This function returns a reference to member seq_ldefn + * @return Reference to member seq_ldefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport PlainSequenceLElemDefn& seq_ldefn() + { + if (0x00000004 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_seq_ldefn; + } + + + /*! + * @brief This function copies the value in member array_sdefn + * @param _array_sdefn New value to be copied in member array_sdefn + */ + eProsima_user_DllExport void array_sdefn( + const PlainArraySElemDefn& _array_sdefn) + { + array_sdefn_() = _array_sdefn; + m__d = TI_PLAIN_ARRAY_SMALL; + } + + /*! + * @brief This function moves the value in member array_sdefn + * @param _array_sdefn New value to be moved in member array_sdefn + */ + eProsima_user_DllExport void array_sdefn( + PlainArraySElemDefn&& _array_sdefn) + { + array_sdefn_() = _array_sdefn; + m__d = TI_PLAIN_ARRAY_SMALL; + } + + /*! + * @brief This function returns a constant reference to member array_sdefn + * @return Constant reference to member array_sdefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const PlainArraySElemDefn& array_sdefn() const + { + if (0x00000005 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_array_sdefn; + } + + /*! + * @brief This function returns a reference to member array_sdefn + * @return Reference to member array_sdefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport PlainArraySElemDefn& array_sdefn() + { + if (0x00000005 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_array_sdefn; + } + + + /*! + * @brief This function copies the value in member array_ldefn + * @param _array_ldefn New value to be copied in member array_ldefn + */ + eProsima_user_DllExport void array_ldefn( + const PlainArrayLElemDefn& _array_ldefn) + { + array_ldefn_() = _array_ldefn; + m__d = TI_PLAIN_ARRAY_LARGE; + } + + /*! + * @brief This function moves the value in member array_ldefn + * @param _array_ldefn New value to be moved in member array_ldefn + */ + eProsima_user_DllExport void array_ldefn( + PlainArrayLElemDefn&& _array_ldefn) + { + array_ldefn_() = _array_ldefn; + m__d = TI_PLAIN_ARRAY_LARGE; + } + + /*! + * @brief This function returns a constant reference to member array_ldefn + * @return Constant reference to member array_ldefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const PlainArrayLElemDefn& array_ldefn() const + { + if (0x00000006 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_array_ldefn; + } + + /*! + * @brief This function returns a reference to member array_ldefn + * @return Reference to member array_ldefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport PlainArrayLElemDefn& array_ldefn() + { + if (0x00000006 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_array_ldefn; + } + + + /*! + * @brief This function copies the value in member map_sdefn + * @param _map_sdefn New value to be copied in member map_sdefn + */ + eProsima_user_DllExport void map_sdefn( + const PlainMapSTypeDefn& _map_sdefn) + { + map_sdefn_() = _map_sdefn; + m__d = TI_PLAIN_MAP_SMALL; + } + + /*! + * @brief This function moves the value in member map_sdefn + * @param _map_sdefn New value to be moved in member map_sdefn + */ + eProsima_user_DllExport void map_sdefn( + PlainMapSTypeDefn&& _map_sdefn) + { + map_sdefn_() = _map_sdefn; + m__d = TI_PLAIN_MAP_SMALL; + } + + /*! + * @brief This function returns a constant reference to member map_sdefn + * @return Constant reference to member map_sdefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const PlainMapSTypeDefn& map_sdefn() const + { + if (0x00000007 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_map_sdefn; + } + + /*! + * @brief This function returns a reference to member map_sdefn + * @return Reference to member map_sdefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport PlainMapSTypeDefn& map_sdefn() + { + if (0x00000007 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_map_sdefn; + } + + + /*! + * @brief This function copies the value in member map_ldefn + * @param _map_ldefn New value to be copied in member map_ldefn + */ + eProsima_user_DllExport void map_ldefn( + const PlainMapLTypeDefn& _map_ldefn) + { + map_ldefn_() = _map_ldefn; + m__d = TI_PLAIN_MAP_LARGE; + } + + /*! + * @brief This function moves the value in member map_ldefn + * @param _map_ldefn New value to be moved in member map_ldefn + */ + eProsima_user_DllExport void map_ldefn( + PlainMapLTypeDefn&& _map_ldefn) + { + map_ldefn_() = _map_ldefn; + m__d = TI_PLAIN_MAP_LARGE; + } + + /*! + * @brief This function returns a constant reference to member map_ldefn + * @return Constant reference to member map_ldefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const PlainMapLTypeDefn& map_ldefn() const + { + if (0x00000008 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_map_ldefn; + } + + /*! + * @brief This function returns a reference to member map_ldefn + * @return Reference to member map_ldefn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport PlainMapLTypeDefn& map_ldefn() + { + if (0x00000008 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_map_ldefn; + } + + + /*! + * @brief This function copies the value in member sc_component_id + * @param _sc_component_id New value to be copied in member sc_component_id + */ + eProsima_user_DllExport void sc_component_id( + const StronglyConnectedComponentId& _sc_component_id) + { + sc_component_id_() = _sc_component_id; + m__d = TI_STRONGLY_CONNECTED_COMPONENT; + } + + /*! + * @brief This function moves the value in member sc_component_id + * @param _sc_component_id New value to be moved in member sc_component_id + */ + eProsima_user_DllExport void sc_component_id( + StronglyConnectedComponentId&& _sc_component_id) + { + sc_component_id_() = _sc_component_id; + m__d = TI_STRONGLY_CONNECTED_COMPONENT; + } + + /*! + * @brief This function returns a constant reference to member sc_component_id + * @return Constant reference to member sc_component_id + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const StronglyConnectedComponentId& sc_component_id() const + { + if (0x00000009 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_sc_component_id; + } + + /*! + * @brief This function returns a reference to member sc_component_id + * @return Reference to member sc_component_id + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport StronglyConnectedComponentId& sc_component_id() + { + if (0x00000009 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_sc_component_id; + } + + + /*! + * @brief This function copies the value in member equivalence_hash + * @param _equivalence_hash New value to be copied in member equivalence_hash + */ + eProsima_user_DllExport void equivalence_hash( + const EquivalenceHash& _equivalence_hash) + { + equivalence_hash_() = _equivalence_hash; + m__d = EK_COMPLETE; + } + + /*! + * @brief This function moves the value in member equivalence_hash + * @param _equivalence_hash New value to be moved in member equivalence_hash + */ + eProsima_user_DllExport void equivalence_hash( + EquivalenceHash&& _equivalence_hash) + { + equivalence_hash_() = _equivalence_hash; + m__d = EK_COMPLETE; + } + + /*! + * @brief This function returns a constant reference to member equivalence_hash + * @return Constant reference to member equivalence_hash + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const EquivalenceHash& equivalence_hash() const + { + if (0x0000000a != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_equivalence_hash; + } + + /*! + * @brief This function returns a reference to member equivalence_hash + * @return Reference to member equivalence_hash + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport EquivalenceHash& equivalence_hash() + { + if (0x0000000a != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_equivalence_hash; + } + + + /*! + * @brief This function copies the value in member extended_defn + * @param _extended_defn New value to be copied in member extended_defn + */ + eProsima_user_DllExport void extended_defn( + const ExtendedTypeDefn& _extended_defn) + { + extended_defn_() = _extended_defn; + m__d = 0; + } + + /*! + * @brief This function moves the value in member extended_defn + * @param _extended_defn New value to be moved in member extended_defn + */ + eProsima_user_DllExport void extended_defn( + ExtendedTypeDefn&& _extended_defn) + { + extended_defn_() = _extended_defn; + m__d = 0; + } + + /*! + * @brief This function returns a constant reference to member extended_defn + * @return Constant reference to member extended_defn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const ExtendedTypeDefn& extended_defn() const + { + if (0x0000000b != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_extended_defn; + } + + /*! + * @brief This function returns a reference to member extended_defn + * @return Reference to member extended_defn + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport ExtendedTypeDefn& extended_defn() + { + if (0x0000000b != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_extended_defn; + } + + + +private: + + StringSTypeDefn& string_sdefn_() + { + if (0x00000001 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000001; + member_destructor_ = [&]() {m_string_sdefn.~StringSTypeDefn();}; + new(&m_string_sdefn) StringSTypeDefn(); + ; + } + + return m_string_sdefn; + } + + StringLTypeDefn& string_ldefn_() + { + if (0x00000002 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000002; + member_destructor_ = [&]() {m_string_ldefn.~StringLTypeDefn();}; + new(&m_string_ldefn) StringLTypeDefn(); + ; + } + + return m_string_ldefn; + } + + PlainSequenceSElemDefn& seq_sdefn_() + { + if (0x00000003 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000003; + member_destructor_ = [&]() {m_seq_sdefn.~PlainSequenceSElemDefn();}; + new(&m_seq_sdefn) PlainSequenceSElemDefn(); + ; + } + + return m_seq_sdefn; + } + + PlainSequenceLElemDefn& seq_ldefn_() + { + if (0x00000004 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000004; + member_destructor_ = [&]() {m_seq_ldefn.~PlainSequenceLElemDefn();}; + new(&m_seq_ldefn) PlainSequenceLElemDefn(); + ; + } + + return m_seq_ldefn; + } + + PlainArraySElemDefn& array_sdefn_() + { + if (0x00000005 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000005; + member_destructor_ = [&]() {m_array_sdefn.~PlainArraySElemDefn();}; + new(&m_array_sdefn) PlainArraySElemDefn(); + ; + } + + return m_array_sdefn; + } + + PlainArrayLElemDefn& array_ldefn_() + { + if (0x00000006 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000006; + member_destructor_ = [&]() {m_array_ldefn.~PlainArrayLElemDefn();}; + new(&m_array_ldefn) PlainArrayLElemDefn(); + ; + } + + return m_array_ldefn; + } + + PlainMapSTypeDefn& map_sdefn_() + { + if (0x00000007 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000007; + member_destructor_ = [&]() {m_map_sdefn.~PlainMapSTypeDefn();}; + new(&m_map_sdefn) PlainMapSTypeDefn(); + ; + } + + return m_map_sdefn; + } + + PlainMapLTypeDefn& map_ldefn_() + { + if (0x00000008 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000008; + member_destructor_ = [&]() {m_map_ldefn.~PlainMapLTypeDefn();}; + new(&m_map_ldefn) PlainMapLTypeDefn(); + ; + } + + return m_map_ldefn; + } + + StronglyConnectedComponentId& sc_component_id_() + { + if (0x00000009 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000009; + member_destructor_ = [&]() {m_sc_component_id.~StronglyConnectedComponentId();}; + new(&m_sc_component_id) StronglyConnectedComponentId(); + ; + } + + return m_sc_component_id; + } + + EquivalenceHash& equivalence_hash_() + { + if (0x0000000a != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0000000a; + member_destructor_ = [&]() {m_equivalence_hash.~EquivalenceHash();}; + new(&m_equivalence_hash) EquivalenceHash(); + ; + } + + return m_equivalence_hash; + } + + ExtendedTypeDefn& extended_defn_() + { + if (0x0000000b != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0000000b; + member_destructor_ = [&]() {m_extended_defn.~ExtendedTypeDefn();}; + new(&m_extended_defn) ExtendedTypeDefn(); + ; + } + + return m_extended_defn; + } + + + uint8_t m__d {0}; + + union + { + StringSTypeDefn m_string_sdefn; + StringLTypeDefn m_string_ldefn; + PlainSequenceSElemDefn m_seq_sdefn; + PlainSequenceLElemDefn m_seq_ldefn; + PlainArraySElemDefn m_array_sdefn; + PlainArrayLElemDefn m_array_ldefn; + PlainMapSTypeDefn m_map_sdefn; + PlainMapLTypeDefn m_map_ldefn; + StronglyConnectedComponentId m_sc_component_id; + EquivalenceHash m_equivalence_hash; + ExtendedTypeDefn m_extended_defn; + }; + + uint32_t selected_member_ {0x0FFFFFFFu}; + + std::function member_destructor_; +}; +typedef std::vector TypeIdentifierSeq; + +typedef uint32_t MemberId; + +const uint32_t ANNOTATION_STR_VALUE_MAX_LEN = 128; +const uint32_t ANNOTATION_OCTETSEC_VALUE_MAX_LEN = 128; +/*! + * @brief This class represents the structure ExtendedAnnotationParameterValue defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class ExtendedAnnotationParameterValue +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ExtendedAnnotationParameterValue() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ExtendedAnnotationParameterValue() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object ExtendedAnnotationParameterValue that will be copied. + */ + eProsima_user_DllExport ExtendedAnnotationParameterValue( + const ExtendedAnnotationParameterValue& x) + { + static_cast(x); + } + + /*! + * @brief Move constructor. + * @param x Reference to the object ExtendedAnnotationParameterValue that will be copied. + */ + eProsima_user_DllExport ExtendedAnnotationParameterValue( + ExtendedAnnotationParameterValue&& x) noexcept + { + static_cast(x); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object ExtendedAnnotationParameterValue that will be copied. + */ + eProsima_user_DllExport ExtendedAnnotationParameterValue& operator =( + const ExtendedAnnotationParameterValue& x) + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object ExtendedAnnotationParameterValue that will be copied. + */ + eProsima_user_DllExport ExtendedAnnotationParameterValue& operator =( + ExtendedAnnotationParameterValue&& x) noexcept + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x ExtendedAnnotationParameterValue object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ExtendedAnnotationParameterValue& x) const + { + static_cast(x); + return true; + } + + /*! + * @brief Comparison operator. + * @param x ExtendedAnnotationParameterValue object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ExtendedAnnotationParameterValue& x) const + { + return !(*this == x); + } + + + +private: + + +}; +/*! + * @brief This class represents the union AnnotationParameterValue defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class AnnotationParameterValue +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AnnotationParameterValue() + { + extended_value_(); + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AnnotationParameterValue() + { + if (member_destructor_) + { + member_destructor_(); + } + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object AnnotationParameterValue that will be copied. + */ + eProsima_user_DllExport AnnotationParameterValue( + const AnnotationParameterValue& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + boolean_value_() = x.m_boolean_value; + break; + + case 0x00000002: + byte_value_() = x.m_byte_value; + break; + + case 0x00000003: + int8_value_() = x.m_int8_value; + break; + + case 0x00000004: + uint8_value_() = x.m_uint8_value; + break; + + case 0x00000005: + int16_value_() = x.m_int16_value; + break; + + case 0x00000006: + uint_16_value_() = x.m_uint_16_value; + break; + + case 0x00000007: + int32_value_() = x.m_int32_value; + break; + + case 0x00000008: + uint32_value_() = x.m_uint32_value; + break; + + case 0x00000009: + int64_value_() = x.m_int64_value; + break; + + case 0x0000000a: + uint64_value_() = x.m_uint64_value; + break; + + case 0x0000000b: + float32_value_() = x.m_float32_value; + break; + + case 0x0000000c: + float64_value_() = x.m_float64_value; + break; + + case 0x0000000d: + float128_value_() = x.m_float128_value; + break; + + case 0x0000000e: + char_value_() = x.m_char_value; + break; + + case 0x0000000f: + wchar_value_() = x.m_wchar_value; + break; + + case 0x00000010: + enumerated_value_() = x.m_enumerated_value; + break; + + case 0x00000011: + string8_value_() = x.m_string8_value; + break; + + case 0x00000012: + string16_value_() = x.m_string16_value; + break; + + case 0x00000013: + extended_value_() = x.m_extended_value; + break; + + } + } + + /*! + * @brief Move constructor. + * @param x Reference to the object AnnotationParameterValue that will be copied. + */ + eProsima_user_DllExport AnnotationParameterValue( + AnnotationParameterValue&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + boolean_value_() = std::move(x.m_boolean_value); + break; + + case 0x00000002: + byte_value_() = std::move(x.m_byte_value); + break; + + case 0x00000003: + int8_value_() = std::move(x.m_int8_value); + break; + + case 0x00000004: + uint8_value_() = std::move(x.m_uint8_value); + break; + + case 0x00000005: + int16_value_() = std::move(x.m_int16_value); + break; + + case 0x00000006: + uint_16_value_() = std::move(x.m_uint_16_value); + break; + + case 0x00000007: + int32_value_() = std::move(x.m_int32_value); + break; + + case 0x00000008: + uint32_value_() = std::move(x.m_uint32_value); + break; + + case 0x00000009: + int64_value_() = std::move(x.m_int64_value); + break; + + case 0x0000000a: + uint64_value_() = std::move(x.m_uint64_value); + break; + + case 0x0000000b: + float32_value_() = std::move(x.m_float32_value); + break; + + case 0x0000000c: + float64_value_() = std::move(x.m_float64_value); + break; + + case 0x0000000d: + float128_value_() = std::move(x.m_float128_value); + break; + + case 0x0000000e: + char_value_() = std::move(x.m_char_value); + break; + + case 0x0000000f: + wchar_value_() = std::move(x.m_wchar_value); + break; + + case 0x00000010: + enumerated_value_() = std::move(x.m_enumerated_value); + break; + + case 0x00000011: + string8_value_() = std::move(x.m_string8_value); + break; + + case 0x00000012: + string16_value_() = std::move(x.m_string16_value); + break; + + case 0x00000013: + extended_value_() = std::move(x.m_extended_value); + break; + + } + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object AnnotationParameterValue that will be copied. + */ + eProsima_user_DllExport AnnotationParameterValue& operator =( + const AnnotationParameterValue& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + boolean_value_() = x.m_boolean_value; + break; + + case 0x00000002: + byte_value_() = x.m_byte_value; + break; + + case 0x00000003: + int8_value_() = x.m_int8_value; + break; + + case 0x00000004: + uint8_value_() = x.m_uint8_value; + break; + + case 0x00000005: + int16_value_() = x.m_int16_value; + break; + + case 0x00000006: + uint_16_value_() = x.m_uint_16_value; + break; + + case 0x00000007: + int32_value_() = x.m_int32_value; + break; + + case 0x00000008: + uint32_value_() = x.m_uint32_value; + break; + + case 0x00000009: + int64_value_() = x.m_int64_value; + break; + + case 0x0000000a: + uint64_value_() = x.m_uint64_value; + break; + + case 0x0000000b: + float32_value_() = x.m_float32_value; + break; + + case 0x0000000c: + float64_value_() = x.m_float64_value; + break; + + case 0x0000000d: + float128_value_() = x.m_float128_value; + break; + + case 0x0000000e: + char_value_() = x.m_char_value; + break; + + case 0x0000000f: + wchar_value_() = x.m_wchar_value; + break; + + case 0x00000010: + enumerated_value_() = x.m_enumerated_value; + break; + + case 0x00000011: + string8_value_() = x.m_string8_value; + break; + + case 0x00000012: + string16_value_() = x.m_string16_value; + break; + + case 0x00000013: + extended_value_() = x.m_extended_value; + break; + + } + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object AnnotationParameterValue that will be copied. + */ + eProsima_user_DllExport AnnotationParameterValue& operator =( + AnnotationParameterValue&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + boolean_value_() = std::move(x.m_boolean_value); + break; + + case 0x00000002: + byte_value_() = std::move(x.m_byte_value); + break; + + case 0x00000003: + int8_value_() = std::move(x.m_int8_value); + break; + + case 0x00000004: + uint8_value_() = std::move(x.m_uint8_value); + break; + + case 0x00000005: + int16_value_() = std::move(x.m_int16_value); + break; + + case 0x00000006: + uint_16_value_() = std::move(x.m_uint_16_value); + break; + + case 0x00000007: + int32_value_() = std::move(x.m_int32_value); + break; + + case 0x00000008: + uint32_value_() = std::move(x.m_uint32_value); + break; + + case 0x00000009: + int64_value_() = std::move(x.m_int64_value); + break; + + case 0x0000000a: + uint64_value_() = std::move(x.m_uint64_value); + break; + + case 0x0000000b: + float32_value_() = std::move(x.m_float32_value); + break; + + case 0x0000000c: + float64_value_() = std::move(x.m_float64_value); + break; + + case 0x0000000d: + float128_value_() = std::move(x.m_float128_value); + break; + + case 0x0000000e: + char_value_() = std::move(x.m_char_value); + break; + + case 0x0000000f: + wchar_value_() = std::move(x.m_wchar_value); + break; + + case 0x00000010: + enumerated_value_() = std::move(x.m_enumerated_value); + break; + + case 0x00000011: + string8_value_() = std::move(x.m_string8_value); + break; + + case 0x00000012: + string16_value_() = std::move(x.m_string16_value); + break; + + case 0x00000013: + extended_value_() = std::move(x.m_extended_value); + break; + + } + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x AnnotationParameterValue object to compare. + */ + eProsima_user_DllExport bool operator ==( + const AnnotationParameterValue& x) const + { + bool ret_value {false}; + + if (m__d == x.m__d && + selected_member_ == x.selected_member_) + { + switch (selected_member_) + { + case 0x00000001: + ret_value = (m_boolean_value == x.m_boolean_value); + break; + + case 0x00000002: + ret_value = (m_byte_value == x.m_byte_value); + break; + + case 0x00000003: + ret_value = (m_int8_value == x.m_int8_value); + break; + + case 0x00000004: + ret_value = (m_uint8_value == x.m_uint8_value); + break; + + case 0x00000005: + ret_value = (m_int16_value == x.m_int16_value); + break; + + case 0x00000006: + ret_value = (m_uint_16_value == x.m_uint_16_value); + break; + + case 0x00000007: + ret_value = (m_int32_value == x.m_int32_value); + break; + + case 0x00000008: + ret_value = (m_uint32_value == x.m_uint32_value); + break; + + case 0x00000009: + ret_value = (m_int64_value == x.m_int64_value); + break; + + case 0x0000000a: + ret_value = (m_uint64_value == x.m_uint64_value); + break; + + case 0x0000000b: + ret_value = (m_float32_value == x.m_float32_value); + break; + + case 0x0000000c: + ret_value = (m_float64_value == x.m_float64_value); + break; + + case 0x0000000d: + ret_value = (m_float128_value == x.m_float128_value); + break; + + case 0x0000000e: + ret_value = (m_char_value == x.m_char_value); + break; + + case 0x0000000f: + ret_value = (m_wchar_value == x.m_wchar_value); + break; + + case 0x00000010: + ret_value = (m_enumerated_value == x.m_enumerated_value); + break; + + case 0x00000011: + ret_value = (m_string8_value == x.m_string8_value); + break; + + case 0x00000012: + ret_value = (m_string16_value == x.m_string16_value); + break; + + case 0x00000013: + ret_value = (m_extended_value == x.m_extended_value); + break; + + } + } + + return ret_value; + } + + /*! + * @brief Comparison operator. + * @param x AnnotationParameterValue object to compare. + */ + eProsima_user_DllExport bool operator !=( + const AnnotationParameterValue& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + uint8_t __d) + { + bool valid_discriminator = false; + + switch (__d) + { + case TK_BOOLEAN: + if (0x00000001 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_BYTE: + if (0x00000002 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_INT8: + if (0x00000003 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_UINT8: + if (0x00000004 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_INT16: + if (0x00000005 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_UINT16: + if (0x00000006 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_INT32: + if (0x00000007 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_UINT32: + if (0x00000008 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_INT64: + if (0x00000009 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_UINT64: + if (0x0000000a == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_FLOAT32: + if (0x0000000b == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_FLOAT64: + if (0x0000000c == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_FLOAT128: + if (0x0000000d == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_CHAR8: + if (0x0000000e == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_CHAR16: + if (0x0000000f == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_ENUM: + if (0x00000010 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_STRING8: + if (0x00000011 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_STRING16: + if (0x00000012 == selected_member_) + { + valid_discriminator = true; + } + break; + + default: + if (0x00000013 == selected_member_) + { + valid_discriminator = true; + } + break; + + } + + if (!valid_discriminator) + { + throw eprosima::fastcdr::exception::BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; + } + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport uint8_t _d() const + { + return m__d; + } + + /*! + * @brief This function sets a value in member boolean_value + * @param _boolean_value New value for member boolean_value + */ + eProsima_user_DllExport void boolean_value( + bool _boolean_value) + { + boolean_value_() = _boolean_value; + m__d = TK_BOOLEAN; + } + + /*! + * @brief This function returns the value of member boolean_value + * @return Value of member boolean_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport bool boolean_value() const + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_boolean_value; + } + + /*! + * @brief This function returns a reference to member boolean_value + * @return Reference to member boolean_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport bool& boolean_value() + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_boolean_value; + } + + + /*! + * @brief This function sets a value in member byte_value + * @param _byte_value New value for member byte_value + */ + eProsima_user_DllExport void byte_value( + uint8_t _byte_value) + { + byte_value_() = _byte_value; + m__d = TK_BYTE; + } + + /*! + * @brief This function returns the value of member byte_value + * @return Value of member byte_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint8_t byte_value() const + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_byte_value; + } + + /*! + * @brief This function returns a reference to member byte_value + * @return Reference to member byte_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint8_t& byte_value() + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_byte_value; + } + + + /*! + * @brief This function sets a value in member int8_value + * @param _int8_value New value for member int8_value + */ + eProsima_user_DllExport void int8_value( + int8_t _int8_value) + { + int8_value_() = _int8_value; + m__d = TK_INT8; + } + + /*! + * @brief This function returns the value of member int8_value + * @return Value of member int8_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int8_t int8_value() const + { + if (0x00000003 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_int8_value; + } + + /*! + * @brief This function returns a reference to member int8_value + * @return Reference to member int8_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int8_t& int8_value() + { + if (0x00000003 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_int8_value; + } + + + /*! + * @brief This function sets a value in member uint8_value + * @param _uint8_value New value for member uint8_value + */ + eProsima_user_DllExport void uint8_value( + uint8_t _uint8_value) + { + uint8_value_() = _uint8_value; + m__d = TK_UINT8; + } + + /*! + * @brief This function returns the value of member uint8_value + * @return Value of member uint8_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint8_t uint8_value() const + { + if (0x00000004 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_uint8_value; + } + + /*! + * @brief This function returns a reference to member uint8_value + * @return Reference to member uint8_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint8_t& uint8_value() + { + if (0x00000004 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_uint8_value; + } + + + /*! + * @brief This function sets a value in member int16_value + * @param _int16_value New value for member int16_value + */ + eProsima_user_DllExport void int16_value( + int16_t _int16_value) + { + int16_value_() = _int16_value; + m__d = TK_INT16; + } + + /*! + * @brief This function returns the value of member int16_value + * @return Value of member int16_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int16_t int16_value() const + { + if (0x00000005 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_int16_value; + } + + /*! + * @brief This function returns a reference to member int16_value + * @return Reference to member int16_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int16_t& int16_value() + { + if (0x00000005 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_int16_value; + } + + + /*! + * @brief This function sets a value in member uint_16_value + * @param _uint_16_value New value for member uint_16_value + */ + eProsima_user_DllExport void uint_16_value( + uint16_t _uint_16_value) + { + uint_16_value_() = _uint_16_value; + m__d = TK_UINT16; + } + + /*! + * @brief This function returns the value of member uint_16_value + * @return Value of member uint_16_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint16_t uint_16_value() const + { + if (0x00000006 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_uint_16_value; + } + + /*! + * @brief This function returns a reference to member uint_16_value + * @return Reference to member uint_16_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint16_t& uint_16_value() + { + if (0x00000006 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_uint_16_value; + } + + + /*! + * @brief This function sets a value in member int32_value + * @param _int32_value New value for member int32_value + */ + eProsima_user_DllExport void int32_value( + int32_t _int32_value) + { + int32_value_() = _int32_value; + m__d = TK_INT32; + } + + /*! + * @brief This function returns the value of member int32_value + * @return Value of member int32_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t int32_value() const + { + if (0x00000007 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_int32_value; + } + + /*! + * @brief This function returns a reference to member int32_value + * @return Reference to member int32_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t& int32_value() + { + if (0x00000007 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_int32_value; + } + + + /*! + * @brief This function sets a value in member uint32_value + * @param _uint32_value New value for member uint32_value + */ + eProsima_user_DllExport void uint32_value( + uint32_t _uint32_value) + { + uint32_value_() = _uint32_value; + m__d = TK_UINT32; + } + + /*! + * @brief This function returns the value of member uint32_value + * @return Value of member uint32_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint32_t uint32_value() const + { + if (0x00000008 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_uint32_value; + } + + /*! + * @brief This function returns a reference to member uint32_value + * @return Reference to member uint32_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint32_t& uint32_value() + { + if (0x00000008 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_uint32_value; + } + + + /*! + * @brief This function sets a value in member int64_value + * @param _int64_value New value for member int64_value + */ + eProsima_user_DllExport void int64_value( + int64_t _int64_value) + { + int64_value_() = _int64_value; + m__d = TK_INT64; + } + + /*! + * @brief This function returns the value of member int64_value + * @return Value of member int64_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int64_t int64_value() const + { + if (0x00000009 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_int64_value; + } + + /*! + * @brief This function returns a reference to member int64_value + * @return Reference to member int64_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int64_t& int64_value() + { + if (0x00000009 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_int64_value; + } + + + /*! + * @brief This function sets a value in member uint64_value + * @param _uint64_value New value for member uint64_value + */ + eProsima_user_DllExport void uint64_value( + uint64_t _uint64_value) + { + uint64_value_() = _uint64_value; + m__d = TK_UINT64; + } + + /*! + * @brief This function returns the value of member uint64_value + * @return Value of member uint64_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint64_t uint64_value() const + { + if (0x0000000a != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_uint64_value; + } + + /*! + * @brief This function returns a reference to member uint64_value + * @return Reference to member uint64_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport uint64_t& uint64_value() + { + if (0x0000000a != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_uint64_value; + } + + + /*! + * @brief This function sets a value in member float32_value + * @param _float32_value New value for member float32_value + */ + eProsima_user_DllExport void float32_value( + float _float32_value) + { + float32_value_() = _float32_value; + m__d = TK_FLOAT32; + } + + /*! + * @brief This function returns the value of member float32_value + * @return Value of member float32_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport float float32_value() const + { + if (0x0000000b != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_float32_value; + } + + /*! + * @brief This function returns a reference to member float32_value + * @return Reference to member float32_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport float& float32_value() + { + if (0x0000000b != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_float32_value; + } + + + /*! + * @brief This function sets a value in member float64_value + * @param _float64_value New value for member float64_value + */ + eProsima_user_DllExport void float64_value( + double _float64_value) + { + float64_value_() = _float64_value; + m__d = TK_FLOAT64; + } + + /*! + * @brief This function returns the value of member float64_value + * @return Value of member float64_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport double float64_value() const + { + if (0x0000000c != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_float64_value; + } + + /*! + * @brief This function returns a reference to member float64_value + * @return Reference to member float64_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport double& float64_value() + { + if (0x0000000c != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_float64_value; + } + + + /*! + * @brief This function sets a value in member float128_value + * @param _float128_value New value for member float128_value + */ + eProsima_user_DllExport void float128_value( + long double _float128_value) + { + float128_value_() = _float128_value; + m__d = TK_FLOAT128; + } + + /*! + * @brief This function returns the value of member float128_value + * @return Value of member float128_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport long double float128_value() const + { + if (0x0000000d != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_float128_value; + } + + /*! + * @brief This function returns a reference to member float128_value + * @return Reference to member float128_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport long double& float128_value() + { + if (0x0000000d != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_float128_value; + } + + + /*! + * @brief This function sets a value in member char_value + * @param _char_value New value for member char_value + */ + eProsima_user_DllExport void char_value( + char _char_value) + { + char_value_() = _char_value; + m__d = TK_CHAR8; + } + + /*! + * @brief This function returns the value of member char_value + * @return Value of member char_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport char char_value() const + { + if (0x0000000e != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_char_value; + } + + /*! + * @brief This function returns a reference to member char_value + * @return Reference to member char_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport char& char_value() + { + if (0x0000000e != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_char_value; + } + + + /*! + * @brief This function sets a value in member wchar_value + * @param _wchar_value New value for member wchar_value + */ + eProsima_user_DllExport void wchar_value( + wchar_t _wchar_value) + { + wchar_value_() = _wchar_value; + m__d = TK_CHAR16; + } + + /*! + * @brief This function returns the value of member wchar_value + * @return Value of member wchar_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport wchar_t wchar_value() const + { + if (0x0000000f != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_wchar_value; + } + + /*! + * @brief This function returns a reference to member wchar_value + * @return Reference to member wchar_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport wchar_t& wchar_value() + { + if (0x0000000f != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_wchar_value; + } + + + /*! + * @brief This function sets a value in member enumerated_value + * @param _enumerated_value New value for member enumerated_value + */ + eProsima_user_DllExport void enumerated_value( + int32_t _enumerated_value) + { + enumerated_value_() = _enumerated_value; + m__d = TK_ENUM; + } + + /*! + * @brief This function returns the value of member enumerated_value + * @return Value of member enumerated_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t enumerated_value() const + { + if (0x00000010 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_enumerated_value; + } + + /*! + * @brief This function returns a reference to member enumerated_value + * @return Reference to member enumerated_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport int32_t& enumerated_value() + { + if (0x00000010 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_enumerated_value; + } + + + /*! + * @brief This function copies the value in member string8_value + * @param _string8_value New value to be copied in member string8_value + */ + eProsima_user_DllExport void string8_value( + const eprosima::fastcdr::fixed_string& _string8_value) + { + string8_value_() = _string8_value; + m__d = TK_STRING8; + } + + /*! + * @brief This function moves the value in member string8_value + * @param _string8_value New value to be moved in member string8_value + */ + eProsima_user_DllExport void string8_value( + eprosima::fastcdr::fixed_string&& _string8_value) + { + string8_value_() = _string8_value; + m__d = TK_STRING8; + } + + /*! + * @brief This function returns a constant reference to member string8_value + * @return Constant reference to member string8_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const eprosima::fastcdr::fixed_string& string8_value() const + { + if (0x00000011 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_string8_value; + } + + /*! + * @brief This function returns a reference to member string8_value + * @return Reference to member string8_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport eprosima::fastcdr::fixed_string& string8_value() + { + if (0x00000011 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_string8_value; + } + + + /*! + * @brief This function copies the value in member string16_value + * @param _string16_value New value to be copied in member string16_value + */ + eProsima_user_DllExport void string16_value( + const std::wstring& _string16_value) + { + string16_value_() = _string16_value; + m__d = TK_STRING16; + } + + /*! + * @brief This function moves the value in member string16_value + * @param _string16_value New value to be moved in member string16_value + */ + eProsima_user_DllExport void string16_value( + std::wstring&& _string16_value) + { + string16_value_() = _string16_value; + m__d = TK_STRING16; + } + + /*! + * @brief This function returns a constant reference to member string16_value + * @return Constant reference to member string16_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const std::wstring& string16_value() const + { + if (0x00000012 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_string16_value; + } + + /*! + * @brief This function returns a reference to member string16_value + * @return Reference to member string16_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport std::wstring& string16_value() + { + if (0x00000012 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_string16_value; + } + + + /*! + * @brief This function copies the value in member extended_value + * @param _extended_value New value to be copied in member extended_value + */ + eProsima_user_DllExport void extended_value( + const ExtendedAnnotationParameterValue& _extended_value) + { + extended_value_() = _extended_value; + m__d = 0; + } + + /*! + * @brief This function moves the value in member extended_value + * @param _extended_value New value to be moved in member extended_value + */ + eProsima_user_DllExport void extended_value( + ExtendedAnnotationParameterValue&& _extended_value) + { + extended_value_() = _extended_value; + m__d = 0; + } + + /*! + * @brief This function returns a constant reference to member extended_value + * @return Constant reference to member extended_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const ExtendedAnnotationParameterValue& extended_value() const + { + if (0x00000013 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_extended_value; + } + + /*! + * @brief This function returns a reference to member extended_value + * @return Reference to member extended_value + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport ExtendedAnnotationParameterValue& extended_value() + { + if (0x00000013 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_extended_value; + } + + + +private: + + bool& boolean_value_() + { + if (0x00000001 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000001; + member_destructor_ = nullptr; + m_boolean_value = {false}; + ; + } + + return m_boolean_value; + } + + uint8_t& byte_value_() + { + if (0x00000002 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000002; + member_destructor_ = nullptr; + m_byte_value = {0}; + ; + } + + return m_byte_value; + } + + int8_t& int8_value_() + { + if (0x00000003 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000003; + member_destructor_ = nullptr; + m_int8_value = {0}; + ; + } + + return m_int8_value; + } + + uint8_t& uint8_value_() + { + if (0x00000004 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000004; + member_destructor_ = nullptr; + m_uint8_value = {0}; + ; + } + + return m_uint8_value; + } + + int16_t& int16_value_() + { + if (0x00000005 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000005; + member_destructor_ = nullptr; + m_int16_value = {0}; + ; + } + + return m_int16_value; + } + + uint16_t& uint_16_value_() + { + if (0x00000006 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000006; + member_destructor_ = nullptr; + m_uint_16_value = {0}; + ; + } + + return m_uint_16_value; + } + + int32_t& int32_value_() + { + if (0x00000007 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000007; + member_destructor_ = nullptr; + m_int32_value = {0}; + ; + } + + return m_int32_value; + } + + uint32_t& uint32_value_() + { + if (0x00000008 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000008; + member_destructor_ = nullptr; + m_uint32_value = {0}; + ; + } + + return m_uint32_value; + } + + int64_t& int64_value_() + { + if (0x00000009 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000009; + member_destructor_ = nullptr; + m_int64_value = {0}; + ; + } + + return m_int64_value; + } + + uint64_t& uint64_value_() + { + if (0x0000000a != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0000000a; + member_destructor_ = nullptr; + m_uint64_value = {0}; + ; + } + + return m_uint64_value; + } + + float& float32_value_() + { + if (0x0000000b != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0000000b; + member_destructor_ = nullptr; + m_float32_value = {0.0}; + ; + } + + return m_float32_value; + } + + double& float64_value_() + { + if (0x0000000c != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0000000c; + member_destructor_ = nullptr; + m_float64_value = {0.0}; + ; + } + + return m_float64_value; + } + + long double& float128_value_() + { + if (0x0000000d != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0000000d; + member_destructor_ = nullptr; + m_float128_value = {0.0}; + ; + } + + return m_float128_value; + } + + char& char_value_() + { + if (0x0000000e != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0000000e; + member_destructor_ = nullptr; + m_char_value = {0}; + ; + } + + return m_char_value; + } + + wchar_t& wchar_value_() + { + if (0x0000000f != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0000000f; + member_destructor_ = nullptr; + m_wchar_value = {0}; + ; + } + + return m_wchar_value; + } + + int32_t& enumerated_value_() + { + if (0x00000010 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000010; + member_destructor_ = nullptr; + m_enumerated_value = {0}; + ; + } + + return m_enumerated_value; + } + + eprosima::fastcdr::fixed_string& string8_value_() + { + if (0x00000011 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000011; + member_destructor_ = [&]() {m_string8_value.~fixed_string();}; + new(&m_string8_value) eprosima::fastcdr::fixed_string(); + ; + } + + return m_string8_value; + } + + std::wstring& string16_value_() + { + if (0x00000012 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000012; + member_destructor_ = [&]() {m_string16_value.~basic_string();}; + new(&m_string16_value) std::wstring(); + ; + } + + return m_string16_value; + } + + ExtendedAnnotationParameterValue& extended_value_() + { + if (0x00000013 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000013; + member_destructor_ = [&]() {m_extended_value.~ExtendedAnnotationParameterValue();}; + new(&m_extended_value) ExtendedAnnotationParameterValue(); + ; + } + + return m_extended_value; + } + + + uint8_t m__d {0}; + + union + { + bool m_boolean_value; + uint8_t m_byte_value; + int8_t m_int8_value; + uint8_t m_uint8_value; + int16_t m_int16_value; + uint16_t m_uint_16_value; + int32_t m_int32_value; + uint32_t m_uint32_value; + int64_t m_int64_value; + uint64_t m_uint64_value; + float m_float32_value; + double m_float64_value; + long double m_float128_value; + char m_char_value; + wchar_t m_wchar_value; + int32_t m_enumerated_value; + eprosima::fastcdr::fixed_string m_string8_value; + std::wstring m_string16_value; + ExtendedAnnotationParameterValue m_extended_value; + }; + + uint32_t selected_member_ {0x0FFFFFFFu}; + + std::function member_destructor_; +}; +/*! + * @brief This class represents the structure AppliedAnnotationParameter defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class AppliedAnnotationParameter +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AppliedAnnotationParameter() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AppliedAnnotationParameter() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object AppliedAnnotationParameter that will be copied. + */ + eProsima_user_DllExport AppliedAnnotationParameter( + const AppliedAnnotationParameter& x) + { + m_paramname_hash = x.m_paramname_hash; + + m_value = x.m_value; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object AppliedAnnotationParameter that will be copied. + */ + eProsima_user_DllExport AppliedAnnotationParameter( + AppliedAnnotationParameter&& x) noexcept + { + m_paramname_hash = std::move(x.m_paramname_hash); + m_value = std::move(x.m_value); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object AppliedAnnotationParameter that will be copied. + */ + eProsima_user_DllExport AppliedAnnotationParameter& operator =( + const AppliedAnnotationParameter& x) + { + + m_paramname_hash = x.m_paramname_hash; + + m_value = x.m_value; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object AppliedAnnotationParameter that will be copied. + */ + eProsima_user_DllExport AppliedAnnotationParameter& operator =( + AppliedAnnotationParameter&& x) noexcept + { + + m_paramname_hash = std::move(x.m_paramname_hash); + m_value = std::move(x.m_value); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x AppliedAnnotationParameter object to compare. + */ + eProsima_user_DllExport bool operator ==( + const AppliedAnnotationParameter& x) const + { + return (m_paramname_hash == x.m_paramname_hash && + m_value == x.m_value); + } + + /*! + * @brief Comparison operator. + * @param x AppliedAnnotationParameter object to compare. + */ + eProsima_user_DllExport bool operator !=( + const AppliedAnnotationParameter& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member paramname_hash + * @param _paramname_hash New value to be copied in member paramname_hash + */ + eProsima_user_DllExport void paramname_hash( + const NameHash& _paramname_hash) + { + m_paramname_hash = _paramname_hash; + } + + /*! + * @brief This function moves the value in member paramname_hash + * @param _paramname_hash New value to be moved in member paramname_hash + */ + eProsima_user_DllExport void paramname_hash( + NameHash&& _paramname_hash) + { + m_paramname_hash = std::move(_paramname_hash); + } + + /*! + * @brief This function returns a constant reference to member paramname_hash + * @return Constant reference to member paramname_hash + */ + eProsima_user_DllExport const NameHash& paramname_hash() const + { + return m_paramname_hash; + } + + /*! + * @brief This function returns a reference to member paramname_hash + * @return Reference to member paramname_hash + */ + eProsima_user_DllExport NameHash& paramname_hash() + { + return m_paramname_hash; + } + + + /*! + * @brief This function copies the value in member value + * @param _value New value to be copied in member value + */ + eProsima_user_DllExport void value( + const AnnotationParameterValue& _value) + { + m_value = _value; + } + + /*! + * @brief This function moves the value in member value + * @param _value New value to be moved in member value + */ + eProsima_user_DllExport void value( + AnnotationParameterValue&& _value) + { + m_value = std::move(_value); + } + + /*! + * @brief This function returns a constant reference to member value + * @return Constant reference to member value + */ + eProsima_user_DllExport const AnnotationParameterValue& value() const + { + return m_value; + } + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport AnnotationParameterValue& value() + { + return m_value; + } + + + +private: + + NameHash m_paramname_hash{0}; + AnnotationParameterValue m_value; + +}; +typedef std::vector AppliedAnnotationParameterSeq; + +/*! + * @brief This class represents the structure AppliedAnnotation defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class AppliedAnnotation +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AppliedAnnotation() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AppliedAnnotation() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object AppliedAnnotation that will be copied. + */ + eProsima_user_DllExport AppliedAnnotation( + const AppliedAnnotation& x) + { + m_annotation_typeid = x.m_annotation_typeid; + + m_param_seq = x.m_param_seq; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object AppliedAnnotation that will be copied. + */ + eProsima_user_DllExport AppliedAnnotation( + AppliedAnnotation&& x) noexcept + { + m_annotation_typeid = std::move(x.m_annotation_typeid); + m_param_seq = std::move(x.m_param_seq); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object AppliedAnnotation that will be copied. + */ + eProsima_user_DllExport AppliedAnnotation& operator =( + const AppliedAnnotation& x) + { + + m_annotation_typeid = x.m_annotation_typeid; + + m_param_seq = x.m_param_seq; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object AppliedAnnotation that will be copied. + */ + eProsima_user_DllExport AppliedAnnotation& operator =( + AppliedAnnotation&& x) noexcept + { + + m_annotation_typeid = std::move(x.m_annotation_typeid); + m_param_seq = std::move(x.m_param_seq); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x AppliedAnnotation object to compare. + */ + eProsima_user_DllExport bool operator ==( + const AppliedAnnotation& x) const + { + return (m_annotation_typeid == x.m_annotation_typeid && + m_param_seq == x.m_param_seq); + } + + /*! + * @brief Comparison operator. + * @param x AppliedAnnotation object to compare. + */ + eProsima_user_DllExport bool operator !=( + const AppliedAnnotation& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member annotation_typeid + * @param _annotation_typeid New value to be copied in member annotation_typeid + */ + eProsima_user_DllExport void annotation_typeid( + const TypeIdentifier& _annotation_typeid) + { + m_annotation_typeid = _annotation_typeid; + } + + /*! + * @brief This function moves the value in member annotation_typeid + * @param _annotation_typeid New value to be moved in member annotation_typeid + */ + eProsima_user_DllExport void annotation_typeid( + TypeIdentifier&& _annotation_typeid) + { + m_annotation_typeid = std::move(_annotation_typeid); + } + + /*! + * @brief This function returns a constant reference to member annotation_typeid + * @return Constant reference to member annotation_typeid + */ + eProsima_user_DllExport const TypeIdentifier& annotation_typeid() const + { + return m_annotation_typeid; + } + + /*! + * @brief This function returns a reference to member annotation_typeid + * @return Reference to member annotation_typeid + */ + eProsima_user_DllExport TypeIdentifier& annotation_typeid() + { + return m_annotation_typeid; + } + + + /*! + * @brief This function copies the value in member param_seq + * @param _param_seq New value to be copied in member param_seq + */ + eProsima_user_DllExport void param_seq( + const eprosima::fastcdr::optional& _param_seq) + { + m_param_seq = _param_seq; + } + + /*! + * @brief This function moves the value in member param_seq + * @param _param_seq New value to be moved in member param_seq + */ + eProsima_user_DllExport void param_seq( + eprosima::fastcdr::optional&& _param_seq) + { + m_param_seq = std::move(_param_seq); + } + + /*! + * @brief This function returns a constant reference to member param_seq + * @return Constant reference to member param_seq + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& param_seq() const + { + return m_param_seq; + } + + /*! + * @brief This function returns a reference to member param_seq + * @return Reference to member param_seq + */ + eProsima_user_DllExport eprosima::fastcdr::optional& param_seq() + { + return m_param_seq; + } + + + +private: + + TypeIdentifier m_annotation_typeid; + eprosima::fastcdr::optional m_param_seq; + +}; +typedef std::vector AppliedAnnotationSeq; + +/*! + * @brief This class represents the structure AppliedVerbatimAnnotation defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class AppliedVerbatimAnnotation +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AppliedVerbatimAnnotation() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AppliedVerbatimAnnotation() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object AppliedVerbatimAnnotation that will be copied. + */ + eProsima_user_DllExport AppliedVerbatimAnnotation( + const AppliedVerbatimAnnotation& x) + { + m_placement = x.m_placement; + + m_language = x.m_language; + + m_text = x.m_text; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object AppliedVerbatimAnnotation that will be copied. + */ + eProsima_user_DllExport AppliedVerbatimAnnotation( + AppliedVerbatimAnnotation&& x) noexcept + { + m_placement = std::move(x.m_placement); + m_language = std::move(x.m_language); + m_text = std::move(x.m_text); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object AppliedVerbatimAnnotation that will be copied. + */ + eProsima_user_DllExport AppliedVerbatimAnnotation& operator =( + const AppliedVerbatimAnnotation& x) + { + + m_placement = x.m_placement; + + m_language = x.m_language; + + m_text = x.m_text; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object AppliedVerbatimAnnotation that will be copied. + */ + eProsima_user_DllExport AppliedVerbatimAnnotation& operator =( + AppliedVerbatimAnnotation&& x) noexcept + { + + m_placement = std::move(x.m_placement); + m_language = std::move(x.m_language); + m_text = std::move(x.m_text); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x AppliedVerbatimAnnotation object to compare. + */ + eProsima_user_DllExport bool operator ==( + const AppliedVerbatimAnnotation& x) const + { + return (m_placement == x.m_placement && + m_language == x.m_language && + m_text == x.m_text); + } + + /*! + * @brief Comparison operator. + * @param x AppliedVerbatimAnnotation object to compare. + */ + eProsima_user_DllExport bool operator !=( + const AppliedVerbatimAnnotation& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member placement + * @param _placement New value to be copied in member placement + */ + eProsima_user_DllExport void placement( + const eprosima::fastcdr::fixed_string<32>& _placement) + { + m_placement = _placement; + } + + /*! + * @brief This function moves the value in member placement + * @param _placement New value to be moved in member placement + */ + eProsima_user_DllExport void placement( + eprosima::fastcdr::fixed_string<32>&& _placement) + { + m_placement = std::move(_placement); + } + + /*! + * @brief This function returns a constant reference to member placement + * @return Constant reference to member placement + */ + eProsima_user_DllExport const eprosima::fastcdr::fixed_string<32>& placement() const + { + return m_placement; + } + + /*! + * @brief This function returns a reference to member placement + * @return Reference to member placement + */ + eProsima_user_DllExport eprosima::fastcdr::fixed_string<32>& placement() + { + return m_placement; + } + + + /*! + * @brief This function copies the value in member language + * @param _language New value to be copied in member language + */ + eProsima_user_DllExport void language( + const eprosima::fastcdr::fixed_string<32>& _language) + { + m_language = _language; + } + + /*! + * @brief This function moves the value in member language + * @param _language New value to be moved in member language + */ + eProsima_user_DllExport void language( + eprosima::fastcdr::fixed_string<32>&& _language) + { + m_language = std::move(_language); + } + + /*! + * @brief This function returns a constant reference to member language + * @return Constant reference to member language + */ + eProsima_user_DllExport const eprosima::fastcdr::fixed_string<32>& language() const + { + return m_language; + } + + /*! + * @brief This function returns a reference to member language + * @return Reference to member language + */ + eProsima_user_DllExport eprosima::fastcdr::fixed_string<32>& language() + { + return m_language; + } + + + /*! + * @brief This function copies the value in member text + * @param _text New value to be copied in member text + */ + eProsima_user_DllExport void text( + const std::string& _text) + { + m_text = _text; + } + + /*! + * @brief This function moves the value in member text + * @param _text New value to be moved in member text + */ + eProsima_user_DllExport void text( + std::string&& _text) + { + m_text = std::move(_text); + } + + /*! + * @brief This function returns a constant reference to member text + * @return Constant reference to member text + */ + eProsima_user_DllExport const std::string& text() const + { + return m_text; + } + + /*! + * @brief This function returns a reference to member text + * @return Reference to member text + */ + eProsima_user_DllExport std::string& text() + { + return m_text; + } + + + +private: + + eprosima::fastcdr::fixed_string<32> m_placement; + eprosima::fastcdr::fixed_string<32> m_language; + std::string m_text; + +}; +/*! + * @brief This class represents the structure AppliedBuiltinMemberAnnotations defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class AppliedBuiltinMemberAnnotations +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AppliedBuiltinMemberAnnotations() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AppliedBuiltinMemberAnnotations() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object AppliedBuiltinMemberAnnotations that will be copied. + */ + eProsima_user_DllExport AppliedBuiltinMemberAnnotations( + const AppliedBuiltinMemberAnnotations& x) + { + m_unit = x.m_unit; + + m_min = x.m_min; + + m_max = x.m_max; + + m_hash_id = x.m_hash_id; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object AppliedBuiltinMemberAnnotations that will be copied. + */ + eProsima_user_DllExport AppliedBuiltinMemberAnnotations( + AppliedBuiltinMemberAnnotations&& x) noexcept + { + m_unit = std::move(x.m_unit); + m_min = std::move(x.m_min); + m_max = std::move(x.m_max); + m_hash_id = std::move(x.m_hash_id); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object AppliedBuiltinMemberAnnotations that will be copied. + */ + eProsima_user_DllExport AppliedBuiltinMemberAnnotations& operator =( + const AppliedBuiltinMemberAnnotations& x) + { + + m_unit = x.m_unit; + + m_min = x.m_min; + + m_max = x.m_max; + + m_hash_id = x.m_hash_id; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object AppliedBuiltinMemberAnnotations that will be copied. + */ + eProsima_user_DllExport AppliedBuiltinMemberAnnotations& operator =( + AppliedBuiltinMemberAnnotations&& x) noexcept + { + + m_unit = std::move(x.m_unit); + m_min = std::move(x.m_min); + m_max = std::move(x.m_max); + m_hash_id = std::move(x.m_hash_id); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x AppliedBuiltinMemberAnnotations object to compare. + */ + eProsima_user_DllExport bool operator ==( + const AppliedBuiltinMemberAnnotations& x) const + { + return (m_unit == x.m_unit && + m_min == x.m_min && + m_max == x.m_max && + m_hash_id == x.m_hash_id); + } + + /*! + * @brief Comparison operator. + * @param x AppliedBuiltinMemberAnnotations object to compare. + */ + eProsima_user_DllExport bool operator !=( + const AppliedBuiltinMemberAnnotations& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member unit + * @param _unit New value to be copied in member unit + */ + eProsima_user_DllExport void unit( + const eprosima::fastcdr::optional& _unit) + { + m_unit = _unit; + } + + /*! + * @brief This function moves the value in member unit + * @param _unit New value to be moved in member unit + */ + eProsima_user_DllExport void unit( + eprosima::fastcdr::optional&& _unit) + { + m_unit = std::move(_unit); + } + + /*! + * @brief This function returns a constant reference to member unit + * @return Constant reference to member unit + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& unit() const + { + return m_unit; + } + + /*! + * @brief This function returns a reference to member unit + * @return Reference to member unit + */ + eProsima_user_DllExport eprosima::fastcdr::optional& unit() + { + return m_unit; + } + + + /*! + * @brief This function copies the value in member min + * @param _min New value to be copied in member min + */ + eProsima_user_DllExport void min( + const eprosima::fastcdr::optional& _min) + { + m_min = _min; + } + + /*! + * @brief This function moves the value in member min + * @param _min New value to be moved in member min + */ + eProsima_user_DllExport void min( + eprosima::fastcdr::optional&& _min) + { + m_min = std::move(_min); + } + + /*! + * @brief This function returns a constant reference to member min + * @return Constant reference to member min + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& min() const + { + return m_min; + } + + /*! + * @brief This function returns a reference to member min + * @return Reference to member min + */ + eProsima_user_DllExport eprosima::fastcdr::optional& min() + { + return m_min; + } + + + /*! + * @brief This function copies the value in member max + * @param _max New value to be copied in member max + */ + eProsima_user_DllExport void max( + const eprosima::fastcdr::optional& _max) + { + m_max = _max; + } + + /*! + * @brief This function moves the value in member max + * @param _max New value to be moved in member max + */ + eProsima_user_DllExport void max( + eprosima::fastcdr::optional&& _max) + { + m_max = std::move(_max); + } + + /*! + * @brief This function returns a constant reference to member max + * @return Constant reference to member max + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& max() const + { + return m_max; + } + + /*! + * @brief This function returns a reference to member max + * @return Reference to member max + */ + eProsima_user_DllExport eprosima::fastcdr::optional& max() + { + return m_max; + } + + + /*! + * @brief This function copies the value in member hash_id + * @param _hash_id New value to be copied in member hash_id + */ + eProsima_user_DllExport void hash_id( + const eprosima::fastcdr::optional& _hash_id) + { + m_hash_id = _hash_id; + } + + /*! + * @brief This function moves the value in member hash_id + * @param _hash_id New value to be moved in member hash_id + */ + eProsima_user_DllExport void hash_id( + eprosima::fastcdr::optional&& _hash_id) + { + m_hash_id = std::move(_hash_id); + } + + /*! + * @brief This function returns a constant reference to member hash_id + * @return Constant reference to member hash_id + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& hash_id() const + { + return m_hash_id; + } + + /*! + * @brief This function returns a reference to member hash_id + * @return Reference to member hash_id + */ + eProsima_user_DllExport eprosima::fastcdr::optional& hash_id() + { + return m_hash_id; + } + + + +private: + + eprosima::fastcdr::optional m_unit; + eprosima::fastcdr::optional m_min; + eprosima::fastcdr::optional m_max; + eprosima::fastcdr::optional m_hash_id; + +}; +/*! + * @brief This class represents the structure CommonStructMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonStructMember +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CommonStructMember() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CommonStructMember() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CommonStructMember that will be copied. + */ + eProsima_user_DllExport CommonStructMember( + const CommonStructMember& x) + { + m_member_id = x.m_member_id; + + m_member_flags = x.m_member_flags; + + m_member_type_id = x.m_member_type_id; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CommonStructMember that will be copied. + */ + eProsima_user_DllExport CommonStructMember( + CommonStructMember&& x) noexcept + { + m_member_id = x.m_member_id; + m_member_flags = std::move(x.m_member_flags); + m_member_type_id = std::move(x.m_member_type_id); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CommonStructMember that will be copied. + */ + eProsima_user_DllExport CommonStructMember& operator =( + const CommonStructMember& x) + { + + m_member_id = x.m_member_id; + + m_member_flags = x.m_member_flags; + + m_member_type_id = x.m_member_type_id; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CommonStructMember that will be copied. + */ + eProsima_user_DllExport CommonStructMember& operator =( + CommonStructMember&& x) noexcept + { + + m_member_id = x.m_member_id; + m_member_flags = std::move(x.m_member_flags); + m_member_type_id = std::move(x.m_member_type_id); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CommonStructMember object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CommonStructMember& x) const + { + return (m_member_id == x.m_member_id && + m_member_flags == x.m_member_flags && + m_member_type_id == x.m_member_type_id); + } + + /*! + * @brief Comparison operator. + * @param x CommonStructMember object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CommonStructMember& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member member_id + * @param _member_id New value for member member_id + */ + eProsima_user_DllExport void member_id( + MemberId _member_id) + { + m_member_id = _member_id; + } + + /*! + * @brief This function returns the value of member member_id + * @return Value of member member_id + */ + eProsima_user_DllExport MemberId member_id() const + { + return m_member_id; + } + + /*! + * @brief This function returns a reference to member member_id + * @return Reference to member member_id + */ + eProsima_user_DllExport MemberId& member_id() + { + return m_member_id; + } + + + /*! + * @brief This function copies the value in member member_flags + * @param _member_flags New value to be copied in member member_flags + */ + eProsima_user_DllExport void member_flags( + const StructMemberFlag& _member_flags) + { + m_member_flags = _member_flags; + } + + /*! + * @brief This function moves the value in member member_flags + * @param _member_flags New value to be moved in member member_flags + */ + eProsima_user_DllExport void member_flags( + StructMemberFlag&& _member_flags) + { + m_member_flags = std::move(_member_flags); + } + + /*! + * @brief This function returns a constant reference to member member_flags + * @return Constant reference to member member_flags + */ + eProsima_user_DllExport const StructMemberFlag& member_flags() const + { + return m_member_flags; + } + + /*! + * @brief This function returns a reference to member member_flags + * @return Reference to member member_flags + */ + eProsima_user_DllExport StructMemberFlag& member_flags() + { + return m_member_flags; + } + + + /*! + * @brief This function copies the value in member member_type_id + * @param _member_type_id New value to be copied in member member_type_id + */ + eProsima_user_DllExport void member_type_id( + const TypeIdentifier& _member_type_id) + { + m_member_type_id = _member_type_id; + } + + /*! + * @brief This function moves the value in member member_type_id + * @param _member_type_id New value to be moved in member member_type_id + */ + eProsima_user_DllExport void member_type_id( + TypeIdentifier&& _member_type_id) + { + m_member_type_id = std::move(_member_type_id); + } + + /*! + * @brief This function returns a constant reference to member member_type_id + * @return Constant reference to member member_type_id + */ + eProsima_user_DllExport const TypeIdentifier& member_type_id() const + { + return m_member_type_id; + } + + /*! + * @brief This function returns a reference to member member_type_id + * @return Reference to member member_type_id + */ + eProsima_user_DllExport TypeIdentifier& member_type_id() + { + return m_member_type_id; + } + + + +private: + + MemberId m_member_id{0}; + StructMemberFlag m_member_flags{0}; + TypeIdentifier m_member_type_id; + +}; +/*! + * @brief This class represents the structure CompleteMemberDetail defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteMemberDetail +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteMemberDetail() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteMemberDetail() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteMemberDetail that will be copied. + */ + eProsima_user_DllExport CompleteMemberDetail( + const CompleteMemberDetail& x) + { + m_name = x.m_name; + + m_ann_builtin = x.m_ann_builtin; + + m_ann_custom = x.m_ann_custom; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteMemberDetail that will be copied. + */ + eProsima_user_DllExport CompleteMemberDetail( + CompleteMemberDetail&& x) noexcept + { + m_name = std::move(x.m_name); + m_ann_builtin = std::move(x.m_ann_builtin); + m_ann_custom = std::move(x.m_ann_custom); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteMemberDetail that will be copied. + */ + eProsima_user_DllExport CompleteMemberDetail& operator =( + const CompleteMemberDetail& x) + { + + m_name = x.m_name; + + m_ann_builtin = x.m_ann_builtin; + + m_ann_custom = x.m_ann_custom; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteMemberDetail that will be copied. + */ + eProsima_user_DllExport CompleteMemberDetail& operator =( + CompleteMemberDetail&& x) noexcept + { + + m_name = std::move(x.m_name); + m_ann_builtin = std::move(x.m_ann_builtin); + m_ann_custom = std::move(x.m_ann_custom); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteMemberDetail object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteMemberDetail& x) const + { + return (m_name == x.m_name && + m_ann_builtin == x.m_ann_builtin && + m_ann_custom == x.m_ann_custom); + } + + /*! + * @brief Comparison operator. + * @param x CompleteMemberDetail object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteMemberDetail& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member name + * @param _name New value to be copied in member name + */ + eProsima_user_DllExport void name( + const MemberName& _name) + { + m_name = _name; + } + + /*! + * @brief This function moves the value in member name + * @param _name New value to be moved in member name + */ + eProsima_user_DllExport void name( + MemberName&& _name) + { + m_name = std::move(_name); + } + + /*! + * @brief This function returns a constant reference to member name + * @return Constant reference to member name + */ + eProsima_user_DllExport const MemberName& name() const + { + return m_name; + } + + /*! + * @brief This function returns a reference to member name + * @return Reference to member name + */ + eProsima_user_DllExport MemberName& name() + { + return m_name; + } + + + /*! + * @brief This function copies the value in member ann_builtin + * @param _ann_builtin New value to be copied in member ann_builtin + */ + eProsima_user_DllExport void ann_builtin( + const eprosima::fastcdr::optional& _ann_builtin) + { + m_ann_builtin = _ann_builtin; + } + + /*! + * @brief This function moves the value in member ann_builtin + * @param _ann_builtin New value to be moved in member ann_builtin + */ + eProsima_user_DllExport void ann_builtin( + eprosima::fastcdr::optional&& _ann_builtin) + { + m_ann_builtin = std::move(_ann_builtin); + } + + /*! + * @brief This function returns a constant reference to member ann_builtin + * @return Constant reference to member ann_builtin + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& ann_builtin() const + { + return m_ann_builtin; + } + + /*! + * @brief This function returns a reference to member ann_builtin + * @return Reference to member ann_builtin + */ + eProsima_user_DllExport eprosima::fastcdr::optional& ann_builtin() + { + return m_ann_builtin; + } + + + /*! + * @brief This function copies the value in member ann_custom + * @param _ann_custom New value to be copied in member ann_custom + */ + eProsima_user_DllExport void ann_custom( + const eprosima::fastcdr::optional& _ann_custom) + { + m_ann_custom = _ann_custom; + } + + /*! + * @brief This function moves the value in member ann_custom + * @param _ann_custom New value to be moved in member ann_custom + */ + eProsima_user_DllExport void ann_custom( + eprosima::fastcdr::optional&& _ann_custom) + { + m_ann_custom = std::move(_ann_custom); + } + + /*! + * @brief This function returns a constant reference to member ann_custom + * @return Constant reference to member ann_custom + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& ann_custom() const + { + return m_ann_custom; + } + + /*! + * @brief This function returns a reference to member ann_custom + * @return Reference to member ann_custom + */ + eProsima_user_DllExport eprosima::fastcdr::optional& ann_custom() + { + return m_ann_custom; + } + + + +private: + + MemberName m_name; + eprosima::fastcdr::optional m_ann_builtin; + eprosima::fastcdr::optional m_ann_custom; + +}; +/*! + * @brief This class represents the structure MinimalMemberDetail defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalMemberDetail +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalMemberDetail() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalMemberDetail() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalMemberDetail that will be copied. + */ + eProsima_user_DllExport MinimalMemberDetail( + const MinimalMemberDetail& x) + { + m_name_hash = x.m_name_hash; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalMemberDetail that will be copied. + */ + eProsima_user_DllExport MinimalMemberDetail( + MinimalMemberDetail&& x) noexcept + { + m_name_hash = std::move(x.m_name_hash); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalMemberDetail that will be copied. + */ + eProsima_user_DllExport MinimalMemberDetail& operator =( + const MinimalMemberDetail& x) + { + + m_name_hash = x.m_name_hash; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalMemberDetail that will be copied. + */ + eProsima_user_DllExport MinimalMemberDetail& operator =( + MinimalMemberDetail&& x) noexcept + { + + m_name_hash = std::move(x.m_name_hash); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalMemberDetail object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalMemberDetail& x) const + { + return (m_name_hash == x.m_name_hash); + } + + /*! + * @brief Comparison operator. + * @param x MinimalMemberDetail object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalMemberDetail& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member name_hash + * @param _name_hash New value to be copied in member name_hash + */ + eProsima_user_DllExport void name_hash( + const NameHash& _name_hash) + { + m_name_hash = _name_hash; + } + + /*! + * @brief This function moves the value in member name_hash + * @param _name_hash New value to be moved in member name_hash + */ + eProsima_user_DllExport void name_hash( + NameHash&& _name_hash) + { + m_name_hash = std::move(_name_hash); + } + + /*! + * @brief This function returns a constant reference to member name_hash + * @return Constant reference to member name_hash + */ + eProsima_user_DllExport const NameHash& name_hash() const + { + return m_name_hash; + } + + /*! + * @brief This function returns a reference to member name_hash + * @return Reference to member name_hash + */ + eProsima_user_DllExport NameHash& name_hash() + { + return m_name_hash; + } + + + +private: + + NameHash m_name_hash{0}; + +}; +/*! + * @brief This class represents the structure CompleteStructMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteStructMember +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteStructMember() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteStructMember() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteStructMember that will be copied. + */ + eProsima_user_DllExport CompleteStructMember( + const CompleteStructMember& x) + { + m_common = x.m_common; + + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteStructMember that will be copied. + */ + eProsima_user_DllExport CompleteStructMember( + CompleteStructMember&& x) noexcept + { + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteStructMember that will be copied. + */ + eProsima_user_DllExport CompleteStructMember& operator =( + const CompleteStructMember& x) + { + + m_common = x.m_common; + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteStructMember that will be copied. + */ + eProsima_user_DllExport CompleteStructMember& operator =( + CompleteStructMember&& x) noexcept + { + + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteStructMember object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteStructMember& x) const + { + return (m_common == x.m_common && + m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x CompleteStructMember object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteStructMember& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonStructMember& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonStructMember&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonStructMember& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonStructMember& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const CompleteMemberDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + CompleteMemberDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const CompleteMemberDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport CompleteMemberDetail& detail() + { + return m_detail; + } + + + +private: + + CommonStructMember m_common; + CompleteMemberDetail m_detail; + +}; +typedef std::vector CompleteStructMemberSeq; + +/*! + * @brief This class represents the structure MinimalStructMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalStructMember +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalStructMember() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalStructMember() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalStructMember that will be copied. + */ + eProsima_user_DllExport MinimalStructMember( + const MinimalStructMember& x) + { + m_common = x.m_common; + + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalStructMember that will be copied. + */ + eProsima_user_DllExport MinimalStructMember( + MinimalStructMember&& x) noexcept + { + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalStructMember that will be copied. + */ + eProsima_user_DllExport MinimalStructMember& operator =( + const MinimalStructMember& x) + { + + m_common = x.m_common; + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalStructMember that will be copied. + */ + eProsima_user_DllExport MinimalStructMember& operator =( + MinimalStructMember&& x) noexcept + { + + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalStructMember object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalStructMember& x) const + { + return (m_common == x.m_common && + m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x MinimalStructMember object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalStructMember& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonStructMember& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonStructMember&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonStructMember& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonStructMember& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const MinimalMemberDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + MinimalMemberDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const MinimalMemberDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport MinimalMemberDetail& detail() + { + return m_detail; + } + + + +private: + + CommonStructMember m_common; + MinimalMemberDetail m_detail; + +}; +typedef std::vector MinimalStructMemberSeq; + +/*! + * @brief This class represents the structure AppliedBuiltinTypeAnnotations defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class AppliedBuiltinTypeAnnotations +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport AppliedBuiltinTypeAnnotations() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~AppliedBuiltinTypeAnnotations() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object AppliedBuiltinTypeAnnotations that will be copied. + */ + eProsima_user_DllExport AppliedBuiltinTypeAnnotations( + const AppliedBuiltinTypeAnnotations& x) + { + m_verbatim = x.m_verbatim; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object AppliedBuiltinTypeAnnotations that will be copied. + */ + eProsima_user_DllExport AppliedBuiltinTypeAnnotations( + AppliedBuiltinTypeAnnotations&& x) noexcept + { + m_verbatim = std::move(x.m_verbatim); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object AppliedBuiltinTypeAnnotations that will be copied. + */ + eProsima_user_DllExport AppliedBuiltinTypeAnnotations& operator =( + const AppliedBuiltinTypeAnnotations& x) + { + + m_verbatim = x.m_verbatim; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object AppliedBuiltinTypeAnnotations that will be copied. + */ + eProsima_user_DllExport AppliedBuiltinTypeAnnotations& operator =( + AppliedBuiltinTypeAnnotations&& x) noexcept + { + + m_verbatim = std::move(x.m_verbatim); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x AppliedBuiltinTypeAnnotations object to compare. + */ + eProsima_user_DllExport bool operator ==( + const AppliedBuiltinTypeAnnotations& x) const + { + return (m_verbatim == x.m_verbatim); + } + + /*! + * @brief Comparison operator. + * @param x AppliedBuiltinTypeAnnotations object to compare. + */ + eProsima_user_DllExport bool operator !=( + const AppliedBuiltinTypeAnnotations& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member verbatim + * @param _verbatim New value to be copied in member verbatim + */ + eProsima_user_DllExport void verbatim( + const eprosima::fastcdr::optional& _verbatim) + { + m_verbatim = _verbatim; + } + + /*! + * @brief This function moves the value in member verbatim + * @param _verbatim New value to be moved in member verbatim + */ + eProsima_user_DllExport void verbatim( + eprosima::fastcdr::optional&& _verbatim) + { + m_verbatim = std::move(_verbatim); + } + + /*! + * @brief This function returns a constant reference to member verbatim + * @return Constant reference to member verbatim + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& verbatim() const + { + return m_verbatim; + } + + /*! + * @brief This function returns a reference to member verbatim + * @return Reference to member verbatim + */ + eProsima_user_DllExport eprosima::fastcdr::optional& verbatim() + { + return m_verbatim; + } + + + +private: + + eprosima::fastcdr::optional m_verbatim; + +}; +/*! + * @brief This class represents the structure MinimalTypeDetail defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalTypeDetail +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalTypeDetail() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalTypeDetail() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalTypeDetail that will be copied. + */ + eProsima_user_DllExport MinimalTypeDetail( + const MinimalTypeDetail& x) + { + static_cast(x); + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalTypeDetail that will be copied. + */ + eProsima_user_DllExport MinimalTypeDetail( + MinimalTypeDetail&& x) noexcept + { + static_cast(x); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalTypeDetail that will be copied. + */ + eProsima_user_DllExport MinimalTypeDetail& operator =( + const MinimalTypeDetail& x) + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalTypeDetail that will be copied. + */ + eProsima_user_DllExport MinimalTypeDetail& operator =( + MinimalTypeDetail&& x) noexcept + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalTypeDetail object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalTypeDetail& x) const + { + static_cast(x); + return true; + } + + /*! + * @brief Comparison operator. + * @param x MinimalTypeDetail object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalTypeDetail& x) const + { + return !(*this == x); + } + + + +private: + + +}; +/*! + * @brief This class represents the structure CompleteTypeDetail defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteTypeDetail +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteTypeDetail() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteTypeDetail() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteTypeDetail that will be copied. + */ + eProsima_user_DllExport CompleteTypeDetail( + const CompleteTypeDetail& x) + { + m_ann_builtin = x.m_ann_builtin; + + m_ann_custom = x.m_ann_custom; + + m_type_name = x.m_type_name; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteTypeDetail that will be copied. + */ + eProsima_user_DllExport CompleteTypeDetail( + CompleteTypeDetail&& x) noexcept + { + m_ann_builtin = std::move(x.m_ann_builtin); + m_ann_custom = std::move(x.m_ann_custom); + m_type_name = std::move(x.m_type_name); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteTypeDetail that will be copied. + */ + eProsima_user_DllExport CompleteTypeDetail& operator =( + const CompleteTypeDetail& x) + { + + m_ann_builtin = x.m_ann_builtin; + + m_ann_custom = x.m_ann_custom; + + m_type_name = x.m_type_name; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteTypeDetail that will be copied. + */ + eProsima_user_DllExport CompleteTypeDetail& operator =( + CompleteTypeDetail&& x) noexcept + { + + m_ann_builtin = std::move(x.m_ann_builtin); + m_ann_custom = std::move(x.m_ann_custom); + m_type_name = std::move(x.m_type_name); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteTypeDetail object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteTypeDetail& x) const + { + return (m_ann_builtin == x.m_ann_builtin && + m_ann_custom == x.m_ann_custom && + m_type_name == x.m_type_name); + } + + /*! + * @brief Comparison operator. + * @param x CompleteTypeDetail object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteTypeDetail& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member ann_builtin + * @param _ann_builtin New value to be copied in member ann_builtin + */ + eProsima_user_DllExport void ann_builtin( + const eprosima::fastcdr::optional& _ann_builtin) + { + m_ann_builtin = _ann_builtin; + } + + /*! + * @brief This function moves the value in member ann_builtin + * @param _ann_builtin New value to be moved in member ann_builtin + */ + eProsima_user_DllExport void ann_builtin( + eprosima::fastcdr::optional&& _ann_builtin) + { + m_ann_builtin = std::move(_ann_builtin); + } + + /*! + * @brief This function returns a constant reference to member ann_builtin + * @return Constant reference to member ann_builtin + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& ann_builtin() const + { + return m_ann_builtin; + } + + /*! + * @brief This function returns a reference to member ann_builtin + * @return Reference to member ann_builtin + */ + eProsima_user_DllExport eprosima::fastcdr::optional& ann_builtin() + { + return m_ann_builtin; + } + + + /*! + * @brief This function copies the value in member ann_custom + * @param _ann_custom New value to be copied in member ann_custom + */ + eProsima_user_DllExport void ann_custom( + const eprosima::fastcdr::optional& _ann_custom) + { + m_ann_custom = _ann_custom; + } + + /*! + * @brief This function moves the value in member ann_custom + * @param _ann_custom New value to be moved in member ann_custom + */ + eProsima_user_DllExport void ann_custom( + eprosima::fastcdr::optional&& _ann_custom) + { + m_ann_custom = std::move(_ann_custom); + } + + /*! + * @brief This function returns a constant reference to member ann_custom + * @return Constant reference to member ann_custom + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& ann_custom() const + { + return m_ann_custom; + } + + /*! + * @brief This function returns a reference to member ann_custom + * @return Reference to member ann_custom + */ + eProsima_user_DllExport eprosima::fastcdr::optional& ann_custom() + { + return m_ann_custom; + } + + + /*! + * @brief This function copies the value in member type_name + * @param _type_name New value to be copied in member type_name + */ + eProsima_user_DllExport void type_name( + const QualifiedTypeName& _type_name) + { + m_type_name = _type_name; + } + + /*! + * @brief This function moves the value in member type_name + * @param _type_name New value to be moved in member type_name + */ + eProsima_user_DllExport void type_name( + QualifiedTypeName&& _type_name) + { + m_type_name = std::move(_type_name); + } + + /*! + * @brief This function returns a constant reference to member type_name + * @return Constant reference to member type_name + */ + eProsima_user_DllExport const QualifiedTypeName& type_name() const + { + return m_type_name; + } + + /*! + * @brief This function returns a reference to member type_name + * @return Reference to member type_name + */ + eProsima_user_DllExport QualifiedTypeName& type_name() + { + return m_type_name; + } + + + +private: + + eprosima::fastcdr::optional m_ann_builtin; + eprosima::fastcdr::optional m_ann_custom; + QualifiedTypeName m_type_name; + +}; +/*! + * @brief This class represents the structure CompleteStructHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteStructHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteStructHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteStructHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteStructHeader that will be copied. + */ + eProsima_user_DllExport CompleteStructHeader( + const CompleteStructHeader& x) + { + m_base_type = x.m_base_type; + + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteStructHeader that will be copied. + */ + eProsima_user_DllExport CompleteStructHeader( + CompleteStructHeader&& x) noexcept + { + m_base_type = std::move(x.m_base_type); + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteStructHeader that will be copied. + */ + eProsima_user_DllExport CompleteStructHeader& operator =( + const CompleteStructHeader& x) + { + + m_base_type = x.m_base_type; + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteStructHeader that will be copied. + */ + eProsima_user_DllExport CompleteStructHeader& operator =( + CompleteStructHeader&& x) noexcept + { + + m_base_type = std::move(x.m_base_type); + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteStructHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteStructHeader& x) const + { + return (m_base_type == x.m_base_type && + m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x CompleteStructHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteStructHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member base_type + * @param _base_type New value to be copied in member base_type + */ + eProsima_user_DllExport void base_type( + const TypeIdentifier& _base_type) + { + m_base_type = _base_type; + } + + /*! + * @brief This function moves the value in member base_type + * @param _base_type New value to be moved in member base_type + */ + eProsima_user_DllExport void base_type( + TypeIdentifier&& _base_type) + { + m_base_type = std::move(_base_type); + } + + /*! + * @brief This function returns a constant reference to member base_type + * @return Constant reference to member base_type + */ + eProsima_user_DllExport const TypeIdentifier& base_type() const + { + return m_base_type; + } + + /*! + * @brief This function returns a reference to member base_type + * @return Reference to member base_type + */ + eProsima_user_DllExport TypeIdentifier& base_type() + { + return m_base_type; + } + + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const CompleteTypeDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + CompleteTypeDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const CompleteTypeDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport CompleteTypeDetail& detail() + { + return m_detail; + } + + + +private: + + TypeIdentifier m_base_type; + CompleteTypeDetail m_detail; + +}; +/*! + * @brief This class represents the structure MinimalStructHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalStructHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalStructHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalStructHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalStructHeader that will be copied. + */ + eProsima_user_DllExport MinimalStructHeader( + const MinimalStructHeader& x) + { + m_base_type = x.m_base_type; + + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalStructHeader that will be copied. + */ + eProsima_user_DllExport MinimalStructHeader( + MinimalStructHeader&& x) noexcept + { + m_base_type = std::move(x.m_base_type); + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalStructHeader that will be copied. + */ + eProsima_user_DllExport MinimalStructHeader& operator =( + const MinimalStructHeader& x) + { + + m_base_type = x.m_base_type; + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalStructHeader that will be copied. + */ + eProsima_user_DllExport MinimalStructHeader& operator =( + MinimalStructHeader&& x) noexcept + { + + m_base_type = std::move(x.m_base_type); + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalStructHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalStructHeader& x) const + { + return (m_base_type == x.m_base_type && + m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x MinimalStructHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalStructHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member base_type + * @param _base_type New value to be copied in member base_type + */ + eProsima_user_DllExport void base_type( + const TypeIdentifier& _base_type) + { + m_base_type = _base_type; + } + + /*! + * @brief This function moves the value in member base_type + * @param _base_type New value to be moved in member base_type + */ + eProsima_user_DllExport void base_type( + TypeIdentifier&& _base_type) + { + m_base_type = std::move(_base_type); + } + + /*! + * @brief This function returns a constant reference to member base_type + * @return Constant reference to member base_type + */ + eProsima_user_DllExport const TypeIdentifier& base_type() const + { + return m_base_type; + } + + /*! + * @brief This function returns a reference to member base_type + * @return Reference to member base_type + */ + eProsima_user_DllExport TypeIdentifier& base_type() + { + return m_base_type; + } + + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const MinimalTypeDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + MinimalTypeDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const MinimalTypeDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport MinimalTypeDetail& detail() + { + return m_detail; + } + + + +private: + + TypeIdentifier m_base_type; + MinimalTypeDetail m_detail; + +}; +/*! + * @brief This class represents the structure CompleteStructType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteStructType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteStructType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteStructType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteStructType that will be copied. + */ + eProsima_user_DllExport CompleteStructType( + const CompleteStructType& x) + { + m_struct_flags = x.m_struct_flags; + + m_header = x.m_header; + + m_member_seq = x.m_member_seq; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteStructType that will be copied. + */ + eProsima_user_DllExport CompleteStructType( + CompleteStructType&& x) noexcept + { + m_struct_flags = std::move(x.m_struct_flags); + m_header = std::move(x.m_header); + m_member_seq = std::move(x.m_member_seq); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteStructType that will be copied. + */ + eProsima_user_DllExport CompleteStructType& operator =( + const CompleteStructType& x) + { + + m_struct_flags = x.m_struct_flags; + + m_header = x.m_header; + + m_member_seq = x.m_member_seq; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteStructType that will be copied. + */ + eProsima_user_DllExport CompleteStructType& operator =( + CompleteStructType&& x) noexcept + { + + m_struct_flags = std::move(x.m_struct_flags); + m_header = std::move(x.m_header); + m_member_seq = std::move(x.m_member_seq); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteStructType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteStructType& x) const + { + return (m_struct_flags == x.m_struct_flags && + m_header == x.m_header && + m_member_seq == x.m_member_seq); + } + + /*! + * @brief Comparison operator. + * @param x CompleteStructType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteStructType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member struct_flags + * @param _struct_flags New value to be copied in member struct_flags + */ + eProsima_user_DllExport void struct_flags( + const StructTypeFlag& _struct_flags) + { + m_struct_flags = _struct_flags; + } + + /*! + * @brief This function moves the value in member struct_flags + * @param _struct_flags New value to be moved in member struct_flags + */ + eProsima_user_DllExport void struct_flags( + StructTypeFlag&& _struct_flags) + { + m_struct_flags = std::move(_struct_flags); + } + + /*! + * @brief This function returns a constant reference to member struct_flags + * @return Constant reference to member struct_flags + */ + eProsima_user_DllExport const StructTypeFlag& struct_flags() const + { + return m_struct_flags; + } + + /*! + * @brief This function returns a reference to member struct_flags + * @return Reference to member struct_flags + */ + eProsima_user_DllExport StructTypeFlag& struct_flags() + { + return m_struct_flags; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const CompleteStructHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + CompleteStructHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const CompleteStructHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport CompleteStructHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member member_seq + * @param _member_seq New value to be copied in member member_seq + */ + eProsima_user_DllExport void member_seq( + const CompleteStructMemberSeq& _member_seq) + { + m_member_seq = _member_seq; + } + + /*! + * @brief This function moves the value in member member_seq + * @param _member_seq New value to be moved in member member_seq + */ + eProsima_user_DllExport void member_seq( + CompleteStructMemberSeq&& _member_seq) + { + m_member_seq = std::move(_member_seq); + } + + /*! + * @brief This function returns a constant reference to member member_seq + * @return Constant reference to member member_seq + */ + eProsima_user_DllExport const CompleteStructMemberSeq& member_seq() const + { + return m_member_seq; + } + + /*! + * @brief This function returns a reference to member member_seq + * @return Reference to member member_seq + */ + eProsima_user_DllExport CompleteStructMemberSeq& member_seq() + { + return m_member_seq; + } + + + +private: + + StructTypeFlag m_struct_flags{0}; + CompleteStructHeader m_header; + CompleteStructMemberSeq m_member_seq; + +}; +/*! + * @brief This class represents the structure MinimalStructType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalStructType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalStructType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalStructType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalStructType that will be copied. + */ + eProsima_user_DllExport MinimalStructType( + const MinimalStructType& x) + { + m_struct_flags = x.m_struct_flags; + + m_header = x.m_header; + + m_member_seq = x.m_member_seq; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalStructType that will be copied. + */ + eProsima_user_DllExport MinimalStructType( + MinimalStructType&& x) noexcept + { + m_struct_flags = std::move(x.m_struct_flags); + m_header = std::move(x.m_header); + m_member_seq = std::move(x.m_member_seq); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalStructType that will be copied. + */ + eProsima_user_DllExport MinimalStructType& operator =( + const MinimalStructType& x) + { + + m_struct_flags = x.m_struct_flags; + + m_header = x.m_header; + + m_member_seq = x.m_member_seq; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalStructType that will be copied. + */ + eProsima_user_DllExport MinimalStructType& operator =( + MinimalStructType&& x) noexcept + { + + m_struct_flags = std::move(x.m_struct_flags); + m_header = std::move(x.m_header); + m_member_seq = std::move(x.m_member_seq); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalStructType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalStructType& x) const + { + return (m_struct_flags == x.m_struct_flags && + m_header == x.m_header && + m_member_seq == x.m_member_seq); + } + + /*! + * @brief Comparison operator. + * @param x MinimalStructType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalStructType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member struct_flags + * @param _struct_flags New value to be copied in member struct_flags + */ + eProsima_user_DllExport void struct_flags( + const StructTypeFlag& _struct_flags) + { + m_struct_flags = _struct_flags; + } + + /*! + * @brief This function moves the value in member struct_flags + * @param _struct_flags New value to be moved in member struct_flags + */ + eProsima_user_DllExport void struct_flags( + StructTypeFlag&& _struct_flags) + { + m_struct_flags = std::move(_struct_flags); + } + + /*! + * @brief This function returns a constant reference to member struct_flags + * @return Constant reference to member struct_flags + */ + eProsima_user_DllExport const StructTypeFlag& struct_flags() const + { + return m_struct_flags; + } + + /*! + * @brief This function returns a reference to member struct_flags + * @return Reference to member struct_flags + */ + eProsima_user_DllExport StructTypeFlag& struct_flags() + { + return m_struct_flags; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const MinimalStructHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + MinimalStructHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const MinimalStructHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport MinimalStructHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member member_seq + * @param _member_seq New value to be copied in member member_seq + */ + eProsima_user_DllExport void member_seq( + const MinimalStructMemberSeq& _member_seq) + { + m_member_seq = _member_seq; + } + + /*! + * @brief This function moves the value in member member_seq + * @param _member_seq New value to be moved in member member_seq + */ + eProsima_user_DllExport void member_seq( + MinimalStructMemberSeq&& _member_seq) + { + m_member_seq = std::move(_member_seq); + } + + /*! + * @brief This function returns a constant reference to member member_seq + * @return Constant reference to member member_seq + */ + eProsima_user_DllExport const MinimalStructMemberSeq& member_seq() const + { + return m_member_seq; + } + + /*! + * @brief This function returns a reference to member member_seq + * @return Reference to member member_seq + */ + eProsima_user_DllExport MinimalStructMemberSeq& member_seq() + { + return m_member_seq; + } + + + +private: + + StructTypeFlag m_struct_flags{0}; + MinimalStructHeader m_header; + MinimalStructMemberSeq m_member_seq; + +}; +typedef std::vector UnionCaseLabelSeq; + +/*! + * @brief This class represents the structure CommonUnionMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonUnionMember +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CommonUnionMember() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CommonUnionMember() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CommonUnionMember that will be copied. + */ + eProsima_user_DllExport CommonUnionMember( + const CommonUnionMember& x) + { + m_member_id = x.m_member_id; + + m_member_flags = x.m_member_flags; + + m_type_id = x.m_type_id; + + m_label_seq = x.m_label_seq; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CommonUnionMember that will be copied. + */ + eProsima_user_DllExport CommonUnionMember( + CommonUnionMember&& x) noexcept + { + m_member_id = x.m_member_id; + m_member_flags = std::move(x.m_member_flags); + m_type_id = std::move(x.m_type_id); + m_label_seq = std::move(x.m_label_seq); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CommonUnionMember that will be copied. + */ + eProsima_user_DllExport CommonUnionMember& operator =( + const CommonUnionMember& x) + { + + m_member_id = x.m_member_id; + + m_member_flags = x.m_member_flags; + + m_type_id = x.m_type_id; + + m_label_seq = x.m_label_seq; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CommonUnionMember that will be copied. + */ + eProsima_user_DllExport CommonUnionMember& operator =( + CommonUnionMember&& x) noexcept + { + + m_member_id = x.m_member_id; + m_member_flags = std::move(x.m_member_flags); + m_type_id = std::move(x.m_type_id); + m_label_seq = std::move(x.m_label_seq); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CommonUnionMember object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CommonUnionMember& x) const + { + return (m_member_id == x.m_member_id && + m_member_flags == x.m_member_flags && + m_type_id == x.m_type_id && + m_label_seq == x.m_label_seq); + } + + /*! + * @brief Comparison operator. + * @param x CommonUnionMember object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CommonUnionMember& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member member_id + * @param _member_id New value for member member_id + */ + eProsima_user_DllExport void member_id( + MemberId _member_id) + { + m_member_id = _member_id; + } + + /*! + * @brief This function returns the value of member member_id + * @return Value of member member_id + */ + eProsima_user_DllExport MemberId member_id() const + { + return m_member_id; + } + + /*! + * @brief This function returns a reference to member member_id + * @return Reference to member member_id + */ + eProsima_user_DllExport MemberId& member_id() + { + return m_member_id; + } + + + /*! + * @brief This function copies the value in member member_flags + * @param _member_flags New value to be copied in member member_flags + */ + eProsima_user_DllExport void member_flags( + const UnionMemberFlag& _member_flags) + { + m_member_flags = _member_flags; + } + + /*! + * @brief This function moves the value in member member_flags + * @param _member_flags New value to be moved in member member_flags + */ + eProsima_user_DllExport void member_flags( + UnionMemberFlag&& _member_flags) + { + m_member_flags = std::move(_member_flags); + } + + /*! + * @brief This function returns a constant reference to member member_flags + * @return Constant reference to member member_flags + */ + eProsima_user_DllExport const UnionMemberFlag& member_flags() const + { + return m_member_flags; + } + + /*! + * @brief This function returns a reference to member member_flags + * @return Reference to member member_flags + */ + eProsima_user_DllExport UnionMemberFlag& member_flags() + { + return m_member_flags; + } + + + /*! + * @brief This function copies the value in member type_id + * @param _type_id New value to be copied in member type_id + */ + eProsima_user_DllExport void type_id( + const TypeIdentifier& _type_id) + { + m_type_id = _type_id; + } + + /*! + * @brief This function moves the value in member type_id + * @param _type_id New value to be moved in member type_id + */ + eProsima_user_DllExport void type_id( + TypeIdentifier&& _type_id) + { + m_type_id = std::move(_type_id); + } + + /*! + * @brief This function returns a constant reference to member type_id + * @return Constant reference to member type_id + */ + eProsima_user_DllExport const TypeIdentifier& type_id() const + { + return m_type_id; + } + + /*! + * @brief This function returns a reference to member type_id + * @return Reference to member type_id + */ + eProsima_user_DllExport TypeIdentifier& type_id() + { + return m_type_id; + } + + + /*! + * @brief This function copies the value in member label_seq + * @param _label_seq New value to be copied in member label_seq + */ + eProsima_user_DllExport void label_seq( + const UnionCaseLabelSeq& _label_seq) + { + m_label_seq = _label_seq; + } + + /*! + * @brief This function moves the value in member label_seq + * @param _label_seq New value to be moved in member label_seq + */ + eProsima_user_DllExport void label_seq( + UnionCaseLabelSeq&& _label_seq) + { + m_label_seq = std::move(_label_seq); + } + + /*! + * @brief This function returns a constant reference to member label_seq + * @return Constant reference to member label_seq + */ + eProsima_user_DllExport const UnionCaseLabelSeq& label_seq() const + { + return m_label_seq; + } + + /*! + * @brief This function returns a reference to member label_seq + * @return Reference to member label_seq + */ + eProsima_user_DllExport UnionCaseLabelSeq& label_seq() + { + return m_label_seq; + } + + + +private: + + MemberId m_member_id{0}; + UnionMemberFlag m_member_flags{0}; + TypeIdentifier m_type_id; + UnionCaseLabelSeq m_label_seq; + +}; +/*! + * @brief This class represents the structure CompleteUnionMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteUnionMember +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteUnionMember() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteUnionMember() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteUnionMember that will be copied. + */ + eProsima_user_DllExport CompleteUnionMember( + const CompleteUnionMember& x) + { + m_common = x.m_common; + + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteUnionMember that will be copied. + */ + eProsima_user_DllExport CompleteUnionMember( + CompleteUnionMember&& x) noexcept + { + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteUnionMember that will be copied. + */ + eProsima_user_DllExport CompleteUnionMember& operator =( + const CompleteUnionMember& x) + { + + m_common = x.m_common; + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteUnionMember that will be copied. + */ + eProsima_user_DllExport CompleteUnionMember& operator =( + CompleteUnionMember&& x) noexcept + { + + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteUnionMember object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteUnionMember& x) const + { + return (m_common == x.m_common && + m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x CompleteUnionMember object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteUnionMember& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonUnionMember& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonUnionMember&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonUnionMember& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonUnionMember& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const CompleteMemberDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + CompleteMemberDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const CompleteMemberDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport CompleteMemberDetail& detail() + { + return m_detail; + } + + + +private: + + CommonUnionMember m_common; + CompleteMemberDetail m_detail; + +}; +typedef std::vector CompleteUnionMemberSeq; + +/*! + * @brief This class represents the structure MinimalUnionMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalUnionMember +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalUnionMember() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalUnionMember() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalUnionMember that will be copied. + */ + eProsima_user_DllExport MinimalUnionMember( + const MinimalUnionMember& x) + { + m_common = x.m_common; + + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalUnionMember that will be copied. + */ + eProsima_user_DllExport MinimalUnionMember( + MinimalUnionMember&& x) noexcept + { + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalUnionMember that will be copied. + */ + eProsima_user_DllExport MinimalUnionMember& operator =( + const MinimalUnionMember& x) + { + + m_common = x.m_common; + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalUnionMember that will be copied. + */ + eProsima_user_DllExport MinimalUnionMember& operator =( + MinimalUnionMember&& x) noexcept + { + + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalUnionMember object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalUnionMember& x) const + { + return (m_common == x.m_common && + m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x MinimalUnionMember object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalUnionMember& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonUnionMember& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonUnionMember&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonUnionMember& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonUnionMember& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const MinimalMemberDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + MinimalMemberDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const MinimalMemberDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport MinimalMemberDetail& detail() + { + return m_detail; + } + + + +private: + + CommonUnionMember m_common; + MinimalMemberDetail m_detail; + +}; +typedef std::vector MinimalUnionMemberSeq; + +/*! + * @brief This class represents the structure CommonDiscriminatorMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonDiscriminatorMember +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CommonDiscriminatorMember() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CommonDiscriminatorMember() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CommonDiscriminatorMember that will be copied. + */ + eProsima_user_DllExport CommonDiscriminatorMember( + const CommonDiscriminatorMember& x) + { + m_member_flags = x.m_member_flags; + + m_type_id = x.m_type_id; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CommonDiscriminatorMember that will be copied. + */ + eProsima_user_DllExport CommonDiscriminatorMember( + CommonDiscriminatorMember&& x) noexcept + { + m_member_flags = std::move(x.m_member_flags); + m_type_id = std::move(x.m_type_id); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CommonDiscriminatorMember that will be copied. + */ + eProsima_user_DllExport CommonDiscriminatorMember& operator =( + const CommonDiscriminatorMember& x) + { + + m_member_flags = x.m_member_flags; + + m_type_id = x.m_type_id; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CommonDiscriminatorMember that will be copied. + */ + eProsima_user_DllExport CommonDiscriminatorMember& operator =( + CommonDiscriminatorMember&& x) noexcept + { + + m_member_flags = std::move(x.m_member_flags); + m_type_id = std::move(x.m_type_id); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CommonDiscriminatorMember object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CommonDiscriminatorMember& x) const + { + return (m_member_flags == x.m_member_flags && + m_type_id == x.m_type_id); + } + + /*! + * @brief Comparison operator. + * @param x CommonDiscriminatorMember object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CommonDiscriminatorMember& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member member_flags + * @param _member_flags New value to be copied in member member_flags + */ + eProsima_user_DllExport void member_flags( + const UnionDiscriminatorFlag& _member_flags) + { + m_member_flags = _member_flags; + } + + /*! + * @brief This function moves the value in member member_flags + * @param _member_flags New value to be moved in member member_flags + */ + eProsima_user_DllExport void member_flags( + UnionDiscriminatorFlag&& _member_flags) + { + m_member_flags = std::move(_member_flags); + } + + /*! + * @brief This function returns a constant reference to member member_flags + * @return Constant reference to member member_flags + */ + eProsima_user_DllExport const UnionDiscriminatorFlag& member_flags() const + { + return m_member_flags; + } + + /*! + * @brief This function returns a reference to member member_flags + * @return Reference to member member_flags + */ + eProsima_user_DllExport UnionDiscriminatorFlag& member_flags() + { + return m_member_flags; + } + + + /*! + * @brief This function copies the value in member type_id + * @param _type_id New value to be copied in member type_id + */ + eProsima_user_DllExport void type_id( + const TypeIdentifier& _type_id) + { + m_type_id = _type_id; + } + + /*! + * @brief This function moves the value in member type_id + * @param _type_id New value to be moved in member type_id + */ + eProsima_user_DllExport void type_id( + TypeIdentifier&& _type_id) + { + m_type_id = std::move(_type_id); + } + + /*! + * @brief This function returns a constant reference to member type_id + * @return Constant reference to member type_id + */ + eProsima_user_DllExport const TypeIdentifier& type_id() const + { + return m_type_id; + } + + /*! + * @brief This function returns a reference to member type_id + * @return Reference to member type_id + */ + eProsima_user_DllExport TypeIdentifier& type_id() + { + return m_type_id; + } + + + +private: + + UnionDiscriminatorFlag m_member_flags{0}; + TypeIdentifier m_type_id; + +}; +/*! + * @brief This class represents the structure CompleteDiscriminatorMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteDiscriminatorMember +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteDiscriminatorMember() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteDiscriminatorMember() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteDiscriminatorMember that will be copied. + */ + eProsima_user_DllExport CompleteDiscriminatorMember( + const CompleteDiscriminatorMember& x) + { + m_common = x.m_common; + + m_ann_builtin = x.m_ann_builtin; + + m_ann_custom = x.m_ann_custom; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteDiscriminatorMember that will be copied. + */ + eProsima_user_DllExport CompleteDiscriminatorMember( + CompleteDiscriminatorMember&& x) noexcept + { + m_common = std::move(x.m_common); + m_ann_builtin = std::move(x.m_ann_builtin); + m_ann_custom = std::move(x.m_ann_custom); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteDiscriminatorMember that will be copied. + */ + eProsima_user_DllExport CompleteDiscriminatorMember& operator =( + const CompleteDiscriminatorMember& x) + { + + m_common = x.m_common; + + m_ann_builtin = x.m_ann_builtin; + + m_ann_custom = x.m_ann_custom; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteDiscriminatorMember that will be copied. + */ + eProsima_user_DllExport CompleteDiscriminatorMember& operator =( + CompleteDiscriminatorMember&& x) noexcept + { + + m_common = std::move(x.m_common); + m_ann_builtin = std::move(x.m_ann_builtin); + m_ann_custom = std::move(x.m_ann_custom); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteDiscriminatorMember object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteDiscriminatorMember& x) const + { + return (m_common == x.m_common && + m_ann_builtin == x.m_ann_builtin && + m_ann_custom == x.m_ann_custom); + } + + /*! + * @brief Comparison operator. + * @param x CompleteDiscriminatorMember object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteDiscriminatorMember& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonDiscriminatorMember& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonDiscriminatorMember&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonDiscriminatorMember& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonDiscriminatorMember& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member ann_builtin + * @param _ann_builtin New value to be copied in member ann_builtin + */ + eProsima_user_DllExport void ann_builtin( + const eprosima::fastcdr::optional& _ann_builtin) + { + m_ann_builtin = _ann_builtin; + } + + /*! + * @brief This function moves the value in member ann_builtin + * @param _ann_builtin New value to be moved in member ann_builtin + */ + eProsima_user_DllExport void ann_builtin( + eprosima::fastcdr::optional&& _ann_builtin) + { + m_ann_builtin = std::move(_ann_builtin); + } + + /*! + * @brief This function returns a constant reference to member ann_builtin + * @return Constant reference to member ann_builtin + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& ann_builtin() const + { + return m_ann_builtin; + } + + /*! + * @brief This function returns a reference to member ann_builtin + * @return Reference to member ann_builtin + */ + eProsima_user_DllExport eprosima::fastcdr::optional& ann_builtin() + { + return m_ann_builtin; + } + + + /*! + * @brief This function copies the value in member ann_custom + * @param _ann_custom New value to be copied in member ann_custom + */ + eProsima_user_DllExport void ann_custom( + const eprosima::fastcdr::optional& _ann_custom) + { + m_ann_custom = _ann_custom; + } + + /*! + * @brief This function moves the value in member ann_custom + * @param _ann_custom New value to be moved in member ann_custom + */ + eProsima_user_DllExport void ann_custom( + eprosima::fastcdr::optional&& _ann_custom) + { + m_ann_custom = std::move(_ann_custom); + } + + /*! + * @brief This function returns a constant reference to member ann_custom + * @return Constant reference to member ann_custom + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& ann_custom() const + { + return m_ann_custom; + } + + /*! + * @brief This function returns a reference to member ann_custom + * @return Reference to member ann_custom + */ + eProsima_user_DllExport eprosima::fastcdr::optional& ann_custom() + { + return m_ann_custom; + } + + + +private: + + CommonDiscriminatorMember m_common; + eprosima::fastcdr::optional m_ann_builtin; + eprosima::fastcdr::optional m_ann_custom; + +}; +/*! + * @brief This class represents the structure MinimalDiscriminatorMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalDiscriminatorMember +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalDiscriminatorMember() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalDiscriminatorMember() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalDiscriminatorMember that will be copied. + */ + eProsima_user_DllExport MinimalDiscriminatorMember( + const MinimalDiscriminatorMember& x) + { + m_common = x.m_common; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalDiscriminatorMember that will be copied. + */ + eProsima_user_DllExport MinimalDiscriminatorMember( + MinimalDiscriminatorMember&& x) noexcept + { + m_common = std::move(x.m_common); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalDiscriminatorMember that will be copied. + */ + eProsima_user_DllExport MinimalDiscriminatorMember& operator =( + const MinimalDiscriminatorMember& x) + { + + m_common = x.m_common; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalDiscriminatorMember that will be copied. + */ + eProsima_user_DllExport MinimalDiscriminatorMember& operator =( + MinimalDiscriminatorMember&& x) noexcept + { + + m_common = std::move(x.m_common); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalDiscriminatorMember object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalDiscriminatorMember& x) const + { + return (m_common == x.m_common); + } + + /*! + * @brief Comparison operator. + * @param x MinimalDiscriminatorMember object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalDiscriminatorMember& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonDiscriminatorMember& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonDiscriminatorMember&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonDiscriminatorMember& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonDiscriminatorMember& common() + { + return m_common; + } + + + +private: + + CommonDiscriminatorMember m_common; + +}; +/*! + * @brief This class represents the structure CompleteUnionHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteUnionHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteUnionHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteUnionHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteUnionHeader that will be copied. + */ + eProsima_user_DllExport CompleteUnionHeader( + const CompleteUnionHeader& x) + { + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteUnionHeader that will be copied. + */ + eProsima_user_DllExport CompleteUnionHeader( + CompleteUnionHeader&& x) noexcept + { + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteUnionHeader that will be copied. + */ + eProsima_user_DllExport CompleteUnionHeader& operator =( + const CompleteUnionHeader& x) + { + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteUnionHeader that will be copied. + */ + eProsima_user_DllExport CompleteUnionHeader& operator =( + CompleteUnionHeader&& x) noexcept + { + + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteUnionHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteUnionHeader& x) const + { + return (m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x CompleteUnionHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteUnionHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const CompleteTypeDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + CompleteTypeDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const CompleteTypeDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport CompleteTypeDetail& detail() + { + return m_detail; + } + + + +private: + + CompleteTypeDetail m_detail; + +}; +/*! + * @brief This class represents the structure MinimalUnionHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalUnionHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalUnionHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalUnionHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalUnionHeader that will be copied. + */ + eProsima_user_DllExport MinimalUnionHeader( + const MinimalUnionHeader& x) + { + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalUnionHeader that will be copied. + */ + eProsima_user_DllExport MinimalUnionHeader( + MinimalUnionHeader&& x) noexcept + { + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalUnionHeader that will be copied. + */ + eProsima_user_DllExport MinimalUnionHeader& operator =( + const MinimalUnionHeader& x) + { + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalUnionHeader that will be copied. + */ + eProsima_user_DllExport MinimalUnionHeader& operator =( + MinimalUnionHeader&& x) noexcept + { + + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalUnionHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalUnionHeader& x) const + { + return (m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x MinimalUnionHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalUnionHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const MinimalTypeDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + MinimalTypeDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const MinimalTypeDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport MinimalTypeDetail& detail() + { + return m_detail; + } + + + +private: + + MinimalTypeDetail m_detail; + +}; +/*! + * @brief This class represents the structure CompleteUnionType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteUnionType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteUnionType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteUnionType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteUnionType that will be copied. + */ + eProsima_user_DllExport CompleteUnionType( + const CompleteUnionType& x) + { + m_union_flags = x.m_union_flags; + + m_header = x.m_header; + + m_discriminator = x.m_discriminator; + + m_member_seq = x.m_member_seq; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteUnionType that will be copied. + */ + eProsima_user_DllExport CompleteUnionType( + CompleteUnionType&& x) noexcept + { + m_union_flags = std::move(x.m_union_flags); + m_header = std::move(x.m_header); + m_discriminator = std::move(x.m_discriminator); + m_member_seq = std::move(x.m_member_seq); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteUnionType that will be copied. + */ + eProsima_user_DllExport CompleteUnionType& operator =( + const CompleteUnionType& x) + { + + m_union_flags = x.m_union_flags; + + m_header = x.m_header; + + m_discriminator = x.m_discriminator; + + m_member_seq = x.m_member_seq; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteUnionType that will be copied. + */ + eProsima_user_DllExport CompleteUnionType& operator =( + CompleteUnionType&& x) noexcept + { + + m_union_flags = std::move(x.m_union_flags); + m_header = std::move(x.m_header); + m_discriminator = std::move(x.m_discriminator); + m_member_seq = std::move(x.m_member_seq); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteUnionType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteUnionType& x) const + { + return (m_union_flags == x.m_union_flags && + m_header == x.m_header && + m_discriminator == x.m_discriminator && + m_member_seq == x.m_member_seq); + } + + /*! + * @brief Comparison operator. + * @param x CompleteUnionType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteUnionType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member union_flags + * @param _union_flags New value to be copied in member union_flags + */ + eProsima_user_DllExport void union_flags( + const UnionTypeFlag& _union_flags) + { + m_union_flags = _union_flags; + } + + /*! + * @brief This function moves the value in member union_flags + * @param _union_flags New value to be moved in member union_flags + */ + eProsima_user_DllExport void union_flags( + UnionTypeFlag&& _union_flags) + { + m_union_flags = std::move(_union_flags); + } + + /*! + * @brief This function returns a constant reference to member union_flags + * @return Constant reference to member union_flags + */ + eProsima_user_DllExport const UnionTypeFlag& union_flags() const + { + return m_union_flags; + } + + /*! + * @brief This function returns a reference to member union_flags + * @return Reference to member union_flags + */ + eProsima_user_DllExport UnionTypeFlag& union_flags() + { + return m_union_flags; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const CompleteUnionHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + CompleteUnionHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const CompleteUnionHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport CompleteUnionHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member discriminator + * @param _discriminator New value to be copied in member discriminator + */ + eProsima_user_DllExport void discriminator( + const CompleteDiscriminatorMember& _discriminator) + { + m_discriminator = _discriminator; + } + + /*! + * @brief This function moves the value in member discriminator + * @param _discriminator New value to be moved in member discriminator + */ + eProsima_user_DllExport void discriminator( + CompleteDiscriminatorMember&& _discriminator) + { + m_discriminator = std::move(_discriminator); + } + + /*! + * @brief This function returns a constant reference to member discriminator + * @return Constant reference to member discriminator + */ + eProsima_user_DllExport const CompleteDiscriminatorMember& discriminator() const + { + return m_discriminator; + } + + /*! + * @brief This function returns a reference to member discriminator + * @return Reference to member discriminator + */ + eProsima_user_DllExport CompleteDiscriminatorMember& discriminator() + { + return m_discriminator; + } + + + /*! + * @brief This function copies the value in member member_seq + * @param _member_seq New value to be copied in member member_seq + */ + eProsima_user_DllExport void member_seq( + const CompleteUnionMemberSeq& _member_seq) + { + m_member_seq = _member_seq; + } + + /*! + * @brief This function moves the value in member member_seq + * @param _member_seq New value to be moved in member member_seq + */ + eProsima_user_DllExport void member_seq( + CompleteUnionMemberSeq&& _member_seq) + { + m_member_seq = std::move(_member_seq); + } + + /*! + * @brief This function returns a constant reference to member member_seq + * @return Constant reference to member member_seq + */ + eProsima_user_DllExport const CompleteUnionMemberSeq& member_seq() const + { + return m_member_seq; + } + + /*! + * @brief This function returns a reference to member member_seq + * @return Reference to member member_seq + */ + eProsima_user_DllExport CompleteUnionMemberSeq& member_seq() + { + return m_member_seq; + } + + + +private: + + UnionTypeFlag m_union_flags{0}; + CompleteUnionHeader m_header; + CompleteDiscriminatorMember m_discriminator; + CompleteUnionMemberSeq m_member_seq; + +}; +/*! + * @brief This class represents the structure MinimalUnionType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalUnionType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalUnionType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalUnionType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalUnionType that will be copied. + */ + eProsima_user_DllExport MinimalUnionType( + const MinimalUnionType& x) + { + m_union_flags = x.m_union_flags; + + m_header = x.m_header; + + m_discriminator = x.m_discriminator; + + m_member_seq = x.m_member_seq; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalUnionType that will be copied. + */ + eProsima_user_DllExport MinimalUnionType( + MinimalUnionType&& x) noexcept + { + m_union_flags = std::move(x.m_union_flags); + m_header = std::move(x.m_header); + m_discriminator = std::move(x.m_discriminator); + m_member_seq = std::move(x.m_member_seq); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalUnionType that will be copied. + */ + eProsima_user_DllExport MinimalUnionType& operator =( + const MinimalUnionType& x) + { + + m_union_flags = x.m_union_flags; + + m_header = x.m_header; + + m_discriminator = x.m_discriminator; + + m_member_seq = x.m_member_seq; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalUnionType that will be copied. + */ + eProsima_user_DllExport MinimalUnionType& operator =( + MinimalUnionType&& x) noexcept + { + + m_union_flags = std::move(x.m_union_flags); + m_header = std::move(x.m_header); + m_discriminator = std::move(x.m_discriminator); + m_member_seq = std::move(x.m_member_seq); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalUnionType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalUnionType& x) const + { + return (m_union_flags == x.m_union_flags && + m_header == x.m_header && + m_discriminator == x.m_discriminator && + m_member_seq == x.m_member_seq); + } + + /*! + * @brief Comparison operator. + * @param x MinimalUnionType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalUnionType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member union_flags + * @param _union_flags New value to be copied in member union_flags + */ + eProsima_user_DllExport void union_flags( + const UnionTypeFlag& _union_flags) + { + m_union_flags = _union_flags; + } + + /*! + * @brief This function moves the value in member union_flags + * @param _union_flags New value to be moved in member union_flags + */ + eProsima_user_DllExport void union_flags( + UnionTypeFlag&& _union_flags) + { + m_union_flags = std::move(_union_flags); + } + + /*! + * @brief This function returns a constant reference to member union_flags + * @return Constant reference to member union_flags + */ + eProsima_user_DllExport const UnionTypeFlag& union_flags() const + { + return m_union_flags; + } + + /*! + * @brief This function returns a reference to member union_flags + * @return Reference to member union_flags + */ + eProsima_user_DllExport UnionTypeFlag& union_flags() + { + return m_union_flags; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const MinimalUnionHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + MinimalUnionHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const MinimalUnionHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport MinimalUnionHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member discriminator + * @param _discriminator New value to be copied in member discriminator + */ + eProsima_user_DllExport void discriminator( + const MinimalDiscriminatorMember& _discriminator) + { + m_discriminator = _discriminator; + } + + /*! + * @brief This function moves the value in member discriminator + * @param _discriminator New value to be moved in member discriminator + */ + eProsima_user_DllExport void discriminator( + MinimalDiscriminatorMember&& _discriminator) + { + m_discriminator = std::move(_discriminator); + } + + /*! + * @brief This function returns a constant reference to member discriminator + * @return Constant reference to member discriminator + */ + eProsima_user_DllExport const MinimalDiscriminatorMember& discriminator() const + { + return m_discriminator; + } + + /*! + * @brief This function returns a reference to member discriminator + * @return Reference to member discriminator + */ + eProsima_user_DllExport MinimalDiscriminatorMember& discriminator() + { + return m_discriminator; + } + + + /*! + * @brief This function copies the value in member member_seq + * @param _member_seq New value to be copied in member member_seq + */ + eProsima_user_DllExport void member_seq( + const MinimalUnionMemberSeq& _member_seq) + { + m_member_seq = _member_seq; + } + + /*! + * @brief This function moves the value in member member_seq + * @param _member_seq New value to be moved in member member_seq + */ + eProsima_user_DllExport void member_seq( + MinimalUnionMemberSeq&& _member_seq) + { + m_member_seq = std::move(_member_seq); + } + + /*! + * @brief This function returns a constant reference to member member_seq + * @return Constant reference to member member_seq + */ + eProsima_user_DllExport const MinimalUnionMemberSeq& member_seq() const + { + return m_member_seq; + } + + /*! + * @brief This function returns a reference to member member_seq + * @return Reference to member member_seq + */ + eProsima_user_DllExport MinimalUnionMemberSeq& member_seq() + { + return m_member_seq; + } + + + +private: + + UnionTypeFlag m_union_flags{0}; + MinimalUnionHeader m_header; + MinimalDiscriminatorMember m_discriminator; + MinimalUnionMemberSeq m_member_seq; + +}; +/*! + * @brief This class represents the structure CommonAnnotationParameter defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonAnnotationParameter +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CommonAnnotationParameter() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CommonAnnotationParameter() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CommonAnnotationParameter that will be copied. + */ + eProsima_user_DllExport CommonAnnotationParameter( + const CommonAnnotationParameter& x) + { + m_member_flags = x.m_member_flags; + + m_member_type_id = x.m_member_type_id; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CommonAnnotationParameter that will be copied. + */ + eProsima_user_DllExport CommonAnnotationParameter( + CommonAnnotationParameter&& x) noexcept + { + m_member_flags = std::move(x.m_member_flags); + m_member_type_id = std::move(x.m_member_type_id); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CommonAnnotationParameter that will be copied. + */ + eProsima_user_DllExport CommonAnnotationParameter& operator =( + const CommonAnnotationParameter& x) + { + + m_member_flags = x.m_member_flags; + + m_member_type_id = x.m_member_type_id; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CommonAnnotationParameter that will be copied. + */ + eProsima_user_DllExport CommonAnnotationParameter& operator =( + CommonAnnotationParameter&& x) noexcept + { + + m_member_flags = std::move(x.m_member_flags); + m_member_type_id = std::move(x.m_member_type_id); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CommonAnnotationParameter object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CommonAnnotationParameter& x) const + { + return (m_member_flags == x.m_member_flags && + m_member_type_id == x.m_member_type_id); + } + + /*! + * @brief Comparison operator. + * @param x CommonAnnotationParameter object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CommonAnnotationParameter& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member member_flags + * @param _member_flags New value to be copied in member member_flags + */ + eProsima_user_DllExport void member_flags( + const AnnotationParameterFlag& _member_flags) + { + m_member_flags = _member_flags; + } + + /*! + * @brief This function moves the value in member member_flags + * @param _member_flags New value to be moved in member member_flags + */ + eProsima_user_DllExport void member_flags( + AnnotationParameterFlag&& _member_flags) + { + m_member_flags = std::move(_member_flags); + } + + /*! + * @brief This function returns a constant reference to member member_flags + * @return Constant reference to member member_flags + */ + eProsima_user_DllExport const AnnotationParameterFlag& member_flags() const + { + return m_member_flags; + } + + /*! + * @brief This function returns a reference to member member_flags + * @return Reference to member member_flags + */ + eProsima_user_DllExport AnnotationParameterFlag& member_flags() + { + return m_member_flags; + } + + + /*! + * @brief This function copies the value in member member_type_id + * @param _member_type_id New value to be copied in member member_type_id + */ + eProsima_user_DllExport void member_type_id( + const TypeIdentifier& _member_type_id) + { + m_member_type_id = _member_type_id; + } + + /*! + * @brief This function moves the value in member member_type_id + * @param _member_type_id New value to be moved in member member_type_id + */ + eProsima_user_DllExport void member_type_id( + TypeIdentifier&& _member_type_id) + { + m_member_type_id = std::move(_member_type_id); + } + + /*! + * @brief This function returns a constant reference to member member_type_id + * @return Constant reference to member member_type_id + */ + eProsima_user_DllExport const TypeIdentifier& member_type_id() const + { + return m_member_type_id; + } + + /*! + * @brief This function returns a reference to member member_type_id + * @return Reference to member member_type_id + */ + eProsima_user_DllExport TypeIdentifier& member_type_id() + { + return m_member_type_id; + } + + + +private: + + AnnotationParameterFlag m_member_flags{0}; + TypeIdentifier m_member_type_id; + +}; +/*! + * @brief This class represents the structure CompleteAnnotationParameter defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteAnnotationParameter +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteAnnotationParameter() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteAnnotationParameter() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteAnnotationParameter that will be copied. + */ + eProsima_user_DllExport CompleteAnnotationParameter( + const CompleteAnnotationParameter& x) + { + m_common = x.m_common; + + m_name = x.m_name; + + m_default_value = x.m_default_value; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteAnnotationParameter that will be copied. + */ + eProsima_user_DllExport CompleteAnnotationParameter( + CompleteAnnotationParameter&& x) noexcept + { + m_common = std::move(x.m_common); + m_name = std::move(x.m_name); + m_default_value = std::move(x.m_default_value); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteAnnotationParameter that will be copied. + */ + eProsima_user_DllExport CompleteAnnotationParameter& operator =( + const CompleteAnnotationParameter& x) + { + + m_common = x.m_common; + + m_name = x.m_name; + + m_default_value = x.m_default_value; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteAnnotationParameter that will be copied. + */ + eProsima_user_DllExport CompleteAnnotationParameter& operator =( + CompleteAnnotationParameter&& x) noexcept + { + + m_common = std::move(x.m_common); + m_name = std::move(x.m_name); + m_default_value = std::move(x.m_default_value); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteAnnotationParameter object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteAnnotationParameter& x) const + { + return (m_common == x.m_common && + m_name == x.m_name && + m_default_value == x.m_default_value); + } + + /*! + * @brief Comparison operator. + * @param x CompleteAnnotationParameter object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteAnnotationParameter& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonAnnotationParameter& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonAnnotationParameter&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonAnnotationParameter& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonAnnotationParameter& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member name + * @param _name New value to be copied in member name + */ + eProsima_user_DllExport void name( + const MemberName& _name) + { + m_name = _name; + } + + /*! + * @brief This function moves the value in member name + * @param _name New value to be moved in member name + */ + eProsima_user_DllExport void name( + MemberName&& _name) + { + m_name = std::move(_name); + } + + /*! + * @brief This function returns a constant reference to member name + * @return Constant reference to member name + */ + eProsima_user_DllExport const MemberName& name() const + { + return m_name; + } + + /*! + * @brief This function returns a reference to member name + * @return Reference to member name + */ + eProsima_user_DllExport MemberName& name() + { + return m_name; + } + + + /*! + * @brief This function copies the value in member default_value + * @param _default_value New value to be copied in member default_value + */ + eProsima_user_DllExport void default_value( + const AnnotationParameterValue& _default_value) + { + m_default_value = _default_value; + } + + /*! + * @brief This function moves the value in member default_value + * @param _default_value New value to be moved in member default_value + */ + eProsima_user_DllExport void default_value( + AnnotationParameterValue&& _default_value) + { + m_default_value = std::move(_default_value); + } + + /*! + * @brief This function returns a constant reference to member default_value + * @return Constant reference to member default_value + */ + eProsima_user_DllExport const AnnotationParameterValue& default_value() const + { + return m_default_value; + } + + /*! + * @brief This function returns a reference to member default_value + * @return Reference to member default_value + */ + eProsima_user_DllExport AnnotationParameterValue& default_value() + { + return m_default_value; + } + + + +private: + + CommonAnnotationParameter m_common; + MemberName m_name; + AnnotationParameterValue m_default_value; + +}; +typedef std::vector CompleteAnnotationParameterSeq; + +/*! + * @brief This class represents the structure MinimalAnnotationParameter defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalAnnotationParameter +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalAnnotationParameter() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalAnnotationParameter() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalAnnotationParameter that will be copied. + */ + eProsima_user_DllExport MinimalAnnotationParameter( + const MinimalAnnotationParameter& x) + { + m_common = x.m_common; + + m_name_hash = x.m_name_hash; + + m_default_value = x.m_default_value; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalAnnotationParameter that will be copied. + */ + eProsima_user_DllExport MinimalAnnotationParameter( + MinimalAnnotationParameter&& x) noexcept + { + m_common = std::move(x.m_common); + m_name_hash = std::move(x.m_name_hash); + m_default_value = std::move(x.m_default_value); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalAnnotationParameter that will be copied. + */ + eProsima_user_DllExport MinimalAnnotationParameter& operator =( + const MinimalAnnotationParameter& x) + { + + m_common = x.m_common; + + m_name_hash = x.m_name_hash; + + m_default_value = x.m_default_value; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalAnnotationParameter that will be copied. + */ + eProsima_user_DllExport MinimalAnnotationParameter& operator =( + MinimalAnnotationParameter&& x) noexcept + { + + m_common = std::move(x.m_common); + m_name_hash = std::move(x.m_name_hash); + m_default_value = std::move(x.m_default_value); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalAnnotationParameter object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalAnnotationParameter& x) const + { + return (m_common == x.m_common && + m_name_hash == x.m_name_hash && + m_default_value == x.m_default_value); + } + + /*! + * @brief Comparison operator. + * @param x MinimalAnnotationParameter object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalAnnotationParameter& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonAnnotationParameter& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonAnnotationParameter&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonAnnotationParameter& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonAnnotationParameter& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member name_hash + * @param _name_hash New value to be copied in member name_hash + */ + eProsima_user_DllExport void name_hash( + const NameHash& _name_hash) + { + m_name_hash = _name_hash; + } + + /*! + * @brief This function moves the value in member name_hash + * @param _name_hash New value to be moved in member name_hash + */ + eProsima_user_DllExport void name_hash( + NameHash&& _name_hash) + { + m_name_hash = std::move(_name_hash); + } + + /*! + * @brief This function returns a constant reference to member name_hash + * @return Constant reference to member name_hash + */ + eProsima_user_DllExport const NameHash& name_hash() const + { + return m_name_hash; + } + + /*! + * @brief This function returns a reference to member name_hash + * @return Reference to member name_hash + */ + eProsima_user_DllExport NameHash& name_hash() + { + return m_name_hash; + } + + + /*! + * @brief This function copies the value in member default_value + * @param _default_value New value to be copied in member default_value + */ + eProsima_user_DllExport void default_value( + const AnnotationParameterValue& _default_value) + { + m_default_value = _default_value; + } + + /*! + * @brief This function moves the value in member default_value + * @param _default_value New value to be moved in member default_value + */ + eProsima_user_DllExport void default_value( + AnnotationParameterValue&& _default_value) + { + m_default_value = std::move(_default_value); + } + + /*! + * @brief This function returns a constant reference to member default_value + * @return Constant reference to member default_value + */ + eProsima_user_DllExport const AnnotationParameterValue& default_value() const + { + return m_default_value; + } + + /*! + * @brief This function returns a reference to member default_value + * @return Reference to member default_value + */ + eProsima_user_DllExport AnnotationParameterValue& default_value() + { + return m_default_value; + } + + + +private: + + CommonAnnotationParameter m_common; + NameHash m_name_hash{0}; + AnnotationParameterValue m_default_value; + +}; +typedef std::vector MinimalAnnotationParameterSeq; + +/*! + * @brief This class represents the structure CompleteAnnotationHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteAnnotationHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteAnnotationHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteAnnotationHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteAnnotationHeader that will be copied. + */ + eProsima_user_DllExport CompleteAnnotationHeader( + const CompleteAnnotationHeader& x) + { + m_annotation_name = x.m_annotation_name; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteAnnotationHeader that will be copied. + */ + eProsima_user_DllExport CompleteAnnotationHeader( + CompleteAnnotationHeader&& x) noexcept + { + m_annotation_name = std::move(x.m_annotation_name); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteAnnotationHeader that will be copied. + */ + eProsima_user_DllExport CompleteAnnotationHeader& operator =( + const CompleteAnnotationHeader& x) + { + + m_annotation_name = x.m_annotation_name; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteAnnotationHeader that will be copied. + */ + eProsima_user_DllExport CompleteAnnotationHeader& operator =( + CompleteAnnotationHeader&& x) noexcept + { + + m_annotation_name = std::move(x.m_annotation_name); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteAnnotationHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteAnnotationHeader& x) const + { + return (m_annotation_name == x.m_annotation_name); + } + + /*! + * @brief Comparison operator. + * @param x CompleteAnnotationHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteAnnotationHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member annotation_name + * @param _annotation_name New value to be copied in member annotation_name + */ + eProsima_user_DllExport void annotation_name( + const QualifiedTypeName& _annotation_name) + { + m_annotation_name = _annotation_name; + } + + /*! + * @brief This function moves the value in member annotation_name + * @param _annotation_name New value to be moved in member annotation_name + */ + eProsima_user_DllExport void annotation_name( + QualifiedTypeName&& _annotation_name) + { + m_annotation_name = std::move(_annotation_name); + } + + /*! + * @brief This function returns a constant reference to member annotation_name + * @return Constant reference to member annotation_name + */ + eProsima_user_DllExport const QualifiedTypeName& annotation_name() const + { + return m_annotation_name; + } + + /*! + * @brief This function returns a reference to member annotation_name + * @return Reference to member annotation_name + */ + eProsima_user_DllExport QualifiedTypeName& annotation_name() + { + return m_annotation_name; + } + + + +private: + + QualifiedTypeName m_annotation_name; + +}; +/*! + * @brief This class represents the structure MinimalAnnotationHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalAnnotationHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalAnnotationHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalAnnotationHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalAnnotationHeader that will be copied. + */ + eProsima_user_DllExport MinimalAnnotationHeader( + const MinimalAnnotationHeader& x) + { + static_cast(x); + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalAnnotationHeader that will be copied. + */ + eProsima_user_DllExport MinimalAnnotationHeader( + MinimalAnnotationHeader&& x) noexcept + { + static_cast(x); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalAnnotationHeader that will be copied. + */ + eProsima_user_DllExport MinimalAnnotationHeader& operator =( + const MinimalAnnotationHeader& x) + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalAnnotationHeader that will be copied. + */ + eProsima_user_DllExport MinimalAnnotationHeader& operator =( + MinimalAnnotationHeader&& x) noexcept + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalAnnotationHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalAnnotationHeader& x) const + { + static_cast(x); + return true; + } + + /*! + * @brief Comparison operator. + * @param x MinimalAnnotationHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalAnnotationHeader& x) const + { + return !(*this == x); + } + + + +private: + + +}; +/*! + * @brief This class represents the structure CompleteAnnotationType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteAnnotationType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteAnnotationType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteAnnotationType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteAnnotationType that will be copied. + */ + eProsima_user_DllExport CompleteAnnotationType( + const CompleteAnnotationType& x) + { + m_annotation_flag = x.m_annotation_flag; + + m_header = x.m_header; + + m_member_seq = x.m_member_seq; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteAnnotationType that will be copied. + */ + eProsima_user_DllExport CompleteAnnotationType( + CompleteAnnotationType&& x) noexcept + { + m_annotation_flag = std::move(x.m_annotation_flag); + m_header = std::move(x.m_header); + m_member_seq = std::move(x.m_member_seq); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteAnnotationType that will be copied. + */ + eProsima_user_DllExport CompleteAnnotationType& operator =( + const CompleteAnnotationType& x) + { + + m_annotation_flag = x.m_annotation_flag; + + m_header = x.m_header; + + m_member_seq = x.m_member_seq; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteAnnotationType that will be copied. + */ + eProsima_user_DllExport CompleteAnnotationType& operator =( + CompleteAnnotationType&& x) noexcept + { + + m_annotation_flag = std::move(x.m_annotation_flag); + m_header = std::move(x.m_header); + m_member_seq = std::move(x.m_member_seq); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteAnnotationType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteAnnotationType& x) const + { + return (m_annotation_flag == x.m_annotation_flag && + m_header == x.m_header && + m_member_seq == x.m_member_seq); + } + + /*! + * @brief Comparison operator. + * @param x CompleteAnnotationType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteAnnotationType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member annotation_flag + * @param _annotation_flag New value to be copied in member annotation_flag + */ + eProsima_user_DllExport void annotation_flag( + const AnnotationTypeFlag& _annotation_flag) + { + m_annotation_flag = _annotation_flag; + } + + /*! + * @brief This function moves the value in member annotation_flag + * @param _annotation_flag New value to be moved in member annotation_flag + */ + eProsima_user_DllExport void annotation_flag( + AnnotationTypeFlag&& _annotation_flag) + { + m_annotation_flag = std::move(_annotation_flag); + } + + /*! + * @brief This function returns a constant reference to member annotation_flag + * @return Constant reference to member annotation_flag + */ + eProsima_user_DllExport const AnnotationTypeFlag& annotation_flag() const + { + return m_annotation_flag; + } + + /*! + * @brief This function returns a reference to member annotation_flag + * @return Reference to member annotation_flag + */ + eProsima_user_DllExport AnnotationTypeFlag& annotation_flag() + { + return m_annotation_flag; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const CompleteAnnotationHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + CompleteAnnotationHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const CompleteAnnotationHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport CompleteAnnotationHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member member_seq + * @param _member_seq New value to be copied in member member_seq + */ + eProsima_user_DllExport void member_seq( + const CompleteAnnotationParameterSeq& _member_seq) + { + m_member_seq = _member_seq; + } + + /*! + * @brief This function moves the value in member member_seq + * @param _member_seq New value to be moved in member member_seq + */ + eProsima_user_DllExport void member_seq( + CompleteAnnotationParameterSeq&& _member_seq) + { + m_member_seq = std::move(_member_seq); + } + + /*! + * @brief This function returns a constant reference to member member_seq + * @return Constant reference to member member_seq + */ + eProsima_user_DllExport const CompleteAnnotationParameterSeq& member_seq() const + { + return m_member_seq; + } + + /*! + * @brief This function returns a reference to member member_seq + * @return Reference to member member_seq + */ + eProsima_user_DllExport CompleteAnnotationParameterSeq& member_seq() + { + return m_member_seq; + } + + + +private: + + AnnotationTypeFlag m_annotation_flag{0}; + CompleteAnnotationHeader m_header; + CompleteAnnotationParameterSeq m_member_seq; + +}; +/*! + * @brief This class represents the structure MinimalAnnotationType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalAnnotationType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalAnnotationType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalAnnotationType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalAnnotationType that will be copied. + */ + eProsima_user_DllExport MinimalAnnotationType( + const MinimalAnnotationType& x) + { + m_annotation_flag = x.m_annotation_flag; + + m_header = x.m_header; + + m_member_seq = x.m_member_seq; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalAnnotationType that will be copied. + */ + eProsima_user_DllExport MinimalAnnotationType( + MinimalAnnotationType&& x) noexcept + { + m_annotation_flag = std::move(x.m_annotation_flag); + m_header = std::move(x.m_header); + m_member_seq = std::move(x.m_member_seq); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalAnnotationType that will be copied. + */ + eProsima_user_DllExport MinimalAnnotationType& operator =( + const MinimalAnnotationType& x) + { + + m_annotation_flag = x.m_annotation_flag; + + m_header = x.m_header; + + m_member_seq = x.m_member_seq; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalAnnotationType that will be copied. + */ + eProsima_user_DllExport MinimalAnnotationType& operator =( + MinimalAnnotationType&& x) noexcept + { + + m_annotation_flag = std::move(x.m_annotation_flag); + m_header = std::move(x.m_header); + m_member_seq = std::move(x.m_member_seq); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalAnnotationType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalAnnotationType& x) const + { + return (m_annotation_flag == x.m_annotation_flag && + m_header == x.m_header && + m_member_seq == x.m_member_seq); + } + + /*! + * @brief Comparison operator. + * @param x MinimalAnnotationType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalAnnotationType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member annotation_flag + * @param _annotation_flag New value to be copied in member annotation_flag + */ + eProsima_user_DllExport void annotation_flag( + const AnnotationTypeFlag& _annotation_flag) + { + m_annotation_flag = _annotation_flag; + } + + /*! + * @brief This function moves the value in member annotation_flag + * @param _annotation_flag New value to be moved in member annotation_flag + */ + eProsima_user_DllExport void annotation_flag( + AnnotationTypeFlag&& _annotation_flag) + { + m_annotation_flag = std::move(_annotation_flag); + } + + /*! + * @brief This function returns a constant reference to member annotation_flag + * @return Constant reference to member annotation_flag + */ + eProsima_user_DllExport const AnnotationTypeFlag& annotation_flag() const + { + return m_annotation_flag; + } + + /*! + * @brief This function returns a reference to member annotation_flag + * @return Reference to member annotation_flag + */ + eProsima_user_DllExport AnnotationTypeFlag& annotation_flag() + { + return m_annotation_flag; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const MinimalAnnotationHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + MinimalAnnotationHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const MinimalAnnotationHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport MinimalAnnotationHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member member_seq + * @param _member_seq New value to be copied in member member_seq + */ + eProsima_user_DllExport void member_seq( + const MinimalAnnotationParameterSeq& _member_seq) + { + m_member_seq = _member_seq; + } + + /*! + * @brief This function moves the value in member member_seq + * @param _member_seq New value to be moved in member member_seq + */ + eProsima_user_DllExport void member_seq( + MinimalAnnotationParameterSeq&& _member_seq) + { + m_member_seq = std::move(_member_seq); + } + + /*! + * @brief This function returns a constant reference to member member_seq + * @return Constant reference to member member_seq + */ + eProsima_user_DllExport const MinimalAnnotationParameterSeq& member_seq() const + { + return m_member_seq; + } + + /*! + * @brief This function returns a reference to member member_seq + * @return Reference to member member_seq + */ + eProsima_user_DllExport MinimalAnnotationParameterSeq& member_seq() + { + return m_member_seq; + } + + + +private: + + AnnotationTypeFlag m_annotation_flag{0}; + MinimalAnnotationHeader m_header; + MinimalAnnotationParameterSeq m_member_seq; + +}; +/*! + * @brief This class represents the structure CommonAliasBody defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonAliasBody +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CommonAliasBody() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CommonAliasBody() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CommonAliasBody that will be copied. + */ + eProsima_user_DllExport CommonAliasBody( + const CommonAliasBody& x) + { + m_related_flags = x.m_related_flags; + + m_related_type = x.m_related_type; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CommonAliasBody that will be copied. + */ + eProsima_user_DllExport CommonAliasBody( + CommonAliasBody&& x) noexcept + { + m_related_flags = std::move(x.m_related_flags); + m_related_type = std::move(x.m_related_type); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CommonAliasBody that will be copied. + */ + eProsima_user_DllExport CommonAliasBody& operator =( + const CommonAliasBody& x) + { + + m_related_flags = x.m_related_flags; + + m_related_type = x.m_related_type; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CommonAliasBody that will be copied. + */ + eProsima_user_DllExport CommonAliasBody& operator =( + CommonAliasBody&& x) noexcept + { + + m_related_flags = std::move(x.m_related_flags); + m_related_type = std::move(x.m_related_type); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CommonAliasBody object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CommonAliasBody& x) const + { + return (m_related_flags == x.m_related_flags && + m_related_type == x.m_related_type); + } + + /*! + * @brief Comparison operator. + * @param x CommonAliasBody object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CommonAliasBody& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member related_flags + * @param _related_flags New value to be copied in member related_flags + */ + eProsima_user_DllExport void related_flags( + const AliasMemberFlag& _related_flags) + { + m_related_flags = _related_flags; + } + + /*! + * @brief This function moves the value in member related_flags + * @param _related_flags New value to be moved in member related_flags + */ + eProsima_user_DllExport void related_flags( + AliasMemberFlag&& _related_flags) + { + m_related_flags = std::move(_related_flags); + } + + /*! + * @brief This function returns a constant reference to member related_flags + * @return Constant reference to member related_flags + */ + eProsima_user_DllExport const AliasMemberFlag& related_flags() const + { + return m_related_flags; + } + + /*! + * @brief This function returns a reference to member related_flags + * @return Reference to member related_flags + */ + eProsima_user_DllExport AliasMemberFlag& related_flags() + { + return m_related_flags; + } + + + /*! + * @brief This function copies the value in member related_type + * @param _related_type New value to be copied in member related_type + */ + eProsima_user_DllExport void related_type( + const TypeIdentifier& _related_type) + { + m_related_type = _related_type; + } + + /*! + * @brief This function moves the value in member related_type + * @param _related_type New value to be moved in member related_type + */ + eProsima_user_DllExport void related_type( + TypeIdentifier&& _related_type) + { + m_related_type = std::move(_related_type); + } + + /*! + * @brief This function returns a constant reference to member related_type + * @return Constant reference to member related_type + */ + eProsima_user_DllExport const TypeIdentifier& related_type() const + { + return m_related_type; + } + + /*! + * @brief This function returns a reference to member related_type + * @return Reference to member related_type + */ + eProsima_user_DllExport TypeIdentifier& related_type() + { + return m_related_type; + } + + + +private: + + AliasMemberFlag m_related_flags{0}; + TypeIdentifier m_related_type; + +}; +/*! + * @brief This class represents the structure CompleteAliasBody defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteAliasBody +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteAliasBody() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteAliasBody() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteAliasBody that will be copied. + */ + eProsima_user_DllExport CompleteAliasBody( + const CompleteAliasBody& x) + { + m_common = x.m_common; + + m_ann_builtin = x.m_ann_builtin; + + m_ann_custom = x.m_ann_custom; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteAliasBody that will be copied. + */ + eProsima_user_DllExport CompleteAliasBody( + CompleteAliasBody&& x) noexcept + { + m_common = std::move(x.m_common); + m_ann_builtin = std::move(x.m_ann_builtin); + m_ann_custom = std::move(x.m_ann_custom); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteAliasBody that will be copied. + */ + eProsima_user_DllExport CompleteAliasBody& operator =( + const CompleteAliasBody& x) + { + + m_common = x.m_common; + + m_ann_builtin = x.m_ann_builtin; + + m_ann_custom = x.m_ann_custom; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteAliasBody that will be copied. + */ + eProsima_user_DllExport CompleteAliasBody& operator =( + CompleteAliasBody&& x) noexcept + { + + m_common = std::move(x.m_common); + m_ann_builtin = std::move(x.m_ann_builtin); + m_ann_custom = std::move(x.m_ann_custom); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteAliasBody object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteAliasBody& x) const + { + return (m_common == x.m_common && + m_ann_builtin == x.m_ann_builtin && + m_ann_custom == x.m_ann_custom); + } + + /*! + * @brief Comparison operator. + * @param x CompleteAliasBody object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteAliasBody& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonAliasBody& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonAliasBody&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonAliasBody& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonAliasBody& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member ann_builtin + * @param _ann_builtin New value to be copied in member ann_builtin + */ + eProsima_user_DllExport void ann_builtin( + const eprosima::fastcdr::optional& _ann_builtin) + { + m_ann_builtin = _ann_builtin; + } + + /*! + * @brief This function moves the value in member ann_builtin + * @param _ann_builtin New value to be moved in member ann_builtin + */ + eProsima_user_DllExport void ann_builtin( + eprosima::fastcdr::optional&& _ann_builtin) + { + m_ann_builtin = std::move(_ann_builtin); + } + + /*! + * @brief This function returns a constant reference to member ann_builtin + * @return Constant reference to member ann_builtin + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& ann_builtin() const + { + return m_ann_builtin; + } + + /*! + * @brief This function returns a reference to member ann_builtin + * @return Reference to member ann_builtin + */ + eProsima_user_DllExport eprosima::fastcdr::optional& ann_builtin() + { + return m_ann_builtin; + } + + + /*! + * @brief This function copies the value in member ann_custom + * @param _ann_custom New value to be copied in member ann_custom + */ + eProsima_user_DllExport void ann_custom( + const eprosima::fastcdr::optional& _ann_custom) + { + m_ann_custom = _ann_custom; + } + + /*! + * @brief This function moves the value in member ann_custom + * @param _ann_custom New value to be moved in member ann_custom + */ + eProsima_user_DllExport void ann_custom( + eprosima::fastcdr::optional&& _ann_custom) + { + m_ann_custom = std::move(_ann_custom); + } + + /*! + * @brief This function returns a constant reference to member ann_custom + * @return Constant reference to member ann_custom + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& ann_custom() const + { + return m_ann_custom; + } + + /*! + * @brief This function returns a reference to member ann_custom + * @return Reference to member ann_custom + */ + eProsima_user_DllExport eprosima::fastcdr::optional& ann_custom() + { + return m_ann_custom; + } + + + +private: + + CommonAliasBody m_common; + eprosima::fastcdr::optional m_ann_builtin; + eprosima::fastcdr::optional m_ann_custom; + +}; +/*! + * @brief This class represents the structure MinimalAliasBody defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalAliasBody +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalAliasBody() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalAliasBody() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalAliasBody that will be copied. + */ + eProsima_user_DllExport MinimalAliasBody( + const MinimalAliasBody& x) + { + m_common = x.m_common; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalAliasBody that will be copied. + */ + eProsima_user_DllExport MinimalAliasBody( + MinimalAliasBody&& x) noexcept + { + m_common = std::move(x.m_common); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalAliasBody that will be copied. + */ + eProsima_user_DllExport MinimalAliasBody& operator =( + const MinimalAliasBody& x) + { + + m_common = x.m_common; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalAliasBody that will be copied. + */ + eProsima_user_DllExport MinimalAliasBody& operator =( + MinimalAliasBody&& x) noexcept + { + + m_common = std::move(x.m_common); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalAliasBody object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalAliasBody& x) const + { + return (m_common == x.m_common); + } + + /*! + * @brief Comparison operator. + * @param x MinimalAliasBody object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalAliasBody& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonAliasBody& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonAliasBody&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonAliasBody& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonAliasBody& common() + { + return m_common; + } + + + +private: + + CommonAliasBody m_common; + +}; +/*! + * @brief This class represents the structure CompleteAliasHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteAliasHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteAliasHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteAliasHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteAliasHeader that will be copied. + */ + eProsima_user_DllExport CompleteAliasHeader( + const CompleteAliasHeader& x) + { + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteAliasHeader that will be copied. + */ + eProsima_user_DllExport CompleteAliasHeader( + CompleteAliasHeader&& x) noexcept + { + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteAliasHeader that will be copied. + */ + eProsima_user_DllExport CompleteAliasHeader& operator =( + const CompleteAliasHeader& x) + { + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteAliasHeader that will be copied. + */ + eProsima_user_DllExport CompleteAliasHeader& operator =( + CompleteAliasHeader&& x) noexcept + { + + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteAliasHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteAliasHeader& x) const + { + return (m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x CompleteAliasHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteAliasHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const CompleteTypeDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + CompleteTypeDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const CompleteTypeDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport CompleteTypeDetail& detail() + { + return m_detail; + } + + + +private: + + CompleteTypeDetail m_detail; + +}; +/*! + * @brief This class represents the structure MinimalAliasHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalAliasHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalAliasHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalAliasHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalAliasHeader that will be copied. + */ + eProsima_user_DllExport MinimalAliasHeader( + const MinimalAliasHeader& x) + { + static_cast(x); + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalAliasHeader that will be copied. + */ + eProsima_user_DllExport MinimalAliasHeader( + MinimalAliasHeader&& x) noexcept + { + static_cast(x); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalAliasHeader that will be copied. + */ + eProsima_user_DllExport MinimalAliasHeader& operator =( + const MinimalAliasHeader& x) + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalAliasHeader that will be copied. + */ + eProsima_user_DllExport MinimalAliasHeader& operator =( + MinimalAliasHeader&& x) noexcept + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalAliasHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalAliasHeader& x) const + { + static_cast(x); + return true; + } + + /*! + * @brief Comparison operator. + * @param x MinimalAliasHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalAliasHeader& x) const + { + return !(*this == x); + } + + + +private: + + +}; +/*! + * @brief This class represents the structure CompleteAliasType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteAliasType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteAliasType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteAliasType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteAliasType that will be copied. + */ + eProsima_user_DllExport CompleteAliasType( + const CompleteAliasType& x) + { + m_alias_flags = x.m_alias_flags; + + m_header = x.m_header; + + m_body = x.m_body; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteAliasType that will be copied. + */ + eProsima_user_DllExport CompleteAliasType( + CompleteAliasType&& x) noexcept + { + m_alias_flags = std::move(x.m_alias_flags); + m_header = std::move(x.m_header); + m_body = std::move(x.m_body); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteAliasType that will be copied. + */ + eProsima_user_DllExport CompleteAliasType& operator =( + const CompleteAliasType& x) + { + + m_alias_flags = x.m_alias_flags; + + m_header = x.m_header; + + m_body = x.m_body; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteAliasType that will be copied. + */ + eProsima_user_DllExport CompleteAliasType& operator =( + CompleteAliasType&& x) noexcept + { + + m_alias_flags = std::move(x.m_alias_flags); + m_header = std::move(x.m_header); + m_body = std::move(x.m_body); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteAliasType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteAliasType& x) const + { + return (m_alias_flags == x.m_alias_flags && + m_header == x.m_header && + m_body == x.m_body); + } + + /*! + * @brief Comparison operator. + * @param x CompleteAliasType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteAliasType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member alias_flags + * @param _alias_flags New value to be copied in member alias_flags + */ + eProsima_user_DllExport void alias_flags( + const AliasTypeFlag& _alias_flags) + { + m_alias_flags = _alias_flags; + } + + /*! + * @brief This function moves the value in member alias_flags + * @param _alias_flags New value to be moved in member alias_flags + */ + eProsima_user_DllExport void alias_flags( + AliasTypeFlag&& _alias_flags) + { + m_alias_flags = std::move(_alias_flags); + } + + /*! + * @brief This function returns a constant reference to member alias_flags + * @return Constant reference to member alias_flags + */ + eProsima_user_DllExport const AliasTypeFlag& alias_flags() const + { + return m_alias_flags; + } + + /*! + * @brief This function returns a reference to member alias_flags + * @return Reference to member alias_flags + */ + eProsima_user_DllExport AliasTypeFlag& alias_flags() + { + return m_alias_flags; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const CompleteAliasHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + CompleteAliasHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const CompleteAliasHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport CompleteAliasHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member body + * @param _body New value to be copied in member body + */ + eProsima_user_DllExport void body( + const CompleteAliasBody& _body) + { + m_body = _body; + } + + /*! + * @brief This function moves the value in member body + * @param _body New value to be moved in member body + */ + eProsima_user_DllExport void body( + CompleteAliasBody&& _body) + { + m_body = std::move(_body); + } + + /*! + * @brief This function returns a constant reference to member body + * @return Constant reference to member body + */ + eProsima_user_DllExport const CompleteAliasBody& body() const + { + return m_body; + } + + /*! + * @brief This function returns a reference to member body + * @return Reference to member body + */ + eProsima_user_DllExport CompleteAliasBody& body() + { + return m_body; + } + + + +private: + + AliasTypeFlag m_alias_flags{0}; + CompleteAliasHeader m_header; + CompleteAliasBody m_body; + +}; +/*! + * @brief This class represents the structure MinimalAliasType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalAliasType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalAliasType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalAliasType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalAliasType that will be copied. + */ + eProsima_user_DllExport MinimalAliasType( + const MinimalAliasType& x) + { + m_alias_flags = x.m_alias_flags; + + m_header = x.m_header; + + m_body = x.m_body; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalAliasType that will be copied. + */ + eProsima_user_DllExport MinimalAliasType( + MinimalAliasType&& x) noexcept + { + m_alias_flags = std::move(x.m_alias_flags); + m_header = std::move(x.m_header); + m_body = std::move(x.m_body); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalAliasType that will be copied. + */ + eProsima_user_DllExport MinimalAliasType& operator =( + const MinimalAliasType& x) + { + + m_alias_flags = x.m_alias_flags; + + m_header = x.m_header; + + m_body = x.m_body; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalAliasType that will be copied. + */ + eProsima_user_DllExport MinimalAliasType& operator =( + MinimalAliasType&& x) noexcept + { + + m_alias_flags = std::move(x.m_alias_flags); + m_header = std::move(x.m_header); + m_body = std::move(x.m_body); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalAliasType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalAliasType& x) const + { + return (m_alias_flags == x.m_alias_flags && + m_header == x.m_header && + m_body == x.m_body); + } + + /*! + * @brief Comparison operator. + * @param x MinimalAliasType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalAliasType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member alias_flags + * @param _alias_flags New value to be copied in member alias_flags + */ + eProsima_user_DllExport void alias_flags( + const AliasTypeFlag& _alias_flags) + { + m_alias_flags = _alias_flags; + } + + /*! + * @brief This function moves the value in member alias_flags + * @param _alias_flags New value to be moved in member alias_flags + */ + eProsima_user_DllExport void alias_flags( + AliasTypeFlag&& _alias_flags) + { + m_alias_flags = std::move(_alias_flags); + } + + /*! + * @brief This function returns a constant reference to member alias_flags + * @return Constant reference to member alias_flags + */ + eProsima_user_DllExport const AliasTypeFlag& alias_flags() const + { + return m_alias_flags; + } + + /*! + * @brief This function returns a reference to member alias_flags + * @return Reference to member alias_flags + */ + eProsima_user_DllExport AliasTypeFlag& alias_flags() + { + return m_alias_flags; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const MinimalAliasHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + MinimalAliasHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const MinimalAliasHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport MinimalAliasHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member body + * @param _body New value to be copied in member body + */ + eProsima_user_DllExport void body( + const MinimalAliasBody& _body) + { + m_body = _body; + } + + /*! + * @brief This function moves the value in member body + * @param _body New value to be moved in member body + */ + eProsima_user_DllExport void body( + MinimalAliasBody&& _body) + { + m_body = std::move(_body); + } + + /*! + * @brief This function returns a constant reference to member body + * @return Constant reference to member body + */ + eProsima_user_DllExport const MinimalAliasBody& body() const + { + return m_body; + } + + /*! + * @brief This function returns a reference to member body + * @return Reference to member body + */ + eProsima_user_DllExport MinimalAliasBody& body() + { + return m_body; + } + + + +private: + + AliasTypeFlag m_alias_flags{0}; + MinimalAliasHeader m_header; + MinimalAliasBody m_body; + +}; +/*! + * @brief This class represents the structure CompleteElementDetail defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteElementDetail +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteElementDetail() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteElementDetail() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteElementDetail that will be copied. + */ + eProsima_user_DllExport CompleteElementDetail( + const CompleteElementDetail& x) + { + m_ann_builtin = x.m_ann_builtin; + + m_ann_custom = x.m_ann_custom; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteElementDetail that will be copied. + */ + eProsima_user_DllExport CompleteElementDetail( + CompleteElementDetail&& x) noexcept + { + m_ann_builtin = std::move(x.m_ann_builtin); + m_ann_custom = std::move(x.m_ann_custom); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteElementDetail that will be copied. + */ + eProsima_user_DllExport CompleteElementDetail& operator =( + const CompleteElementDetail& x) + { + + m_ann_builtin = x.m_ann_builtin; + + m_ann_custom = x.m_ann_custom; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteElementDetail that will be copied. + */ + eProsima_user_DllExport CompleteElementDetail& operator =( + CompleteElementDetail&& x) noexcept + { + + m_ann_builtin = std::move(x.m_ann_builtin); + m_ann_custom = std::move(x.m_ann_custom); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteElementDetail object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteElementDetail& x) const + { + return (m_ann_builtin == x.m_ann_builtin && + m_ann_custom == x.m_ann_custom); + } + + /*! + * @brief Comparison operator. + * @param x CompleteElementDetail object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteElementDetail& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member ann_builtin + * @param _ann_builtin New value to be copied in member ann_builtin + */ + eProsima_user_DllExport void ann_builtin( + const eprosima::fastcdr::optional& _ann_builtin) + { + m_ann_builtin = _ann_builtin; + } + + /*! + * @brief This function moves the value in member ann_builtin + * @param _ann_builtin New value to be moved in member ann_builtin + */ + eProsima_user_DllExport void ann_builtin( + eprosima::fastcdr::optional&& _ann_builtin) + { + m_ann_builtin = std::move(_ann_builtin); + } + + /*! + * @brief This function returns a constant reference to member ann_builtin + * @return Constant reference to member ann_builtin + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& ann_builtin() const + { + return m_ann_builtin; + } + + /*! + * @brief This function returns a reference to member ann_builtin + * @return Reference to member ann_builtin + */ + eProsima_user_DllExport eprosima::fastcdr::optional& ann_builtin() + { + return m_ann_builtin; + } + + + /*! + * @brief This function copies the value in member ann_custom + * @param _ann_custom New value to be copied in member ann_custom + */ + eProsima_user_DllExport void ann_custom( + const eprosima::fastcdr::optional& _ann_custom) + { + m_ann_custom = _ann_custom; + } + + /*! + * @brief This function moves the value in member ann_custom + * @param _ann_custom New value to be moved in member ann_custom + */ + eProsima_user_DllExport void ann_custom( + eprosima::fastcdr::optional&& _ann_custom) + { + m_ann_custom = std::move(_ann_custom); + } + + /*! + * @brief This function returns a constant reference to member ann_custom + * @return Constant reference to member ann_custom + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& ann_custom() const + { + return m_ann_custom; + } + + /*! + * @brief This function returns a reference to member ann_custom + * @return Reference to member ann_custom + */ + eProsima_user_DllExport eprosima::fastcdr::optional& ann_custom() + { + return m_ann_custom; + } + + + +private: + + eprosima::fastcdr::optional m_ann_builtin; + eprosima::fastcdr::optional m_ann_custom; + +}; +/*! + * @brief This class represents the structure CommonCollectionElement defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonCollectionElement +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CommonCollectionElement() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CommonCollectionElement() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CommonCollectionElement that will be copied. + */ + eProsima_user_DllExport CommonCollectionElement( + const CommonCollectionElement& x) + { + m_element_flags = x.m_element_flags; + + m_type = x.m_type; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CommonCollectionElement that will be copied. + */ + eProsima_user_DllExport CommonCollectionElement( + CommonCollectionElement&& x) noexcept + { + m_element_flags = std::move(x.m_element_flags); + m_type = std::move(x.m_type); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CommonCollectionElement that will be copied. + */ + eProsima_user_DllExport CommonCollectionElement& operator =( + const CommonCollectionElement& x) + { + + m_element_flags = x.m_element_flags; + + m_type = x.m_type; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CommonCollectionElement that will be copied. + */ + eProsima_user_DllExport CommonCollectionElement& operator =( + CommonCollectionElement&& x) noexcept + { + + m_element_flags = std::move(x.m_element_flags); + m_type = std::move(x.m_type); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CommonCollectionElement object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CommonCollectionElement& x) const + { + return (m_element_flags == x.m_element_flags && + m_type == x.m_type); + } + + /*! + * @brief Comparison operator. + * @param x CommonCollectionElement object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CommonCollectionElement& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member element_flags + * @param _element_flags New value to be copied in member element_flags + */ + eProsima_user_DllExport void element_flags( + const CollectionElementFlag& _element_flags) + { + m_element_flags = _element_flags; + } + + /*! + * @brief This function moves the value in member element_flags + * @param _element_flags New value to be moved in member element_flags + */ + eProsima_user_DllExport void element_flags( + CollectionElementFlag&& _element_flags) + { + m_element_flags = std::move(_element_flags); + } + + /*! + * @brief This function returns a constant reference to member element_flags + * @return Constant reference to member element_flags + */ + eProsima_user_DllExport const CollectionElementFlag& element_flags() const + { + return m_element_flags; + } + + /*! + * @brief This function returns a reference to member element_flags + * @return Reference to member element_flags + */ + eProsima_user_DllExport CollectionElementFlag& element_flags() + { + return m_element_flags; + } + + + /*! + * @brief This function copies the value in member type + * @param _type New value to be copied in member type + */ + eProsima_user_DllExport void type( + const TypeIdentifier& _type) + { + m_type = _type; + } + + /*! + * @brief This function moves the value in member type + * @param _type New value to be moved in member type + */ + eProsima_user_DllExport void type( + TypeIdentifier&& _type) + { + m_type = std::move(_type); + } + + /*! + * @brief This function returns a constant reference to member type + * @return Constant reference to member type + */ + eProsima_user_DllExport const TypeIdentifier& type() const + { + return m_type; + } + + /*! + * @brief This function returns a reference to member type + * @return Reference to member type + */ + eProsima_user_DllExport TypeIdentifier& type() + { + return m_type; + } + + + +private: + + CollectionElementFlag m_element_flags{0}; + TypeIdentifier m_type; + +}; +/*! + * @brief This class represents the structure CompleteCollectionElement defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteCollectionElement +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteCollectionElement() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteCollectionElement() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteCollectionElement that will be copied. + */ + eProsima_user_DllExport CompleteCollectionElement( + const CompleteCollectionElement& x) + { + m_common = x.m_common; + + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteCollectionElement that will be copied. + */ + eProsima_user_DllExport CompleteCollectionElement( + CompleteCollectionElement&& x) noexcept + { + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteCollectionElement that will be copied. + */ + eProsima_user_DllExport CompleteCollectionElement& operator =( + const CompleteCollectionElement& x) + { + + m_common = x.m_common; + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteCollectionElement that will be copied. + */ + eProsima_user_DllExport CompleteCollectionElement& operator =( + CompleteCollectionElement&& x) noexcept + { + + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteCollectionElement object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteCollectionElement& x) const + { + return (m_common == x.m_common && + m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x CompleteCollectionElement object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteCollectionElement& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonCollectionElement& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonCollectionElement&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonCollectionElement& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonCollectionElement& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const CompleteElementDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + CompleteElementDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const CompleteElementDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport CompleteElementDetail& detail() + { + return m_detail; + } + + + +private: + + CommonCollectionElement m_common; + CompleteElementDetail m_detail; + +}; +/*! + * @brief This class represents the structure MinimalCollectionElement defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalCollectionElement +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalCollectionElement() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalCollectionElement() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalCollectionElement that will be copied. + */ + eProsima_user_DllExport MinimalCollectionElement( + const MinimalCollectionElement& x) + { + m_common = x.m_common; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalCollectionElement that will be copied. + */ + eProsima_user_DllExport MinimalCollectionElement( + MinimalCollectionElement&& x) noexcept + { + m_common = std::move(x.m_common); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalCollectionElement that will be copied. + */ + eProsima_user_DllExport MinimalCollectionElement& operator =( + const MinimalCollectionElement& x) + { + + m_common = x.m_common; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalCollectionElement that will be copied. + */ + eProsima_user_DllExport MinimalCollectionElement& operator =( + MinimalCollectionElement&& x) noexcept + { + + m_common = std::move(x.m_common); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalCollectionElement object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalCollectionElement& x) const + { + return (m_common == x.m_common); + } + + /*! + * @brief Comparison operator. + * @param x MinimalCollectionElement object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalCollectionElement& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonCollectionElement& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonCollectionElement&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonCollectionElement& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonCollectionElement& common() + { + return m_common; + } + + + +private: + + CommonCollectionElement m_common; + +}; +/*! + * @brief This class represents the structure CommonCollectionHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonCollectionHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CommonCollectionHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CommonCollectionHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CommonCollectionHeader that will be copied. + */ + eProsima_user_DllExport CommonCollectionHeader( + const CommonCollectionHeader& x) + { + m_bound = x.m_bound; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CommonCollectionHeader that will be copied. + */ + eProsima_user_DllExport CommonCollectionHeader( + CommonCollectionHeader&& x) noexcept + { + m_bound = x.m_bound; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CommonCollectionHeader that will be copied. + */ + eProsima_user_DllExport CommonCollectionHeader& operator =( + const CommonCollectionHeader& x) + { + + m_bound = x.m_bound; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CommonCollectionHeader that will be copied. + */ + eProsima_user_DllExport CommonCollectionHeader& operator =( + CommonCollectionHeader&& x) noexcept + { + + m_bound = x.m_bound; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CommonCollectionHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CommonCollectionHeader& x) const + { + return (m_bound == x.m_bound); + } + + /*! + * @brief Comparison operator. + * @param x CommonCollectionHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CommonCollectionHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member bound + * @param _bound New value for member bound + */ + eProsima_user_DllExport void bound( + LBound _bound) + { + m_bound = _bound; + } + + /*! + * @brief This function returns the value of member bound + * @return Value of member bound + */ + eProsima_user_DllExport LBound bound() const + { + return m_bound; + } + + /*! + * @brief This function returns a reference to member bound + * @return Reference to member bound + */ + eProsima_user_DllExport LBound& bound() + { + return m_bound; + } + + + +private: + + LBound m_bound{0}; + +}; +/*! + * @brief This class represents the structure CompleteCollectionHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteCollectionHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteCollectionHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteCollectionHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteCollectionHeader that will be copied. + */ + eProsima_user_DllExport CompleteCollectionHeader( + const CompleteCollectionHeader& x) + { + m_common = x.m_common; + + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteCollectionHeader that will be copied. + */ + eProsima_user_DllExport CompleteCollectionHeader( + CompleteCollectionHeader&& x) noexcept + { + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteCollectionHeader that will be copied. + */ + eProsima_user_DllExport CompleteCollectionHeader& operator =( + const CompleteCollectionHeader& x) + { + + m_common = x.m_common; + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteCollectionHeader that will be copied. + */ + eProsima_user_DllExport CompleteCollectionHeader& operator =( + CompleteCollectionHeader&& x) noexcept + { + + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteCollectionHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteCollectionHeader& x) const + { + return (m_common == x.m_common && + m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x CompleteCollectionHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteCollectionHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonCollectionHeader& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonCollectionHeader&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonCollectionHeader& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonCollectionHeader& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const eprosima::fastcdr::optional& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + eprosima::fastcdr::optional&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const eprosima::fastcdr::optional& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport eprosima::fastcdr::optional& detail() + { + return m_detail; + } + + + +private: + + CommonCollectionHeader m_common; + eprosima::fastcdr::optional m_detail; + +}; +/*! + * @brief This class represents the structure MinimalCollectionHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalCollectionHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalCollectionHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalCollectionHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalCollectionHeader that will be copied. + */ + eProsima_user_DllExport MinimalCollectionHeader( + const MinimalCollectionHeader& x) + { + m_common = x.m_common; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalCollectionHeader that will be copied. + */ + eProsima_user_DllExport MinimalCollectionHeader( + MinimalCollectionHeader&& x) noexcept + { + m_common = std::move(x.m_common); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalCollectionHeader that will be copied. + */ + eProsima_user_DllExport MinimalCollectionHeader& operator =( + const MinimalCollectionHeader& x) + { + + m_common = x.m_common; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalCollectionHeader that will be copied. + */ + eProsima_user_DllExport MinimalCollectionHeader& operator =( + MinimalCollectionHeader&& x) noexcept + { + + m_common = std::move(x.m_common); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalCollectionHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalCollectionHeader& x) const + { + return (m_common == x.m_common); + } + + /*! + * @brief Comparison operator. + * @param x MinimalCollectionHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalCollectionHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonCollectionHeader& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonCollectionHeader&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonCollectionHeader& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonCollectionHeader& common() + { + return m_common; + } + + + +private: + + CommonCollectionHeader m_common; + +}; +/*! + * @brief This class represents the structure CompleteSequenceType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteSequenceType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteSequenceType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteSequenceType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteSequenceType that will be copied. + */ + eProsima_user_DllExport CompleteSequenceType( + const CompleteSequenceType& x) + { + m_collection_flag = x.m_collection_flag; + + m_header = x.m_header; + + m_element = x.m_element; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteSequenceType that will be copied. + */ + eProsima_user_DllExport CompleteSequenceType( + CompleteSequenceType&& x) noexcept + { + m_collection_flag = std::move(x.m_collection_flag); + m_header = std::move(x.m_header); + m_element = std::move(x.m_element); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteSequenceType that will be copied. + */ + eProsima_user_DllExport CompleteSequenceType& operator =( + const CompleteSequenceType& x) + { + + m_collection_flag = x.m_collection_flag; + + m_header = x.m_header; + + m_element = x.m_element; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteSequenceType that will be copied. + */ + eProsima_user_DllExport CompleteSequenceType& operator =( + CompleteSequenceType&& x) noexcept + { + + m_collection_flag = std::move(x.m_collection_flag); + m_header = std::move(x.m_header); + m_element = std::move(x.m_element); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteSequenceType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteSequenceType& x) const + { + return (m_collection_flag == x.m_collection_flag && + m_header == x.m_header && + m_element == x.m_element); + } + + /*! + * @brief Comparison operator. + * @param x CompleteSequenceType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteSequenceType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member collection_flag + * @param _collection_flag New value to be copied in member collection_flag + */ + eProsima_user_DllExport void collection_flag( + const CollectionTypeFlag& _collection_flag) + { + m_collection_flag = _collection_flag; + } + + /*! + * @brief This function moves the value in member collection_flag + * @param _collection_flag New value to be moved in member collection_flag + */ + eProsima_user_DllExport void collection_flag( + CollectionTypeFlag&& _collection_flag) + { + m_collection_flag = std::move(_collection_flag); + } + + /*! + * @brief This function returns a constant reference to member collection_flag + * @return Constant reference to member collection_flag + */ + eProsima_user_DllExport const CollectionTypeFlag& collection_flag() const + { + return m_collection_flag; + } + + /*! + * @brief This function returns a reference to member collection_flag + * @return Reference to member collection_flag + */ + eProsima_user_DllExport CollectionTypeFlag& collection_flag() + { + return m_collection_flag; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const CompleteCollectionHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + CompleteCollectionHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const CompleteCollectionHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport CompleteCollectionHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member element + * @param _element New value to be copied in member element + */ + eProsima_user_DllExport void element( + const CompleteCollectionElement& _element) + { + m_element = _element; + } + + /*! + * @brief This function moves the value in member element + * @param _element New value to be moved in member element + */ + eProsima_user_DllExport void element( + CompleteCollectionElement&& _element) + { + m_element = std::move(_element); + } + + /*! + * @brief This function returns a constant reference to member element + * @return Constant reference to member element + */ + eProsima_user_DllExport const CompleteCollectionElement& element() const + { + return m_element; + } + + /*! + * @brief This function returns a reference to member element + * @return Reference to member element + */ + eProsima_user_DllExport CompleteCollectionElement& element() + { + return m_element; + } + + + +private: + + CollectionTypeFlag m_collection_flag{0}; + CompleteCollectionHeader m_header; + CompleteCollectionElement m_element; + +}; +/*! + * @brief This class represents the structure MinimalSequenceType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalSequenceType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalSequenceType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalSequenceType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalSequenceType that will be copied. + */ + eProsima_user_DllExport MinimalSequenceType( + const MinimalSequenceType& x) + { + m_collection_flag = x.m_collection_flag; + + m_header = x.m_header; + + m_element = x.m_element; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalSequenceType that will be copied. + */ + eProsima_user_DllExport MinimalSequenceType( + MinimalSequenceType&& x) noexcept + { + m_collection_flag = std::move(x.m_collection_flag); + m_header = std::move(x.m_header); + m_element = std::move(x.m_element); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalSequenceType that will be copied. + */ + eProsima_user_DllExport MinimalSequenceType& operator =( + const MinimalSequenceType& x) + { + + m_collection_flag = x.m_collection_flag; + + m_header = x.m_header; + + m_element = x.m_element; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalSequenceType that will be copied. + */ + eProsima_user_DllExport MinimalSequenceType& operator =( + MinimalSequenceType&& x) noexcept + { + + m_collection_flag = std::move(x.m_collection_flag); + m_header = std::move(x.m_header); + m_element = std::move(x.m_element); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalSequenceType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalSequenceType& x) const + { + return (m_collection_flag == x.m_collection_flag && + m_header == x.m_header && + m_element == x.m_element); + } + + /*! + * @brief Comparison operator. + * @param x MinimalSequenceType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalSequenceType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member collection_flag + * @param _collection_flag New value to be copied in member collection_flag + */ + eProsima_user_DllExport void collection_flag( + const CollectionTypeFlag& _collection_flag) + { + m_collection_flag = _collection_flag; + } + + /*! + * @brief This function moves the value in member collection_flag + * @param _collection_flag New value to be moved in member collection_flag + */ + eProsima_user_DllExport void collection_flag( + CollectionTypeFlag&& _collection_flag) + { + m_collection_flag = std::move(_collection_flag); + } + + /*! + * @brief This function returns a constant reference to member collection_flag + * @return Constant reference to member collection_flag + */ + eProsima_user_DllExport const CollectionTypeFlag& collection_flag() const + { + return m_collection_flag; + } + + /*! + * @brief This function returns a reference to member collection_flag + * @return Reference to member collection_flag + */ + eProsima_user_DllExport CollectionTypeFlag& collection_flag() + { + return m_collection_flag; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const MinimalCollectionHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + MinimalCollectionHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const MinimalCollectionHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport MinimalCollectionHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member element + * @param _element New value to be copied in member element + */ + eProsima_user_DllExport void element( + const MinimalCollectionElement& _element) + { + m_element = _element; + } + + /*! + * @brief This function moves the value in member element + * @param _element New value to be moved in member element + */ + eProsima_user_DllExport void element( + MinimalCollectionElement&& _element) + { + m_element = std::move(_element); + } + + /*! + * @brief This function returns a constant reference to member element + * @return Constant reference to member element + */ + eProsima_user_DllExport const MinimalCollectionElement& element() const + { + return m_element; + } + + /*! + * @brief This function returns a reference to member element + * @return Reference to member element + */ + eProsima_user_DllExport MinimalCollectionElement& element() + { + return m_element; + } + + + +private: + + CollectionTypeFlag m_collection_flag{0}; + MinimalCollectionHeader m_header; + MinimalCollectionElement m_element; + +}; +/*! + * @brief This class represents the structure CommonArrayHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonArrayHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CommonArrayHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CommonArrayHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CommonArrayHeader that will be copied. + */ + eProsima_user_DllExport CommonArrayHeader( + const CommonArrayHeader& x) + { + m_bound_seq = x.m_bound_seq; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CommonArrayHeader that will be copied. + */ + eProsima_user_DllExport CommonArrayHeader( + CommonArrayHeader&& x) noexcept + { + m_bound_seq = std::move(x.m_bound_seq); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CommonArrayHeader that will be copied. + */ + eProsima_user_DllExport CommonArrayHeader& operator =( + const CommonArrayHeader& x) + { + + m_bound_seq = x.m_bound_seq; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CommonArrayHeader that will be copied. + */ + eProsima_user_DllExport CommonArrayHeader& operator =( + CommonArrayHeader&& x) noexcept + { + + m_bound_seq = std::move(x.m_bound_seq); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CommonArrayHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CommonArrayHeader& x) const + { + return (m_bound_seq == x.m_bound_seq); + } + + /*! + * @brief Comparison operator. + * @param x CommonArrayHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CommonArrayHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member bound_seq + * @param _bound_seq New value to be copied in member bound_seq + */ + eProsima_user_DllExport void bound_seq( + const LBoundSeq& _bound_seq) + { + m_bound_seq = _bound_seq; + } + + /*! + * @brief This function moves the value in member bound_seq + * @param _bound_seq New value to be moved in member bound_seq + */ + eProsima_user_DllExport void bound_seq( + LBoundSeq&& _bound_seq) + { + m_bound_seq = std::move(_bound_seq); + } + + /*! + * @brief This function returns a constant reference to member bound_seq + * @return Constant reference to member bound_seq + */ + eProsima_user_DllExport const LBoundSeq& bound_seq() const + { + return m_bound_seq; + } + + /*! + * @brief This function returns a reference to member bound_seq + * @return Reference to member bound_seq + */ + eProsima_user_DllExport LBoundSeq& bound_seq() + { + return m_bound_seq; + } + + + +private: + + LBoundSeq m_bound_seq; + +}; +/*! + * @brief This class represents the structure CompleteArrayHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteArrayHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteArrayHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteArrayHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteArrayHeader that will be copied. + */ + eProsima_user_DllExport CompleteArrayHeader( + const CompleteArrayHeader& x) + { + m_common = x.m_common; + + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteArrayHeader that will be copied. + */ + eProsima_user_DllExport CompleteArrayHeader( + CompleteArrayHeader&& x) noexcept + { + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteArrayHeader that will be copied. + */ + eProsima_user_DllExport CompleteArrayHeader& operator =( + const CompleteArrayHeader& x) + { + + m_common = x.m_common; + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteArrayHeader that will be copied. + */ + eProsima_user_DllExport CompleteArrayHeader& operator =( + CompleteArrayHeader&& x) noexcept + { + + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteArrayHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteArrayHeader& x) const + { + return (m_common == x.m_common && + m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x CompleteArrayHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteArrayHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonArrayHeader& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonArrayHeader&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonArrayHeader& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonArrayHeader& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const CompleteTypeDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + CompleteTypeDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const CompleteTypeDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport CompleteTypeDetail& detail() + { + return m_detail; + } + + + +private: + + CommonArrayHeader m_common; + CompleteTypeDetail m_detail; + +}; +/*! + * @brief This class represents the structure MinimalArrayHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalArrayHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalArrayHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalArrayHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalArrayHeader that will be copied. + */ + eProsima_user_DllExport MinimalArrayHeader( + const MinimalArrayHeader& x) + { + m_common = x.m_common; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalArrayHeader that will be copied. + */ + eProsima_user_DllExport MinimalArrayHeader( + MinimalArrayHeader&& x) noexcept + { + m_common = std::move(x.m_common); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalArrayHeader that will be copied. + */ + eProsima_user_DllExport MinimalArrayHeader& operator =( + const MinimalArrayHeader& x) + { + + m_common = x.m_common; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalArrayHeader that will be copied. + */ + eProsima_user_DllExport MinimalArrayHeader& operator =( + MinimalArrayHeader&& x) noexcept + { + + m_common = std::move(x.m_common); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalArrayHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalArrayHeader& x) const + { + return (m_common == x.m_common); + } + + /*! + * @brief Comparison operator. + * @param x MinimalArrayHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalArrayHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonArrayHeader& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonArrayHeader&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonArrayHeader& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonArrayHeader& common() + { + return m_common; + } + + + +private: + + CommonArrayHeader m_common; + +}; +/*! + * @brief This class represents the structure CompleteArrayType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteArrayType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteArrayType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteArrayType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteArrayType that will be copied. + */ + eProsima_user_DllExport CompleteArrayType( + const CompleteArrayType& x) + { + m_collection_flag = x.m_collection_flag; + + m_header = x.m_header; + + m_element = x.m_element; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteArrayType that will be copied. + */ + eProsima_user_DllExport CompleteArrayType( + CompleteArrayType&& x) noexcept + { + m_collection_flag = std::move(x.m_collection_flag); + m_header = std::move(x.m_header); + m_element = std::move(x.m_element); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteArrayType that will be copied. + */ + eProsima_user_DllExport CompleteArrayType& operator =( + const CompleteArrayType& x) + { + + m_collection_flag = x.m_collection_flag; + + m_header = x.m_header; + + m_element = x.m_element; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteArrayType that will be copied. + */ + eProsima_user_DllExport CompleteArrayType& operator =( + CompleteArrayType&& x) noexcept + { + + m_collection_flag = std::move(x.m_collection_flag); + m_header = std::move(x.m_header); + m_element = std::move(x.m_element); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteArrayType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteArrayType& x) const + { + return (m_collection_flag == x.m_collection_flag && + m_header == x.m_header && + m_element == x.m_element); + } + + /*! + * @brief Comparison operator. + * @param x CompleteArrayType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteArrayType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member collection_flag + * @param _collection_flag New value to be copied in member collection_flag + */ + eProsima_user_DllExport void collection_flag( + const CollectionTypeFlag& _collection_flag) + { + m_collection_flag = _collection_flag; + } + + /*! + * @brief This function moves the value in member collection_flag + * @param _collection_flag New value to be moved in member collection_flag + */ + eProsima_user_DllExport void collection_flag( + CollectionTypeFlag&& _collection_flag) + { + m_collection_flag = std::move(_collection_flag); + } + + /*! + * @brief This function returns a constant reference to member collection_flag + * @return Constant reference to member collection_flag + */ + eProsima_user_DllExport const CollectionTypeFlag& collection_flag() const + { + return m_collection_flag; + } + + /*! + * @brief This function returns a reference to member collection_flag + * @return Reference to member collection_flag + */ + eProsima_user_DllExport CollectionTypeFlag& collection_flag() + { + return m_collection_flag; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const CompleteArrayHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + CompleteArrayHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const CompleteArrayHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport CompleteArrayHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member element + * @param _element New value to be copied in member element + */ + eProsima_user_DllExport void element( + const CompleteCollectionElement& _element) + { + m_element = _element; + } + + /*! + * @brief This function moves the value in member element + * @param _element New value to be moved in member element + */ + eProsima_user_DllExport void element( + CompleteCollectionElement&& _element) + { + m_element = std::move(_element); + } + + /*! + * @brief This function returns a constant reference to member element + * @return Constant reference to member element + */ + eProsima_user_DllExport const CompleteCollectionElement& element() const + { + return m_element; + } + + /*! + * @brief This function returns a reference to member element + * @return Reference to member element + */ + eProsima_user_DllExport CompleteCollectionElement& element() + { + return m_element; + } + + + +private: + + CollectionTypeFlag m_collection_flag{0}; + CompleteArrayHeader m_header; + CompleteCollectionElement m_element; + +}; +/*! + * @brief This class represents the structure MinimalArrayType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalArrayType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalArrayType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalArrayType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalArrayType that will be copied. + */ + eProsima_user_DllExport MinimalArrayType( + const MinimalArrayType& x) + { + m_collection_flag = x.m_collection_flag; + + m_header = x.m_header; + + m_element = x.m_element; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalArrayType that will be copied. + */ + eProsima_user_DllExport MinimalArrayType( + MinimalArrayType&& x) noexcept + { + m_collection_flag = std::move(x.m_collection_flag); + m_header = std::move(x.m_header); + m_element = std::move(x.m_element); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalArrayType that will be copied. + */ + eProsima_user_DllExport MinimalArrayType& operator =( + const MinimalArrayType& x) + { + + m_collection_flag = x.m_collection_flag; + + m_header = x.m_header; + + m_element = x.m_element; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalArrayType that will be copied. + */ + eProsima_user_DllExport MinimalArrayType& operator =( + MinimalArrayType&& x) noexcept + { + + m_collection_flag = std::move(x.m_collection_flag); + m_header = std::move(x.m_header); + m_element = std::move(x.m_element); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalArrayType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalArrayType& x) const + { + return (m_collection_flag == x.m_collection_flag && + m_header == x.m_header && + m_element == x.m_element); + } + + /*! + * @brief Comparison operator. + * @param x MinimalArrayType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalArrayType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member collection_flag + * @param _collection_flag New value to be copied in member collection_flag + */ + eProsima_user_DllExport void collection_flag( + const CollectionTypeFlag& _collection_flag) + { + m_collection_flag = _collection_flag; + } + + /*! + * @brief This function moves the value in member collection_flag + * @param _collection_flag New value to be moved in member collection_flag + */ + eProsima_user_DllExport void collection_flag( + CollectionTypeFlag&& _collection_flag) + { + m_collection_flag = std::move(_collection_flag); + } + + /*! + * @brief This function returns a constant reference to member collection_flag + * @return Constant reference to member collection_flag + */ + eProsima_user_DllExport const CollectionTypeFlag& collection_flag() const + { + return m_collection_flag; + } + + /*! + * @brief This function returns a reference to member collection_flag + * @return Reference to member collection_flag + */ + eProsima_user_DllExport CollectionTypeFlag& collection_flag() + { + return m_collection_flag; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const MinimalArrayHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + MinimalArrayHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const MinimalArrayHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport MinimalArrayHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member element + * @param _element New value to be copied in member element + */ + eProsima_user_DllExport void element( + const MinimalCollectionElement& _element) + { + m_element = _element; + } + + /*! + * @brief This function moves the value in member element + * @param _element New value to be moved in member element + */ + eProsima_user_DllExport void element( + MinimalCollectionElement&& _element) + { + m_element = std::move(_element); + } + + /*! + * @brief This function returns a constant reference to member element + * @return Constant reference to member element + */ + eProsima_user_DllExport const MinimalCollectionElement& element() const + { + return m_element; + } + + /*! + * @brief This function returns a reference to member element + * @return Reference to member element + */ + eProsima_user_DllExport MinimalCollectionElement& element() + { + return m_element; + } + + + +private: + + CollectionTypeFlag m_collection_flag{0}; + MinimalArrayHeader m_header; + MinimalCollectionElement m_element; + +}; +/*! + * @brief This class represents the structure CompleteMapType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteMapType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteMapType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteMapType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteMapType that will be copied. + */ + eProsima_user_DllExport CompleteMapType( + const CompleteMapType& x) + { + m_collection_flag = x.m_collection_flag; + + m_header = x.m_header; + + m_key = x.m_key; + + m_element = x.m_element; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteMapType that will be copied. + */ + eProsima_user_DllExport CompleteMapType( + CompleteMapType&& x) noexcept + { + m_collection_flag = std::move(x.m_collection_flag); + m_header = std::move(x.m_header); + m_key = std::move(x.m_key); + m_element = std::move(x.m_element); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteMapType that will be copied. + */ + eProsima_user_DllExport CompleteMapType& operator =( + const CompleteMapType& x) + { + + m_collection_flag = x.m_collection_flag; + + m_header = x.m_header; + + m_key = x.m_key; + + m_element = x.m_element; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteMapType that will be copied. + */ + eProsima_user_DllExport CompleteMapType& operator =( + CompleteMapType&& x) noexcept + { + + m_collection_flag = std::move(x.m_collection_flag); + m_header = std::move(x.m_header); + m_key = std::move(x.m_key); + m_element = std::move(x.m_element); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteMapType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteMapType& x) const + { + return (m_collection_flag == x.m_collection_flag && + m_header == x.m_header && + m_key == x.m_key && + m_element == x.m_element); + } + + /*! + * @brief Comparison operator. + * @param x CompleteMapType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteMapType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member collection_flag + * @param _collection_flag New value to be copied in member collection_flag + */ + eProsima_user_DllExport void collection_flag( + const CollectionTypeFlag& _collection_flag) + { + m_collection_flag = _collection_flag; + } + + /*! + * @brief This function moves the value in member collection_flag + * @param _collection_flag New value to be moved in member collection_flag + */ + eProsima_user_DllExport void collection_flag( + CollectionTypeFlag&& _collection_flag) + { + m_collection_flag = std::move(_collection_flag); + } + + /*! + * @brief This function returns a constant reference to member collection_flag + * @return Constant reference to member collection_flag + */ + eProsima_user_DllExport const CollectionTypeFlag& collection_flag() const + { + return m_collection_flag; + } + + /*! + * @brief This function returns a reference to member collection_flag + * @return Reference to member collection_flag + */ + eProsima_user_DllExport CollectionTypeFlag& collection_flag() + { + return m_collection_flag; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const CompleteCollectionHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + CompleteCollectionHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const CompleteCollectionHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport CompleteCollectionHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member key + * @param _key New value to be copied in member key + */ + eProsima_user_DllExport void key( + const CompleteCollectionElement& _key) + { + m_key = _key; + } + + /*! + * @brief This function moves the value in member key + * @param _key New value to be moved in member key + */ + eProsima_user_DllExport void key( + CompleteCollectionElement&& _key) + { + m_key = std::move(_key); + } + + /*! + * @brief This function returns a constant reference to member key + * @return Constant reference to member key + */ + eProsima_user_DllExport const CompleteCollectionElement& key() const + { + return m_key; + } + + /*! + * @brief This function returns a reference to member key + * @return Reference to member key + */ + eProsima_user_DllExport CompleteCollectionElement& key() + { + return m_key; + } + + + /*! + * @brief This function copies the value in member element + * @param _element New value to be copied in member element + */ + eProsima_user_DllExport void element( + const CompleteCollectionElement& _element) + { + m_element = _element; + } + + /*! + * @brief This function moves the value in member element + * @param _element New value to be moved in member element + */ + eProsima_user_DllExport void element( + CompleteCollectionElement&& _element) + { + m_element = std::move(_element); + } + + /*! + * @brief This function returns a constant reference to member element + * @return Constant reference to member element + */ + eProsima_user_DllExport const CompleteCollectionElement& element() const + { + return m_element; + } + + /*! + * @brief This function returns a reference to member element + * @return Reference to member element + */ + eProsima_user_DllExport CompleteCollectionElement& element() + { + return m_element; + } + + + +private: + + CollectionTypeFlag m_collection_flag{0}; + CompleteCollectionHeader m_header; + CompleteCollectionElement m_key; + CompleteCollectionElement m_element; + +}; +/*! + * @brief This class represents the structure MinimalMapType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalMapType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalMapType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalMapType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalMapType that will be copied. + */ + eProsima_user_DllExport MinimalMapType( + const MinimalMapType& x) + { + m_collection_flag = x.m_collection_flag; + + m_header = x.m_header; + + m_key = x.m_key; + + m_element = x.m_element; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalMapType that will be copied. + */ + eProsima_user_DllExport MinimalMapType( + MinimalMapType&& x) noexcept + { + m_collection_flag = std::move(x.m_collection_flag); + m_header = std::move(x.m_header); + m_key = std::move(x.m_key); + m_element = std::move(x.m_element); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalMapType that will be copied. + */ + eProsima_user_DllExport MinimalMapType& operator =( + const MinimalMapType& x) + { + + m_collection_flag = x.m_collection_flag; + + m_header = x.m_header; + + m_key = x.m_key; + + m_element = x.m_element; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalMapType that will be copied. + */ + eProsima_user_DllExport MinimalMapType& operator =( + MinimalMapType&& x) noexcept + { + + m_collection_flag = std::move(x.m_collection_flag); + m_header = std::move(x.m_header); + m_key = std::move(x.m_key); + m_element = std::move(x.m_element); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalMapType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalMapType& x) const + { + return (m_collection_flag == x.m_collection_flag && + m_header == x.m_header && + m_key == x.m_key && + m_element == x.m_element); + } + + /*! + * @brief Comparison operator. + * @param x MinimalMapType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalMapType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member collection_flag + * @param _collection_flag New value to be copied in member collection_flag + */ + eProsima_user_DllExport void collection_flag( + const CollectionTypeFlag& _collection_flag) + { + m_collection_flag = _collection_flag; + } + + /*! + * @brief This function moves the value in member collection_flag + * @param _collection_flag New value to be moved in member collection_flag + */ + eProsima_user_DllExport void collection_flag( + CollectionTypeFlag&& _collection_flag) + { + m_collection_flag = std::move(_collection_flag); + } + + /*! + * @brief This function returns a constant reference to member collection_flag + * @return Constant reference to member collection_flag + */ + eProsima_user_DllExport const CollectionTypeFlag& collection_flag() const + { + return m_collection_flag; + } + + /*! + * @brief This function returns a reference to member collection_flag + * @return Reference to member collection_flag + */ + eProsima_user_DllExport CollectionTypeFlag& collection_flag() + { + return m_collection_flag; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const MinimalCollectionHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + MinimalCollectionHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const MinimalCollectionHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport MinimalCollectionHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member key + * @param _key New value to be copied in member key + */ + eProsima_user_DllExport void key( + const MinimalCollectionElement& _key) + { + m_key = _key; + } + + /*! + * @brief This function moves the value in member key + * @param _key New value to be moved in member key + */ + eProsima_user_DllExport void key( + MinimalCollectionElement&& _key) + { + m_key = std::move(_key); + } + + /*! + * @brief This function returns a constant reference to member key + * @return Constant reference to member key + */ + eProsima_user_DllExport const MinimalCollectionElement& key() const + { + return m_key; + } + + /*! + * @brief This function returns a reference to member key + * @return Reference to member key + */ + eProsima_user_DllExport MinimalCollectionElement& key() + { + return m_key; + } + + + /*! + * @brief This function copies the value in member element + * @param _element New value to be copied in member element + */ + eProsima_user_DllExport void element( + const MinimalCollectionElement& _element) + { + m_element = _element; + } + + /*! + * @brief This function moves the value in member element + * @param _element New value to be moved in member element + */ + eProsima_user_DllExport void element( + MinimalCollectionElement&& _element) + { + m_element = std::move(_element); + } + + /*! + * @brief This function returns a constant reference to member element + * @return Constant reference to member element + */ + eProsima_user_DllExport const MinimalCollectionElement& element() const + { + return m_element; + } + + /*! + * @brief This function returns a reference to member element + * @return Reference to member element + */ + eProsima_user_DllExport MinimalCollectionElement& element() + { + return m_element; + } + + + +private: + + CollectionTypeFlag m_collection_flag{0}; + MinimalCollectionHeader m_header; + MinimalCollectionElement m_key; + MinimalCollectionElement m_element; + +}; +typedef uint16_t BitBound; + +/*! + * @brief This class represents the structure CommonEnumeratedLiteral defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonEnumeratedLiteral +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CommonEnumeratedLiteral() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CommonEnumeratedLiteral() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CommonEnumeratedLiteral that will be copied. + */ + eProsima_user_DllExport CommonEnumeratedLiteral( + const CommonEnumeratedLiteral& x) + { + m_value = x.m_value; + + m_flags = x.m_flags; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CommonEnumeratedLiteral that will be copied. + */ + eProsima_user_DllExport CommonEnumeratedLiteral( + CommonEnumeratedLiteral&& x) noexcept + { + m_value = x.m_value; + m_flags = std::move(x.m_flags); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CommonEnumeratedLiteral that will be copied. + */ + eProsima_user_DllExport CommonEnumeratedLiteral& operator =( + const CommonEnumeratedLiteral& x) + { + + m_value = x.m_value; + + m_flags = x.m_flags; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CommonEnumeratedLiteral that will be copied. + */ + eProsima_user_DllExport CommonEnumeratedLiteral& operator =( + CommonEnumeratedLiteral&& x) noexcept + { + + m_value = x.m_value; + m_flags = std::move(x.m_flags); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CommonEnumeratedLiteral object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CommonEnumeratedLiteral& x) const + { + return (m_value == x.m_value && + m_flags == x.m_flags); + } + + /*! + * @brief Comparison operator. + * @param x CommonEnumeratedLiteral object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CommonEnumeratedLiteral& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member value + * @param _value New value for member value + */ + eProsima_user_DllExport void value( + int32_t _value) + { + m_value = _value; + } + + /*! + * @brief This function returns the value of member value + * @return Value of member value + */ + eProsima_user_DllExport int32_t value() const + { + return m_value; + } + + /*! + * @brief This function returns a reference to member value + * @return Reference to member value + */ + eProsima_user_DllExport int32_t& value() + { + return m_value; + } + + + /*! + * @brief This function copies the value in member flags + * @param _flags New value to be copied in member flags + */ + eProsima_user_DllExport void flags( + const EnumeratedLiteralFlag& _flags) + { + m_flags = _flags; + } + + /*! + * @brief This function moves the value in member flags + * @param _flags New value to be moved in member flags + */ + eProsima_user_DllExport void flags( + EnumeratedLiteralFlag&& _flags) + { + m_flags = std::move(_flags); + } + + /*! + * @brief This function returns a constant reference to member flags + * @return Constant reference to member flags + */ + eProsima_user_DllExport const EnumeratedLiteralFlag& flags() const + { + return m_flags; + } + + /*! + * @brief This function returns a reference to member flags + * @return Reference to member flags + */ + eProsima_user_DllExport EnumeratedLiteralFlag& flags() + { + return m_flags; + } + + + +private: + + int32_t m_value{0}; + EnumeratedLiteralFlag m_flags{0}; + +}; +/*! + * @brief This class represents the structure CompleteEnumeratedLiteral defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteEnumeratedLiteral +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteEnumeratedLiteral() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteEnumeratedLiteral() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteEnumeratedLiteral that will be copied. + */ + eProsima_user_DllExport CompleteEnumeratedLiteral( + const CompleteEnumeratedLiteral& x) + { + m_common = x.m_common; + + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteEnumeratedLiteral that will be copied. + */ + eProsima_user_DllExport CompleteEnumeratedLiteral( + CompleteEnumeratedLiteral&& x) noexcept + { + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteEnumeratedLiteral that will be copied. + */ + eProsima_user_DllExport CompleteEnumeratedLiteral& operator =( + const CompleteEnumeratedLiteral& x) + { + + m_common = x.m_common; + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteEnumeratedLiteral that will be copied. + */ + eProsima_user_DllExport CompleteEnumeratedLiteral& operator =( + CompleteEnumeratedLiteral&& x) noexcept + { + + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteEnumeratedLiteral object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteEnumeratedLiteral& x) const + { + return (m_common == x.m_common && + m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x CompleteEnumeratedLiteral object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteEnumeratedLiteral& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonEnumeratedLiteral& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonEnumeratedLiteral&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonEnumeratedLiteral& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonEnumeratedLiteral& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const CompleteMemberDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + CompleteMemberDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const CompleteMemberDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport CompleteMemberDetail& detail() + { + return m_detail; + } + + + +private: + + CommonEnumeratedLiteral m_common; + CompleteMemberDetail m_detail; + +}; +typedef std::vector CompleteEnumeratedLiteralSeq; + +/*! + * @brief This class represents the structure MinimalEnumeratedLiteral defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalEnumeratedLiteral +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalEnumeratedLiteral() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalEnumeratedLiteral() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalEnumeratedLiteral that will be copied. + */ + eProsima_user_DllExport MinimalEnumeratedLiteral( + const MinimalEnumeratedLiteral& x) + { + m_common = x.m_common; + + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalEnumeratedLiteral that will be copied. + */ + eProsima_user_DllExport MinimalEnumeratedLiteral( + MinimalEnumeratedLiteral&& x) noexcept + { + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalEnumeratedLiteral that will be copied. + */ + eProsima_user_DllExport MinimalEnumeratedLiteral& operator =( + const MinimalEnumeratedLiteral& x) + { + + m_common = x.m_common; + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalEnumeratedLiteral that will be copied. + */ + eProsima_user_DllExport MinimalEnumeratedLiteral& operator =( + MinimalEnumeratedLiteral&& x) noexcept + { + + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalEnumeratedLiteral object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalEnumeratedLiteral& x) const + { + return (m_common == x.m_common && + m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x MinimalEnumeratedLiteral object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalEnumeratedLiteral& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonEnumeratedLiteral& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonEnumeratedLiteral&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonEnumeratedLiteral& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonEnumeratedLiteral& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const MinimalMemberDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + MinimalMemberDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const MinimalMemberDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport MinimalMemberDetail& detail() + { + return m_detail; + } + + + +private: + + CommonEnumeratedLiteral m_common; + MinimalMemberDetail m_detail; + +}; +typedef std::vector MinimalEnumeratedLiteralSeq; + +/*! + * @brief This class represents the structure CommonEnumeratedHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonEnumeratedHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CommonEnumeratedHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CommonEnumeratedHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CommonEnumeratedHeader that will be copied. + */ + eProsima_user_DllExport CommonEnumeratedHeader( + const CommonEnumeratedHeader& x) + { + m_bit_bound = x.m_bit_bound; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CommonEnumeratedHeader that will be copied. + */ + eProsima_user_DllExport CommonEnumeratedHeader( + CommonEnumeratedHeader&& x) noexcept + { + m_bit_bound = x.m_bit_bound; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CommonEnumeratedHeader that will be copied. + */ + eProsima_user_DllExport CommonEnumeratedHeader& operator =( + const CommonEnumeratedHeader& x) + { + + m_bit_bound = x.m_bit_bound; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CommonEnumeratedHeader that will be copied. + */ + eProsima_user_DllExport CommonEnumeratedHeader& operator =( + CommonEnumeratedHeader&& x) noexcept + { + + m_bit_bound = x.m_bit_bound; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CommonEnumeratedHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CommonEnumeratedHeader& x) const + { + return (m_bit_bound == x.m_bit_bound); + } + + /*! + * @brief Comparison operator. + * @param x CommonEnumeratedHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CommonEnumeratedHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member bit_bound + * @param _bit_bound New value for member bit_bound + */ + eProsima_user_DllExport void bit_bound( + BitBound _bit_bound) + { + m_bit_bound = _bit_bound; + } + + /*! + * @brief This function returns the value of member bit_bound + * @return Value of member bit_bound + */ + eProsima_user_DllExport BitBound bit_bound() const + { + return m_bit_bound; + } + + /*! + * @brief This function returns a reference to member bit_bound + * @return Reference to member bit_bound + */ + eProsima_user_DllExport BitBound& bit_bound() + { + return m_bit_bound; + } + + + +private: + + BitBound m_bit_bound{0}; + +}; +/*! + * @brief This class represents the structure CompleteEnumeratedHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteEnumeratedHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteEnumeratedHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteEnumeratedHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteEnumeratedHeader that will be copied. + */ + eProsima_user_DllExport CompleteEnumeratedHeader( + const CompleteEnumeratedHeader& x) + { + m_common = x.m_common; + + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteEnumeratedHeader that will be copied. + */ + eProsima_user_DllExport CompleteEnumeratedHeader( + CompleteEnumeratedHeader&& x) noexcept + { + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteEnumeratedHeader that will be copied. + */ + eProsima_user_DllExport CompleteEnumeratedHeader& operator =( + const CompleteEnumeratedHeader& x) + { + + m_common = x.m_common; + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteEnumeratedHeader that will be copied. + */ + eProsima_user_DllExport CompleteEnumeratedHeader& operator =( + CompleteEnumeratedHeader&& x) noexcept + { + + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteEnumeratedHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteEnumeratedHeader& x) const + { + return (m_common == x.m_common && + m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x CompleteEnumeratedHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteEnumeratedHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonEnumeratedHeader& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonEnumeratedHeader&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonEnumeratedHeader& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonEnumeratedHeader& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const CompleteTypeDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + CompleteTypeDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const CompleteTypeDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport CompleteTypeDetail& detail() + { + return m_detail; + } + + + +private: + + CommonEnumeratedHeader m_common; + CompleteTypeDetail m_detail; + +}; +/*! + * @brief This class represents the structure MinimalEnumeratedHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalEnumeratedHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalEnumeratedHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalEnumeratedHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalEnumeratedHeader that will be copied. + */ + eProsima_user_DllExport MinimalEnumeratedHeader( + const MinimalEnumeratedHeader& x) + { + m_common = x.m_common; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalEnumeratedHeader that will be copied. + */ + eProsima_user_DllExport MinimalEnumeratedHeader( + MinimalEnumeratedHeader&& x) noexcept + { + m_common = std::move(x.m_common); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalEnumeratedHeader that will be copied. + */ + eProsima_user_DllExport MinimalEnumeratedHeader& operator =( + const MinimalEnumeratedHeader& x) + { + + m_common = x.m_common; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalEnumeratedHeader that will be copied. + */ + eProsima_user_DllExport MinimalEnumeratedHeader& operator =( + MinimalEnumeratedHeader&& x) noexcept + { + + m_common = std::move(x.m_common); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalEnumeratedHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalEnumeratedHeader& x) const + { + return (m_common == x.m_common); + } + + /*! + * @brief Comparison operator. + * @param x MinimalEnumeratedHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalEnumeratedHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonEnumeratedHeader& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonEnumeratedHeader&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonEnumeratedHeader& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonEnumeratedHeader& common() + { + return m_common; + } + + + +private: + + CommonEnumeratedHeader m_common; + +}; +/*! + * @brief This class represents the structure CompleteEnumeratedType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteEnumeratedType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteEnumeratedType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteEnumeratedType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteEnumeratedType that will be copied. + */ + eProsima_user_DllExport CompleteEnumeratedType( + const CompleteEnumeratedType& x) + { + m_enum_flags = x.m_enum_flags; + + m_header = x.m_header; + + m_literal_seq = x.m_literal_seq; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteEnumeratedType that will be copied. + */ + eProsima_user_DllExport CompleteEnumeratedType( + CompleteEnumeratedType&& x) noexcept + { + m_enum_flags = std::move(x.m_enum_flags); + m_header = std::move(x.m_header); + m_literal_seq = std::move(x.m_literal_seq); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteEnumeratedType that will be copied. + */ + eProsima_user_DllExport CompleteEnumeratedType& operator =( + const CompleteEnumeratedType& x) + { + + m_enum_flags = x.m_enum_flags; + + m_header = x.m_header; + + m_literal_seq = x.m_literal_seq; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteEnumeratedType that will be copied. + */ + eProsima_user_DllExport CompleteEnumeratedType& operator =( + CompleteEnumeratedType&& x) noexcept + { + + m_enum_flags = std::move(x.m_enum_flags); + m_header = std::move(x.m_header); + m_literal_seq = std::move(x.m_literal_seq); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteEnumeratedType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteEnumeratedType& x) const + { + return (m_enum_flags == x.m_enum_flags && + m_header == x.m_header && + m_literal_seq == x.m_literal_seq); + } + + /*! + * @brief Comparison operator. + * @param x CompleteEnumeratedType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteEnumeratedType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member enum_flags + * @param _enum_flags New value to be copied in member enum_flags + */ + eProsima_user_DllExport void enum_flags( + const EnumTypeFlag& _enum_flags) + { + m_enum_flags = _enum_flags; + } + + /*! + * @brief This function moves the value in member enum_flags + * @param _enum_flags New value to be moved in member enum_flags + */ + eProsima_user_DllExport void enum_flags( + EnumTypeFlag&& _enum_flags) + { + m_enum_flags = std::move(_enum_flags); + } + + /*! + * @brief This function returns a constant reference to member enum_flags + * @return Constant reference to member enum_flags + */ + eProsima_user_DllExport const EnumTypeFlag& enum_flags() const + { + return m_enum_flags; + } + + /*! + * @brief This function returns a reference to member enum_flags + * @return Reference to member enum_flags + */ + eProsima_user_DllExport EnumTypeFlag& enum_flags() + { + return m_enum_flags; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const CompleteEnumeratedHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + CompleteEnumeratedHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const CompleteEnumeratedHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport CompleteEnumeratedHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member literal_seq + * @param _literal_seq New value to be copied in member literal_seq + */ + eProsima_user_DllExport void literal_seq( + const CompleteEnumeratedLiteralSeq& _literal_seq) + { + m_literal_seq = _literal_seq; + } + + /*! + * @brief This function moves the value in member literal_seq + * @param _literal_seq New value to be moved in member literal_seq + */ + eProsima_user_DllExport void literal_seq( + CompleteEnumeratedLiteralSeq&& _literal_seq) + { + m_literal_seq = std::move(_literal_seq); + } + + /*! + * @brief This function returns a constant reference to member literal_seq + * @return Constant reference to member literal_seq + */ + eProsima_user_DllExport const CompleteEnumeratedLiteralSeq& literal_seq() const + { + return m_literal_seq; + } + + /*! + * @brief This function returns a reference to member literal_seq + * @return Reference to member literal_seq + */ + eProsima_user_DllExport CompleteEnumeratedLiteralSeq& literal_seq() + { + return m_literal_seq; + } + + + +private: + + EnumTypeFlag m_enum_flags{0}; + CompleteEnumeratedHeader m_header; + CompleteEnumeratedLiteralSeq m_literal_seq; + +}; +/*! + * @brief This class represents the structure MinimalEnumeratedType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalEnumeratedType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalEnumeratedType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalEnumeratedType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalEnumeratedType that will be copied. + */ + eProsima_user_DllExport MinimalEnumeratedType( + const MinimalEnumeratedType& x) + { + m_enum_flags = x.m_enum_flags; + + m_header = x.m_header; + + m_literal_seq = x.m_literal_seq; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalEnumeratedType that will be copied. + */ + eProsima_user_DllExport MinimalEnumeratedType( + MinimalEnumeratedType&& x) noexcept + { + m_enum_flags = std::move(x.m_enum_flags); + m_header = std::move(x.m_header); + m_literal_seq = std::move(x.m_literal_seq); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalEnumeratedType that will be copied. + */ + eProsima_user_DllExport MinimalEnumeratedType& operator =( + const MinimalEnumeratedType& x) + { + + m_enum_flags = x.m_enum_flags; + + m_header = x.m_header; + + m_literal_seq = x.m_literal_seq; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalEnumeratedType that will be copied. + */ + eProsima_user_DllExport MinimalEnumeratedType& operator =( + MinimalEnumeratedType&& x) noexcept + { + + m_enum_flags = std::move(x.m_enum_flags); + m_header = std::move(x.m_header); + m_literal_seq = std::move(x.m_literal_seq); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalEnumeratedType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalEnumeratedType& x) const + { + return (m_enum_flags == x.m_enum_flags && + m_header == x.m_header && + m_literal_seq == x.m_literal_seq); + } + + /*! + * @brief Comparison operator. + * @param x MinimalEnumeratedType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalEnumeratedType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member enum_flags + * @param _enum_flags New value to be copied in member enum_flags + */ + eProsima_user_DllExport void enum_flags( + const EnumTypeFlag& _enum_flags) + { + m_enum_flags = _enum_flags; + } + + /*! + * @brief This function moves the value in member enum_flags + * @param _enum_flags New value to be moved in member enum_flags + */ + eProsima_user_DllExport void enum_flags( + EnumTypeFlag&& _enum_flags) + { + m_enum_flags = std::move(_enum_flags); + } + + /*! + * @brief This function returns a constant reference to member enum_flags + * @return Constant reference to member enum_flags + */ + eProsima_user_DllExport const EnumTypeFlag& enum_flags() const + { + return m_enum_flags; + } + + /*! + * @brief This function returns a reference to member enum_flags + * @return Reference to member enum_flags + */ + eProsima_user_DllExport EnumTypeFlag& enum_flags() + { + return m_enum_flags; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const MinimalEnumeratedHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + MinimalEnumeratedHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const MinimalEnumeratedHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport MinimalEnumeratedHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member literal_seq + * @param _literal_seq New value to be copied in member literal_seq + */ + eProsima_user_DllExport void literal_seq( + const MinimalEnumeratedLiteralSeq& _literal_seq) + { + m_literal_seq = _literal_seq; + } + + /*! + * @brief This function moves the value in member literal_seq + * @param _literal_seq New value to be moved in member literal_seq + */ + eProsima_user_DllExport void literal_seq( + MinimalEnumeratedLiteralSeq&& _literal_seq) + { + m_literal_seq = std::move(_literal_seq); + } + + /*! + * @brief This function returns a constant reference to member literal_seq + * @return Constant reference to member literal_seq + */ + eProsima_user_DllExport const MinimalEnumeratedLiteralSeq& literal_seq() const + { + return m_literal_seq; + } + + /*! + * @brief This function returns a reference to member literal_seq + * @return Reference to member literal_seq + */ + eProsima_user_DllExport MinimalEnumeratedLiteralSeq& literal_seq() + { + return m_literal_seq; + } + + + +private: + + EnumTypeFlag m_enum_flags{0}; + MinimalEnumeratedHeader m_header; + MinimalEnumeratedLiteralSeq m_literal_seq; + +}; +/*! + * @brief This class represents the structure CommonBitflag defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonBitflag +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CommonBitflag() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CommonBitflag() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CommonBitflag that will be copied. + */ + eProsima_user_DllExport CommonBitflag( + const CommonBitflag& x) + { + m_position = x.m_position; + + m_flags = x.m_flags; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CommonBitflag that will be copied. + */ + eProsima_user_DllExport CommonBitflag( + CommonBitflag&& x) noexcept + { + m_position = x.m_position; + m_flags = std::move(x.m_flags); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CommonBitflag that will be copied. + */ + eProsima_user_DllExport CommonBitflag& operator =( + const CommonBitflag& x) + { + + m_position = x.m_position; + + m_flags = x.m_flags; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CommonBitflag that will be copied. + */ + eProsima_user_DllExport CommonBitflag& operator =( + CommonBitflag&& x) noexcept + { + + m_position = x.m_position; + m_flags = std::move(x.m_flags); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CommonBitflag object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CommonBitflag& x) const + { + return (m_position == x.m_position && + m_flags == x.m_flags); + } + + /*! + * @brief Comparison operator. + * @param x CommonBitflag object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CommonBitflag& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member position + * @param _position New value for member position + */ + eProsima_user_DllExport void position( + uint16_t _position) + { + m_position = _position; + } + + /*! + * @brief This function returns the value of member position + * @return Value of member position + */ + eProsima_user_DllExport uint16_t position() const + { + return m_position; + } + + /*! + * @brief This function returns a reference to member position + * @return Reference to member position + */ + eProsima_user_DllExport uint16_t& position() + { + return m_position; + } + + + /*! + * @brief This function copies the value in member flags + * @param _flags New value to be copied in member flags + */ + eProsima_user_DllExport void flags( + const BitflagFlag& _flags) + { + m_flags = _flags; + } + + /*! + * @brief This function moves the value in member flags + * @param _flags New value to be moved in member flags + */ + eProsima_user_DllExport void flags( + BitflagFlag&& _flags) + { + m_flags = std::move(_flags); + } + + /*! + * @brief This function returns a constant reference to member flags + * @return Constant reference to member flags + */ + eProsima_user_DllExport const BitflagFlag& flags() const + { + return m_flags; + } + + /*! + * @brief This function returns a reference to member flags + * @return Reference to member flags + */ + eProsima_user_DllExport BitflagFlag& flags() + { + return m_flags; + } + + + +private: + + uint16_t m_position{0}; + BitflagFlag m_flags{0}; + +}; +/*! + * @brief This class represents the structure CompleteBitflag defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteBitflag +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteBitflag() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteBitflag() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteBitflag that will be copied. + */ + eProsima_user_DllExport CompleteBitflag( + const CompleteBitflag& x) + { + m_common = x.m_common; + + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteBitflag that will be copied. + */ + eProsima_user_DllExport CompleteBitflag( + CompleteBitflag&& x) noexcept + { + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteBitflag that will be copied. + */ + eProsima_user_DllExport CompleteBitflag& operator =( + const CompleteBitflag& x) + { + + m_common = x.m_common; + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteBitflag that will be copied. + */ + eProsima_user_DllExport CompleteBitflag& operator =( + CompleteBitflag&& x) noexcept + { + + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteBitflag object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteBitflag& x) const + { + return (m_common == x.m_common && + m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x CompleteBitflag object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteBitflag& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonBitflag& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonBitflag&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonBitflag& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonBitflag& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const CompleteMemberDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + CompleteMemberDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const CompleteMemberDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport CompleteMemberDetail& detail() + { + return m_detail; + } + + + +private: + + CommonBitflag m_common; + CompleteMemberDetail m_detail; + +}; +typedef std::vector CompleteBitflagSeq; + +/*! + * @brief This class represents the structure MinimalBitflag defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalBitflag +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalBitflag() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalBitflag() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalBitflag that will be copied. + */ + eProsima_user_DllExport MinimalBitflag( + const MinimalBitflag& x) + { + m_common = x.m_common; + + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalBitflag that will be copied. + */ + eProsima_user_DllExport MinimalBitflag( + MinimalBitflag&& x) noexcept + { + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalBitflag that will be copied. + */ + eProsima_user_DllExport MinimalBitflag& operator =( + const MinimalBitflag& x) + { + + m_common = x.m_common; + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalBitflag that will be copied. + */ + eProsima_user_DllExport MinimalBitflag& operator =( + MinimalBitflag&& x) noexcept + { + + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalBitflag object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalBitflag& x) const + { + return (m_common == x.m_common && + m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x MinimalBitflag object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalBitflag& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonBitflag& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonBitflag&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonBitflag& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonBitflag& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const MinimalMemberDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + MinimalMemberDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const MinimalMemberDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport MinimalMemberDetail& detail() + { + return m_detail; + } + + + +private: + + CommonBitflag m_common; + MinimalMemberDetail m_detail; + +}; +typedef std::vector MinimalBitflagSeq; + +/*! + * @brief This class represents the structure CommonBitmaskHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonBitmaskHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CommonBitmaskHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CommonBitmaskHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CommonBitmaskHeader that will be copied. + */ + eProsima_user_DllExport CommonBitmaskHeader( + const CommonBitmaskHeader& x) + { + m_bit_bound = x.m_bit_bound; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CommonBitmaskHeader that will be copied. + */ + eProsima_user_DllExport CommonBitmaskHeader( + CommonBitmaskHeader&& x) noexcept + { + m_bit_bound = x.m_bit_bound; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CommonBitmaskHeader that will be copied. + */ + eProsima_user_DllExport CommonBitmaskHeader& operator =( + const CommonBitmaskHeader& x) + { + + m_bit_bound = x.m_bit_bound; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CommonBitmaskHeader that will be copied. + */ + eProsima_user_DllExport CommonBitmaskHeader& operator =( + CommonBitmaskHeader&& x) noexcept + { + + m_bit_bound = x.m_bit_bound; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CommonBitmaskHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CommonBitmaskHeader& x) const + { + return (m_bit_bound == x.m_bit_bound); + } + + /*! + * @brief Comparison operator. + * @param x CommonBitmaskHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CommonBitmaskHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member bit_bound + * @param _bit_bound New value for member bit_bound + */ + eProsima_user_DllExport void bit_bound( + BitBound _bit_bound) + { + m_bit_bound = _bit_bound; + } + + /*! + * @brief This function returns the value of member bit_bound + * @return Value of member bit_bound + */ + eProsima_user_DllExport BitBound bit_bound() const + { + return m_bit_bound; + } + + /*! + * @brief This function returns a reference to member bit_bound + * @return Reference to member bit_bound + */ + eProsima_user_DllExport BitBound& bit_bound() + { + return m_bit_bound; + } + + + +private: + + BitBound m_bit_bound{0}; + +}; +typedef CompleteEnumeratedHeader CompleteBitmaskHeader; + +typedef MinimalEnumeratedHeader MinimalBitmaskHeader; + +/*! + * @brief This class represents the structure CompleteBitmaskType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteBitmaskType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteBitmaskType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteBitmaskType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteBitmaskType that will be copied. + */ + eProsima_user_DllExport CompleteBitmaskType( + const CompleteBitmaskType& x) + { + m_bitmask_flags = x.m_bitmask_flags; + + m_header = x.m_header; + + m_flag_seq = x.m_flag_seq; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteBitmaskType that will be copied. + */ + eProsima_user_DllExport CompleteBitmaskType( + CompleteBitmaskType&& x) noexcept + { + m_bitmask_flags = std::move(x.m_bitmask_flags); + m_header = std::move(x.m_header); + m_flag_seq = std::move(x.m_flag_seq); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteBitmaskType that will be copied. + */ + eProsima_user_DllExport CompleteBitmaskType& operator =( + const CompleteBitmaskType& x) + { + + m_bitmask_flags = x.m_bitmask_flags; + + m_header = x.m_header; + + m_flag_seq = x.m_flag_seq; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteBitmaskType that will be copied. + */ + eProsima_user_DllExport CompleteBitmaskType& operator =( + CompleteBitmaskType&& x) noexcept + { + + m_bitmask_flags = std::move(x.m_bitmask_flags); + m_header = std::move(x.m_header); + m_flag_seq = std::move(x.m_flag_seq); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteBitmaskType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteBitmaskType& x) const + { + return (m_bitmask_flags == x.m_bitmask_flags && + m_header == x.m_header && + m_flag_seq == x.m_flag_seq); + } + + /*! + * @brief Comparison operator. + * @param x CompleteBitmaskType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteBitmaskType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member bitmask_flags + * @param _bitmask_flags New value to be copied in member bitmask_flags + */ + eProsima_user_DllExport void bitmask_flags( + const BitmaskTypeFlag& _bitmask_flags) + { + m_bitmask_flags = _bitmask_flags; + } + + /*! + * @brief This function moves the value in member bitmask_flags + * @param _bitmask_flags New value to be moved in member bitmask_flags + */ + eProsima_user_DllExport void bitmask_flags( + BitmaskTypeFlag&& _bitmask_flags) + { + m_bitmask_flags = std::move(_bitmask_flags); + } + + /*! + * @brief This function returns a constant reference to member bitmask_flags + * @return Constant reference to member bitmask_flags + */ + eProsima_user_DllExport const BitmaskTypeFlag& bitmask_flags() const + { + return m_bitmask_flags; + } + + /*! + * @brief This function returns a reference to member bitmask_flags + * @return Reference to member bitmask_flags + */ + eProsima_user_DllExport BitmaskTypeFlag& bitmask_flags() + { + return m_bitmask_flags; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const CompleteBitmaskHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + CompleteBitmaskHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const CompleteBitmaskHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport CompleteBitmaskHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member flag_seq + * @param _flag_seq New value to be copied in member flag_seq + */ + eProsima_user_DllExport void flag_seq( + const CompleteBitflagSeq& _flag_seq) + { + m_flag_seq = _flag_seq; + } + + /*! + * @brief This function moves the value in member flag_seq + * @param _flag_seq New value to be moved in member flag_seq + */ + eProsima_user_DllExport void flag_seq( + CompleteBitflagSeq&& _flag_seq) + { + m_flag_seq = std::move(_flag_seq); + } + + /*! + * @brief This function returns a constant reference to member flag_seq + * @return Constant reference to member flag_seq + */ + eProsima_user_DllExport const CompleteBitflagSeq& flag_seq() const + { + return m_flag_seq; + } + + /*! + * @brief This function returns a reference to member flag_seq + * @return Reference to member flag_seq + */ + eProsima_user_DllExport CompleteBitflagSeq& flag_seq() + { + return m_flag_seq; + } + + + +private: + + BitmaskTypeFlag m_bitmask_flags{0}; + CompleteBitmaskHeader m_header; + CompleteBitflagSeq m_flag_seq; + +}; +/*! + * @brief This class represents the structure MinimalBitmaskType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalBitmaskType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalBitmaskType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalBitmaskType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalBitmaskType that will be copied. + */ + eProsima_user_DllExport MinimalBitmaskType( + const MinimalBitmaskType& x) + { + m_bitmask_flags = x.m_bitmask_flags; + + m_header = x.m_header; + + m_flag_seq = x.m_flag_seq; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalBitmaskType that will be copied. + */ + eProsima_user_DllExport MinimalBitmaskType( + MinimalBitmaskType&& x) noexcept + { + m_bitmask_flags = std::move(x.m_bitmask_flags); + m_header = std::move(x.m_header); + m_flag_seq = std::move(x.m_flag_seq); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalBitmaskType that will be copied. + */ + eProsima_user_DllExport MinimalBitmaskType& operator =( + const MinimalBitmaskType& x) + { + + m_bitmask_flags = x.m_bitmask_flags; + + m_header = x.m_header; + + m_flag_seq = x.m_flag_seq; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalBitmaskType that will be copied. + */ + eProsima_user_DllExport MinimalBitmaskType& operator =( + MinimalBitmaskType&& x) noexcept + { + + m_bitmask_flags = std::move(x.m_bitmask_flags); + m_header = std::move(x.m_header); + m_flag_seq = std::move(x.m_flag_seq); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalBitmaskType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalBitmaskType& x) const + { + return (m_bitmask_flags == x.m_bitmask_flags && + m_header == x.m_header && + m_flag_seq == x.m_flag_seq); + } + + /*! + * @brief Comparison operator. + * @param x MinimalBitmaskType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalBitmaskType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member bitmask_flags + * @param _bitmask_flags New value to be copied in member bitmask_flags + */ + eProsima_user_DllExport void bitmask_flags( + const BitmaskTypeFlag& _bitmask_flags) + { + m_bitmask_flags = _bitmask_flags; + } + + /*! + * @brief This function moves the value in member bitmask_flags + * @param _bitmask_flags New value to be moved in member bitmask_flags + */ + eProsima_user_DllExport void bitmask_flags( + BitmaskTypeFlag&& _bitmask_flags) + { + m_bitmask_flags = std::move(_bitmask_flags); + } + + /*! + * @brief This function returns a constant reference to member bitmask_flags + * @return Constant reference to member bitmask_flags + */ + eProsima_user_DllExport const BitmaskTypeFlag& bitmask_flags() const + { + return m_bitmask_flags; + } + + /*! + * @brief This function returns a reference to member bitmask_flags + * @return Reference to member bitmask_flags + */ + eProsima_user_DllExport BitmaskTypeFlag& bitmask_flags() + { + return m_bitmask_flags; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const MinimalBitmaskHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + MinimalBitmaskHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const MinimalBitmaskHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport MinimalBitmaskHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member flag_seq + * @param _flag_seq New value to be copied in member flag_seq + */ + eProsima_user_DllExport void flag_seq( + const MinimalBitflagSeq& _flag_seq) + { + m_flag_seq = _flag_seq; + } + + /*! + * @brief This function moves the value in member flag_seq + * @param _flag_seq New value to be moved in member flag_seq + */ + eProsima_user_DllExport void flag_seq( + MinimalBitflagSeq&& _flag_seq) + { + m_flag_seq = std::move(_flag_seq); + } + + /*! + * @brief This function returns a constant reference to member flag_seq + * @return Constant reference to member flag_seq + */ + eProsima_user_DllExport const MinimalBitflagSeq& flag_seq() const + { + return m_flag_seq; + } + + /*! + * @brief This function returns a reference to member flag_seq + * @return Reference to member flag_seq + */ + eProsima_user_DllExport MinimalBitflagSeq& flag_seq() + { + return m_flag_seq; + } + + + +private: + + BitmaskTypeFlag m_bitmask_flags{0}; + MinimalBitmaskHeader m_header; + MinimalBitflagSeq m_flag_seq; + +}; +/*! + * @brief This class represents the structure CommonBitfield defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonBitfield +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CommonBitfield() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CommonBitfield() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CommonBitfield that will be copied. + */ + eProsima_user_DllExport CommonBitfield( + const CommonBitfield& x) + { + m_position = x.m_position; + + m_flags = x.m_flags; + + m_bitcount = x.m_bitcount; + + m_holder_type = x.m_holder_type; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CommonBitfield that will be copied. + */ + eProsima_user_DllExport CommonBitfield( + CommonBitfield&& x) noexcept + { + m_position = x.m_position; + m_flags = std::move(x.m_flags); + m_bitcount = x.m_bitcount; + m_holder_type = x.m_holder_type; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CommonBitfield that will be copied. + */ + eProsima_user_DllExport CommonBitfield& operator =( + const CommonBitfield& x) + { + + m_position = x.m_position; + + m_flags = x.m_flags; + + m_bitcount = x.m_bitcount; + + m_holder_type = x.m_holder_type; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CommonBitfield that will be copied. + */ + eProsima_user_DllExport CommonBitfield& operator =( + CommonBitfield&& x) noexcept + { + + m_position = x.m_position; + m_flags = std::move(x.m_flags); + m_bitcount = x.m_bitcount; + m_holder_type = x.m_holder_type; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CommonBitfield object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CommonBitfield& x) const + { + return (m_position == x.m_position && + m_flags == x.m_flags && + m_bitcount == x.m_bitcount && + m_holder_type == x.m_holder_type); + } + + /*! + * @brief Comparison operator. + * @param x CommonBitfield object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CommonBitfield& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member position + * @param _position New value for member position + */ + eProsima_user_DllExport void position( + uint16_t _position) + { + m_position = _position; + } + + /*! + * @brief This function returns the value of member position + * @return Value of member position + */ + eProsima_user_DllExport uint16_t position() const + { + return m_position; + } + + /*! + * @brief This function returns a reference to member position + * @return Reference to member position + */ + eProsima_user_DllExport uint16_t& position() + { + return m_position; + } + + + /*! + * @brief This function copies the value in member flags + * @param _flags New value to be copied in member flags + */ + eProsima_user_DllExport void flags( + const BitsetMemberFlag& _flags) + { + m_flags = _flags; + } + + /*! + * @brief This function moves the value in member flags + * @param _flags New value to be moved in member flags + */ + eProsima_user_DllExport void flags( + BitsetMemberFlag&& _flags) + { + m_flags = std::move(_flags); + } + + /*! + * @brief This function returns a constant reference to member flags + * @return Constant reference to member flags + */ + eProsima_user_DllExport const BitsetMemberFlag& flags() const + { + return m_flags; + } + + /*! + * @brief This function returns a reference to member flags + * @return Reference to member flags + */ + eProsima_user_DllExport BitsetMemberFlag& flags() + { + return m_flags; + } + + + /*! + * @brief This function sets a value in member bitcount + * @param _bitcount New value for member bitcount + */ + eProsima_user_DllExport void bitcount( + uint8_t _bitcount) + { + m_bitcount = _bitcount; + } + + /*! + * @brief This function returns the value of member bitcount + * @return Value of member bitcount + */ + eProsima_user_DllExport uint8_t bitcount() const + { + return m_bitcount; + } + + /*! + * @brief This function returns a reference to member bitcount + * @return Reference to member bitcount + */ + eProsima_user_DllExport uint8_t& bitcount() + { + return m_bitcount; + } + + + /*! + * @brief This function sets a value in member holder_type + * @param _holder_type New value for member holder_type + */ + eProsima_user_DllExport void holder_type( + TypeKind _holder_type) + { + m_holder_type = _holder_type; + } + + /*! + * @brief This function returns the value of member holder_type + * @return Value of member holder_type + */ + eProsima_user_DllExport TypeKind holder_type() const + { + return m_holder_type; + } + + /*! + * @brief This function returns a reference to member holder_type + * @return Reference to member holder_type + */ + eProsima_user_DllExport TypeKind& holder_type() + { + return m_holder_type; + } + + + +private: + + uint16_t m_position{0}; + BitsetMemberFlag m_flags{0}; + uint8_t m_bitcount{0}; + TypeKind m_holder_type{0}; + +}; +/*! + * @brief This class represents the structure CompleteBitfield defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteBitfield +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteBitfield() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteBitfield() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteBitfield that will be copied. + */ + eProsima_user_DllExport CompleteBitfield( + const CompleteBitfield& x) + { + m_common = x.m_common; + + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteBitfield that will be copied. + */ + eProsima_user_DllExport CompleteBitfield( + CompleteBitfield&& x) noexcept + { + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteBitfield that will be copied. + */ + eProsima_user_DllExport CompleteBitfield& operator =( + const CompleteBitfield& x) + { + + m_common = x.m_common; + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteBitfield that will be copied. + */ + eProsima_user_DllExport CompleteBitfield& operator =( + CompleteBitfield&& x) noexcept + { + + m_common = std::move(x.m_common); + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteBitfield object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteBitfield& x) const + { + return (m_common == x.m_common && + m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x CompleteBitfield object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteBitfield& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonBitfield& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonBitfield&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonBitfield& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonBitfield& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const CompleteMemberDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + CompleteMemberDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const CompleteMemberDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport CompleteMemberDetail& detail() + { + return m_detail; + } + + + +private: + + CommonBitfield m_common; + CompleteMemberDetail m_detail; + +}; +typedef std::vector CompleteBitfieldSeq; + +/*! + * @brief This class represents the structure MinimalBitfield defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalBitfield +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalBitfield() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalBitfield() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalBitfield that will be copied. + */ + eProsima_user_DllExport MinimalBitfield( + const MinimalBitfield& x) + { + m_common = x.m_common; + + m_name_hash = x.m_name_hash; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalBitfield that will be copied. + */ + eProsima_user_DllExport MinimalBitfield( + MinimalBitfield&& x) noexcept + { + m_common = std::move(x.m_common); + m_name_hash = std::move(x.m_name_hash); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalBitfield that will be copied. + */ + eProsima_user_DllExport MinimalBitfield& operator =( + const MinimalBitfield& x) + { + + m_common = x.m_common; + + m_name_hash = x.m_name_hash; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalBitfield that will be copied. + */ + eProsima_user_DllExport MinimalBitfield& operator =( + MinimalBitfield&& x) noexcept + { + + m_common = std::move(x.m_common); + m_name_hash = std::move(x.m_name_hash); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalBitfield object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalBitfield& x) const + { + return (m_common == x.m_common && + m_name_hash == x.m_name_hash); + } + + /*! + * @brief Comparison operator. + * @param x MinimalBitfield object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalBitfield& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member common + * @param _common New value to be copied in member common + */ + eProsima_user_DllExport void common( + const CommonBitfield& _common) + { + m_common = _common; + } + + /*! + * @brief This function moves the value in member common + * @param _common New value to be moved in member common + */ + eProsima_user_DllExport void common( + CommonBitfield&& _common) + { + m_common = std::move(_common); + } + + /*! + * @brief This function returns a constant reference to member common + * @return Constant reference to member common + */ + eProsima_user_DllExport const CommonBitfield& common() const + { + return m_common; + } + + /*! + * @brief This function returns a reference to member common + * @return Reference to member common + */ + eProsima_user_DllExport CommonBitfield& common() + { + return m_common; + } + + + /*! + * @brief This function copies the value in member name_hash + * @param _name_hash New value to be copied in member name_hash + */ + eProsima_user_DllExport void name_hash( + const NameHash& _name_hash) + { + m_name_hash = _name_hash; + } + + /*! + * @brief This function moves the value in member name_hash + * @param _name_hash New value to be moved in member name_hash + */ + eProsima_user_DllExport void name_hash( + NameHash&& _name_hash) + { + m_name_hash = std::move(_name_hash); + } + + /*! + * @brief This function returns a constant reference to member name_hash + * @return Constant reference to member name_hash + */ + eProsima_user_DllExport const NameHash& name_hash() const + { + return m_name_hash; + } + + /*! + * @brief This function returns a reference to member name_hash + * @return Reference to member name_hash + */ + eProsima_user_DllExport NameHash& name_hash() + { + return m_name_hash; + } + + + +private: + + CommonBitfield m_common; + NameHash m_name_hash{0}; + +}; +typedef std::vector MinimalBitfieldSeq; + +/*! + * @brief This class represents the structure CompleteBitsetHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteBitsetHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteBitsetHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteBitsetHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteBitsetHeader that will be copied. + */ + eProsima_user_DllExport CompleteBitsetHeader( + const CompleteBitsetHeader& x) + { + m_detail = x.m_detail; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteBitsetHeader that will be copied. + */ + eProsima_user_DllExport CompleteBitsetHeader( + CompleteBitsetHeader&& x) noexcept + { + m_detail = std::move(x.m_detail); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteBitsetHeader that will be copied. + */ + eProsima_user_DllExport CompleteBitsetHeader& operator =( + const CompleteBitsetHeader& x) + { + + m_detail = x.m_detail; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteBitsetHeader that will be copied. + */ + eProsima_user_DllExport CompleteBitsetHeader& operator =( + CompleteBitsetHeader&& x) noexcept + { + + m_detail = std::move(x.m_detail); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteBitsetHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteBitsetHeader& x) const + { + return (m_detail == x.m_detail); + } + + /*! + * @brief Comparison operator. + * @param x CompleteBitsetHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteBitsetHeader& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member detail + * @param _detail New value to be copied in member detail + */ + eProsima_user_DllExport void detail( + const CompleteTypeDetail& _detail) + { + m_detail = _detail; + } + + /*! + * @brief This function moves the value in member detail + * @param _detail New value to be moved in member detail + */ + eProsima_user_DllExport void detail( + CompleteTypeDetail&& _detail) + { + m_detail = std::move(_detail); + } + + /*! + * @brief This function returns a constant reference to member detail + * @return Constant reference to member detail + */ + eProsima_user_DllExport const CompleteTypeDetail& detail() const + { + return m_detail; + } + + /*! + * @brief This function returns a reference to member detail + * @return Reference to member detail + */ + eProsima_user_DllExport CompleteTypeDetail& detail() + { + return m_detail; + } + + + +private: + + CompleteTypeDetail m_detail; + +}; +/*! + * @brief This class represents the structure MinimalBitsetHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalBitsetHeader +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalBitsetHeader() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalBitsetHeader() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalBitsetHeader that will be copied. + */ + eProsima_user_DllExport MinimalBitsetHeader( + const MinimalBitsetHeader& x) + { + static_cast(x); + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalBitsetHeader that will be copied. + */ + eProsima_user_DllExport MinimalBitsetHeader( + MinimalBitsetHeader&& x) noexcept + { + static_cast(x); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalBitsetHeader that will be copied. + */ + eProsima_user_DllExport MinimalBitsetHeader& operator =( + const MinimalBitsetHeader& x) + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalBitsetHeader that will be copied. + */ + eProsima_user_DllExport MinimalBitsetHeader& operator =( + MinimalBitsetHeader&& x) noexcept + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalBitsetHeader object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalBitsetHeader& x) const + { + static_cast(x); + return true; + } + + /*! + * @brief Comparison operator. + * @param x MinimalBitsetHeader object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalBitsetHeader& x) const + { + return !(*this == x); + } + + + +private: + + +}; +/*! + * @brief This class represents the structure CompleteBitsetType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteBitsetType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteBitsetType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteBitsetType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteBitsetType that will be copied. + */ + eProsima_user_DllExport CompleteBitsetType( + const CompleteBitsetType& x) + { + m_bitset_flags = x.m_bitset_flags; + + m_header = x.m_header; + + m_field_seq = x.m_field_seq; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteBitsetType that will be copied. + */ + eProsima_user_DllExport CompleteBitsetType( + CompleteBitsetType&& x) noexcept + { + m_bitset_flags = std::move(x.m_bitset_flags); + m_header = std::move(x.m_header); + m_field_seq = std::move(x.m_field_seq); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteBitsetType that will be copied. + */ + eProsima_user_DllExport CompleteBitsetType& operator =( + const CompleteBitsetType& x) + { + + m_bitset_flags = x.m_bitset_flags; + + m_header = x.m_header; + + m_field_seq = x.m_field_seq; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteBitsetType that will be copied. + */ + eProsima_user_DllExport CompleteBitsetType& operator =( + CompleteBitsetType&& x) noexcept + { + + m_bitset_flags = std::move(x.m_bitset_flags); + m_header = std::move(x.m_header); + m_field_seq = std::move(x.m_field_seq); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteBitsetType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteBitsetType& x) const + { + return (m_bitset_flags == x.m_bitset_flags && + m_header == x.m_header && + m_field_seq == x.m_field_seq); + } + + /*! + * @brief Comparison operator. + * @param x CompleteBitsetType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteBitsetType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member bitset_flags + * @param _bitset_flags New value to be copied in member bitset_flags + */ + eProsima_user_DllExport void bitset_flags( + const BitsetTypeFlag& _bitset_flags) + { + m_bitset_flags = _bitset_flags; + } + + /*! + * @brief This function moves the value in member bitset_flags + * @param _bitset_flags New value to be moved in member bitset_flags + */ + eProsima_user_DllExport void bitset_flags( + BitsetTypeFlag&& _bitset_flags) + { + m_bitset_flags = std::move(_bitset_flags); + } + + /*! + * @brief This function returns a constant reference to member bitset_flags + * @return Constant reference to member bitset_flags + */ + eProsima_user_DllExport const BitsetTypeFlag& bitset_flags() const + { + return m_bitset_flags; + } + + /*! + * @brief This function returns a reference to member bitset_flags + * @return Reference to member bitset_flags + */ + eProsima_user_DllExport BitsetTypeFlag& bitset_flags() + { + return m_bitset_flags; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const CompleteBitsetHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + CompleteBitsetHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const CompleteBitsetHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport CompleteBitsetHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member field_seq + * @param _field_seq New value to be copied in member field_seq + */ + eProsima_user_DllExport void field_seq( + const CompleteBitfieldSeq& _field_seq) + { + m_field_seq = _field_seq; + } + + /*! + * @brief This function moves the value in member field_seq + * @param _field_seq New value to be moved in member field_seq + */ + eProsima_user_DllExport void field_seq( + CompleteBitfieldSeq&& _field_seq) + { + m_field_seq = std::move(_field_seq); + } + + /*! + * @brief This function returns a constant reference to member field_seq + * @return Constant reference to member field_seq + */ + eProsima_user_DllExport const CompleteBitfieldSeq& field_seq() const + { + return m_field_seq; + } + + /*! + * @brief This function returns a reference to member field_seq + * @return Reference to member field_seq + */ + eProsima_user_DllExport CompleteBitfieldSeq& field_seq() + { + return m_field_seq; + } + + + +private: + + BitsetTypeFlag m_bitset_flags{0}; + CompleteBitsetHeader m_header; + CompleteBitfieldSeq m_field_seq; + +}; +/*! + * @brief This class represents the structure MinimalBitsetType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalBitsetType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalBitsetType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalBitsetType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalBitsetType that will be copied. + */ + eProsima_user_DllExport MinimalBitsetType( + const MinimalBitsetType& x) + { + m_bitset_flags = x.m_bitset_flags; + + m_header = x.m_header; + + m_field_seq = x.m_field_seq; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalBitsetType that will be copied. + */ + eProsima_user_DllExport MinimalBitsetType( + MinimalBitsetType&& x) noexcept + { + m_bitset_flags = std::move(x.m_bitset_flags); + m_header = std::move(x.m_header); + m_field_seq = std::move(x.m_field_seq); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalBitsetType that will be copied. + */ + eProsima_user_DllExport MinimalBitsetType& operator =( + const MinimalBitsetType& x) + { + + m_bitset_flags = x.m_bitset_flags; + + m_header = x.m_header; + + m_field_seq = x.m_field_seq; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalBitsetType that will be copied. + */ + eProsima_user_DllExport MinimalBitsetType& operator =( + MinimalBitsetType&& x) noexcept + { + + m_bitset_flags = std::move(x.m_bitset_flags); + m_header = std::move(x.m_header); + m_field_seq = std::move(x.m_field_seq); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalBitsetType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalBitsetType& x) const + { + return (m_bitset_flags == x.m_bitset_flags && + m_header == x.m_header && + m_field_seq == x.m_field_seq); + } + + /*! + * @brief Comparison operator. + * @param x MinimalBitsetType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalBitsetType& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member bitset_flags + * @param _bitset_flags New value to be copied in member bitset_flags + */ + eProsima_user_DllExport void bitset_flags( + const BitsetTypeFlag& _bitset_flags) + { + m_bitset_flags = _bitset_flags; + } + + /*! + * @brief This function moves the value in member bitset_flags + * @param _bitset_flags New value to be moved in member bitset_flags + */ + eProsima_user_DllExport void bitset_flags( + BitsetTypeFlag&& _bitset_flags) + { + m_bitset_flags = std::move(_bitset_flags); + } + + /*! + * @brief This function returns a constant reference to member bitset_flags + * @return Constant reference to member bitset_flags + */ + eProsima_user_DllExport const BitsetTypeFlag& bitset_flags() const + { + return m_bitset_flags; + } + + /*! + * @brief This function returns a reference to member bitset_flags + * @return Reference to member bitset_flags + */ + eProsima_user_DllExport BitsetTypeFlag& bitset_flags() + { + return m_bitset_flags; + } + + + /*! + * @brief This function copies the value in member header + * @param _header New value to be copied in member header + */ + eProsima_user_DllExport void header( + const MinimalBitsetHeader& _header) + { + m_header = _header; + } + + /*! + * @brief This function moves the value in member header + * @param _header New value to be moved in member header + */ + eProsima_user_DllExport void header( + MinimalBitsetHeader&& _header) + { + m_header = std::move(_header); + } + + /*! + * @brief This function returns a constant reference to member header + * @return Constant reference to member header + */ + eProsima_user_DllExport const MinimalBitsetHeader& header() const + { + return m_header; + } + + /*! + * @brief This function returns a reference to member header + * @return Reference to member header + */ + eProsima_user_DllExport MinimalBitsetHeader& header() + { + return m_header; + } + + + /*! + * @brief This function copies the value in member field_seq + * @param _field_seq New value to be copied in member field_seq + */ + eProsima_user_DllExport void field_seq( + const MinimalBitfieldSeq& _field_seq) + { + m_field_seq = _field_seq; + } + + /*! + * @brief This function moves the value in member field_seq + * @param _field_seq New value to be moved in member field_seq + */ + eProsima_user_DllExport void field_seq( + MinimalBitfieldSeq&& _field_seq) + { + m_field_seq = std::move(_field_seq); + } + + /*! + * @brief This function returns a constant reference to member field_seq + * @return Constant reference to member field_seq + */ + eProsima_user_DllExport const MinimalBitfieldSeq& field_seq() const + { + return m_field_seq; + } + + /*! + * @brief This function returns a reference to member field_seq + * @return Reference to member field_seq + */ + eProsima_user_DllExport MinimalBitfieldSeq& field_seq() + { + return m_field_seq; + } + + + +private: + + BitsetTypeFlag m_bitset_flags{0}; + MinimalBitsetHeader m_header; + MinimalBitfieldSeq m_field_seq; + +}; +/*! + * @brief This class represents the structure CompleteExtendedType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteExtendedType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteExtendedType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteExtendedType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteExtendedType that will be copied. + */ + eProsima_user_DllExport CompleteExtendedType( + const CompleteExtendedType& x) + { + static_cast(x); + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteExtendedType that will be copied. + */ + eProsima_user_DllExport CompleteExtendedType( + CompleteExtendedType&& x) noexcept + { + static_cast(x); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteExtendedType that will be copied. + */ + eProsima_user_DllExport CompleteExtendedType& operator =( + const CompleteExtendedType& x) + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteExtendedType that will be copied. + */ + eProsima_user_DllExport CompleteExtendedType& operator =( + CompleteExtendedType&& x) noexcept + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteExtendedType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteExtendedType& x) const + { + static_cast(x); + return true; + } + + /*! + * @brief Comparison operator. + * @param x CompleteExtendedType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteExtendedType& x) const + { + return !(*this == x); + } + + + +private: + + +}; +/*! + * @brief This class represents the union CompleteTypeObject defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteTypeObject +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport CompleteTypeObject() + { + extended_type_(); + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~CompleteTypeObject() + { + if (member_destructor_) + { + member_destructor_(); + } + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object CompleteTypeObject that will be copied. + */ + eProsima_user_DllExport CompleteTypeObject( + const CompleteTypeObject& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + alias_type_() = x.m_alias_type; + break; + + case 0x00000002: + annotation_type_() = x.m_annotation_type; + break; + + case 0x00000003: + struct_type_() = x.m_struct_type; + break; + + case 0x00000004: + union_type_() = x.m_union_type; + break; + + case 0x00000005: + bitset_type_() = x.m_bitset_type; + break; + + case 0x00000006: + sequence_type_() = x.m_sequence_type; + break; + + case 0x00000007: + array_type_() = x.m_array_type; + break; + + case 0x00000008: + map_type_() = x.m_map_type; + break; + + case 0x00000009: + enumerated_type_() = x.m_enumerated_type; + break; + + case 0x0000000a: + bitmask_type_() = x.m_bitmask_type; + break; + + case 0x0000000b: + extended_type_() = x.m_extended_type; + break; + + } + } + + /*! + * @brief Move constructor. + * @param x Reference to the object CompleteTypeObject that will be copied. + */ + eProsima_user_DllExport CompleteTypeObject( + CompleteTypeObject&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + alias_type_() = std::move(x.m_alias_type); + break; + + case 0x00000002: + annotation_type_() = std::move(x.m_annotation_type); + break; + + case 0x00000003: + struct_type_() = std::move(x.m_struct_type); + break; + + case 0x00000004: + union_type_() = std::move(x.m_union_type); + break; + + case 0x00000005: + bitset_type_() = std::move(x.m_bitset_type); + break; + + case 0x00000006: + sequence_type_() = std::move(x.m_sequence_type); + break; + + case 0x00000007: + array_type_() = std::move(x.m_array_type); + break; + + case 0x00000008: + map_type_() = std::move(x.m_map_type); + break; + + case 0x00000009: + enumerated_type_() = std::move(x.m_enumerated_type); + break; + + case 0x0000000a: + bitmask_type_() = std::move(x.m_bitmask_type); + break; + + case 0x0000000b: + extended_type_() = std::move(x.m_extended_type); + break; + + } + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object CompleteTypeObject that will be copied. + */ + eProsima_user_DllExport CompleteTypeObject& operator =( + const CompleteTypeObject& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + alias_type_() = x.m_alias_type; + break; + + case 0x00000002: + annotation_type_() = x.m_annotation_type; + break; + + case 0x00000003: + struct_type_() = x.m_struct_type; + break; + + case 0x00000004: + union_type_() = x.m_union_type; + break; + + case 0x00000005: + bitset_type_() = x.m_bitset_type; + break; + + case 0x00000006: + sequence_type_() = x.m_sequence_type; + break; + + case 0x00000007: + array_type_() = x.m_array_type; + break; + + case 0x00000008: + map_type_() = x.m_map_type; + break; + + case 0x00000009: + enumerated_type_() = x.m_enumerated_type; + break; + + case 0x0000000a: + bitmask_type_() = x.m_bitmask_type; + break; + + case 0x0000000b: + extended_type_() = x.m_extended_type; + break; + + } + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object CompleteTypeObject that will be copied. + */ + eProsima_user_DllExport CompleteTypeObject& operator =( + CompleteTypeObject&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + alias_type_() = std::move(x.m_alias_type); + break; + + case 0x00000002: + annotation_type_() = std::move(x.m_annotation_type); + break; + + case 0x00000003: + struct_type_() = std::move(x.m_struct_type); + break; + + case 0x00000004: + union_type_() = std::move(x.m_union_type); + break; + + case 0x00000005: + bitset_type_() = std::move(x.m_bitset_type); + break; + + case 0x00000006: + sequence_type_() = std::move(x.m_sequence_type); + break; + + case 0x00000007: + array_type_() = std::move(x.m_array_type); + break; + + case 0x00000008: + map_type_() = std::move(x.m_map_type); + break; + + case 0x00000009: + enumerated_type_() = std::move(x.m_enumerated_type); + break; + + case 0x0000000a: + bitmask_type_() = std::move(x.m_bitmask_type); + break; + + case 0x0000000b: + extended_type_() = std::move(x.m_extended_type); + break; + + } + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x CompleteTypeObject object to compare. + */ + eProsima_user_DllExport bool operator ==( + const CompleteTypeObject& x) const + { + bool ret_value {false}; + + if (m__d == x.m__d && + selected_member_ == x.selected_member_) + { + switch (selected_member_) + { + case 0x00000001: + ret_value = (m_alias_type == x.m_alias_type); + break; + + case 0x00000002: + ret_value = (m_annotation_type == x.m_annotation_type); + break; + + case 0x00000003: + ret_value = (m_struct_type == x.m_struct_type); + break; + + case 0x00000004: + ret_value = (m_union_type == x.m_union_type); + break; + + case 0x00000005: + ret_value = (m_bitset_type == x.m_bitset_type); + break; + + case 0x00000006: + ret_value = (m_sequence_type == x.m_sequence_type); + break; + + case 0x00000007: + ret_value = (m_array_type == x.m_array_type); + break; + + case 0x00000008: + ret_value = (m_map_type == x.m_map_type); + break; + + case 0x00000009: + ret_value = (m_enumerated_type == x.m_enumerated_type); + break; + + case 0x0000000a: + ret_value = (m_bitmask_type == x.m_bitmask_type); + break; + + case 0x0000000b: + ret_value = (m_extended_type == x.m_extended_type); + break; + + } + } + + return ret_value; + } + + /*! + * @brief Comparison operator. + * @param x CompleteTypeObject object to compare. + */ + eProsima_user_DllExport bool operator !=( + const CompleteTypeObject& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + uint8_t __d) + { + bool valid_discriminator = false; + + switch (__d) + { + case TK_ALIAS: + if (0x00000001 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_ANNOTATION: + if (0x00000002 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_STRUCTURE: + if (0x00000003 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_UNION: + if (0x00000004 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_BITSET: + if (0x00000005 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_SEQUENCE: + if (0x00000006 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_ARRAY: + if (0x00000007 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_MAP: + if (0x00000008 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_ENUM: + if (0x00000009 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_BITMASK: + if (0x0000000a == selected_member_) + { + valid_discriminator = true; + } + break; + + default: + if (0x0000000b == selected_member_) + { + valid_discriminator = true; + } + break; + + } + + if (!valid_discriminator) + { + throw eprosima::fastcdr::exception::BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; + } + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport uint8_t _d() const + { + return m__d; + } + + /*! + * @brief This function copies the value in member alias_type + * @param _alias_type New value to be copied in member alias_type + */ + eProsima_user_DllExport void alias_type( + const CompleteAliasType& _alias_type) + { + alias_type_() = _alias_type; + m__d = TK_ALIAS; + } + + /*! + * @brief This function moves the value in member alias_type + * @param _alias_type New value to be moved in member alias_type + */ + eProsima_user_DllExport void alias_type( + CompleteAliasType&& _alias_type) + { + alias_type_() = _alias_type; + m__d = TK_ALIAS; + } + + /*! + * @brief This function returns a constant reference to member alias_type + * @return Constant reference to member alias_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const CompleteAliasType& alias_type() const + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_alias_type; + } + + /*! + * @brief This function returns a reference to member alias_type + * @return Reference to member alias_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport CompleteAliasType& alias_type() + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_alias_type; + } + + + /*! + * @brief This function copies the value in member annotation_type + * @param _annotation_type New value to be copied in member annotation_type + */ + eProsima_user_DllExport void annotation_type( + const CompleteAnnotationType& _annotation_type) + { + annotation_type_() = _annotation_type; + m__d = TK_ANNOTATION; + } + + /*! + * @brief This function moves the value in member annotation_type + * @param _annotation_type New value to be moved in member annotation_type + */ + eProsima_user_DllExport void annotation_type( + CompleteAnnotationType&& _annotation_type) + { + annotation_type_() = _annotation_type; + m__d = TK_ANNOTATION; + } + + /*! + * @brief This function returns a constant reference to member annotation_type + * @return Constant reference to member annotation_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const CompleteAnnotationType& annotation_type() const + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_annotation_type; + } + + /*! + * @brief This function returns a reference to member annotation_type + * @return Reference to member annotation_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport CompleteAnnotationType& annotation_type() + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_annotation_type; + } + + + /*! + * @brief This function copies the value in member struct_type + * @param _struct_type New value to be copied in member struct_type + */ + eProsima_user_DllExport void struct_type( + const CompleteStructType& _struct_type) + { + struct_type_() = _struct_type; + m__d = TK_STRUCTURE; + } + + /*! + * @brief This function moves the value in member struct_type + * @param _struct_type New value to be moved in member struct_type + */ + eProsima_user_DllExport void struct_type( + CompleteStructType&& _struct_type) + { + struct_type_() = _struct_type; + m__d = TK_STRUCTURE; + } + + /*! + * @brief This function returns a constant reference to member struct_type + * @return Constant reference to member struct_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const CompleteStructType& struct_type() const + { + if (0x00000003 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_struct_type; + } + + /*! + * @brief This function returns a reference to member struct_type + * @return Reference to member struct_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport CompleteStructType& struct_type() + { + if (0x00000003 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_struct_type; + } + + + /*! + * @brief This function copies the value in member union_type + * @param _union_type New value to be copied in member union_type + */ + eProsima_user_DllExport void union_type( + const CompleteUnionType& _union_type) + { + union_type_() = _union_type; + m__d = TK_UNION; + } + + /*! + * @brief This function moves the value in member union_type + * @param _union_type New value to be moved in member union_type + */ + eProsima_user_DllExport void union_type( + CompleteUnionType&& _union_type) + { + union_type_() = _union_type; + m__d = TK_UNION; + } + + /*! + * @brief This function returns a constant reference to member union_type + * @return Constant reference to member union_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const CompleteUnionType& union_type() const + { + if (0x00000004 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_union_type; + } + + /*! + * @brief This function returns a reference to member union_type + * @return Reference to member union_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport CompleteUnionType& union_type() + { + if (0x00000004 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_union_type; + } + + + /*! + * @brief This function copies the value in member bitset_type + * @param _bitset_type New value to be copied in member bitset_type + */ + eProsima_user_DllExport void bitset_type( + const CompleteBitsetType& _bitset_type) + { + bitset_type_() = _bitset_type; + m__d = TK_BITSET; + } + + /*! + * @brief This function moves the value in member bitset_type + * @param _bitset_type New value to be moved in member bitset_type + */ + eProsima_user_DllExport void bitset_type( + CompleteBitsetType&& _bitset_type) + { + bitset_type_() = _bitset_type; + m__d = TK_BITSET; + } + + /*! + * @brief This function returns a constant reference to member bitset_type + * @return Constant reference to member bitset_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const CompleteBitsetType& bitset_type() const + { + if (0x00000005 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_bitset_type; + } + + /*! + * @brief This function returns a reference to member bitset_type + * @return Reference to member bitset_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport CompleteBitsetType& bitset_type() + { + if (0x00000005 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_bitset_type; + } + + + /*! + * @brief This function copies the value in member sequence_type + * @param _sequence_type New value to be copied in member sequence_type + */ + eProsima_user_DllExport void sequence_type( + const CompleteSequenceType& _sequence_type) + { + sequence_type_() = _sequence_type; + m__d = TK_SEQUENCE; + } + + /*! + * @brief This function moves the value in member sequence_type + * @param _sequence_type New value to be moved in member sequence_type + */ + eProsima_user_DllExport void sequence_type( + CompleteSequenceType&& _sequence_type) + { + sequence_type_() = _sequence_type; + m__d = TK_SEQUENCE; + } + + /*! + * @brief This function returns a constant reference to member sequence_type + * @return Constant reference to member sequence_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const CompleteSequenceType& sequence_type() const + { + if (0x00000006 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_sequence_type; + } + + /*! + * @brief This function returns a reference to member sequence_type + * @return Reference to member sequence_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport CompleteSequenceType& sequence_type() + { + if (0x00000006 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_sequence_type; + } + + + /*! + * @brief This function copies the value in member array_type + * @param _array_type New value to be copied in member array_type + */ + eProsima_user_DllExport void array_type( + const CompleteArrayType& _array_type) + { + array_type_() = _array_type; + m__d = TK_ARRAY; + } + + /*! + * @brief This function moves the value in member array_type + * @param _array_type New value to be moved in member array_type + */ + eProsima_user_DllExport void array_type( + CompleteArrayType&& _array_type) + { + array_type_() = _array_type; + m__d = TK_ARRAY; + } + + /*! + * @brief This function returns a constant reference to member array_type + * @return Constant reference to member array_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const CompleteArrayType& array_type() const + { + if (0x00000007 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_array_type; + } + + /*! + * @brief This function returns a reference to member array_type + * @return Reference to member array_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport CompleteArrayType& array_type() + { + if (0x00000007 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_array_type; + } + + + /*! + * @brief This function copies the value in member map_type + * @param _map_type New value to be copied in member map_type + */ + eProsima_user_DllExport void map_type( + const CompleteMapType& _map_type) + { + map_type_() = _map_type; + m__d = TK_MAP; + } + + /*! + * @brief This function moves the value in member map_type + * @param _map_type New value to be moved in member map_type + */ + eProsima_user_DllExport void map_type( + CompleteMapType&& _map_type) + { + map_type_() = _map_type; + m__d = TK_MAP; + } + + /*! + * @brief This function returns a constant reference to member map_type + * @return Constant reference to member map_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const CompleteMapType& map_type() const + { + if (0x00000008 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_map_type; + } + + /*! + * @brief This function returns a reference to member map_type + * @return Reference to member map_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport CompleteMapType& map_type() + { + if (0x00000008 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_map_type; + } + + + /*! + * @brief This function copies the value in member enumerated_type + * @param _enumerated_type New value to be copied in member enumerated_type + */ + eProsima_user_DllExport void enumerated_type( + const CompleteEnumeratedType& _enumerated_type) + { + enumerated_type_() = _enumerated_type; + m__d = TK_ENUM; + } + + /*! + * @brief This function moves the value in member enumerated_type + * @param _enumerated_type New value to be moved in member enumerated_type + */ + eProsima_user_DllExport void enumerated_type( + CompleteEnumeratedType&& _enumerated_type) + { + enumerated_type_() = _enumerated_type; + m__d = TK_ENUM; + } + + /*! + * @brief This function returns a constant reference to member enumerated_type + * @return Constant reference to member enumerated_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const CompleteEnumeratedType& enumerated_type() const + { + if (0x00000009 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_enumerated_type; + } + + /*! + * @brief This function returns a reference to member enumerated_type + * @return Reference to member enumerated_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport CompleteEnumeratedType& enumerated_type() + { + if (0x00000009 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_enumerated_type; + } + + + /*! + * @brief This function copies the value in member bitmask_type + * @param _bitmask_type New value to be copied in member bitmask_type + */ + eProsima_user_DllExport void bitmask_type( + const CompleteBitmaskType& _bitmask_type) + { + bitmask_type_() = _bitmask_type; + m__d = TK_BITMASK; + } + + /*! + * @brief This function moves the value in member bitmask_type + * @param _bitmask_type New value to be moved in member bitmask_type + */ + eProsima_user_DllExport void bitmask_type( + CompleteBitmaskType&& _bitmask_type) + { + bitmask_type_() = _bitmask_type; + m__d = TK_BITMASK; + } + + /*! + * @brief This function returns a constant reference to member bitmask_type + * @return Constant reference to member bitmask_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const CompleteBitmaskType& bitmask_type() const + { + if (0x0000000a != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_bitmask_type; + } + + /*! + * @brief This function returns a reference to member bitmask_type + * @return Reference to member bitmask_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport CompleteBitmaskType& bitmask_type() + { + if (0x0000000a != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_bitmask_type; + } + + + /*! + * @brief This function copies the value in member extended_type + * @param _extended_type New value to be copied in member extended_type + */ + eProsima_user_DllExport void extended_type( + const CompleteExtendedType& _extended_type) + { + extended_type_() = _extended_type; + m__d = 0; + } + + /*! + * @brief This function moves the value in member extended_type + * @param _extended_type New value to be moved in member extended_type + */ + eProsima_user_DllExport void extended_type( + CompleteExtendedType&& _extended_type) + { + extended_type_() = _extended_type; + m__d = 0; + } + + /*! + * @brief This function returns a constant reference to member extended_type + * @return Constant reference to member extended_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const CompleteExtendedType& extended_type() const + { + if (0x0000000b != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_extended_type; + } + + /*! + * @brief This function returns a reference to member extended_type + * @return Reference to member extended_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport CompleteExtendedType& extended_type() + { + if (0x0000000b != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_extended_type; + } + + + +private: + + CompleteAliasType& alias_type_() + { + if (0x00000001 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000001; + member_destructor_ = [&]() {m_alias_type.~CompleteAliasType();}; + new(&m_alias_type) CompleteAliasType(); + ; + } + + return m_alias_type; + } + + CompleteAnnotationType& annotation_type_() + { + if (0x00000002 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000002; + member_destructor_ = [&]() {m_annotation_type.~CompleteAnnotationType();}; + new(&m_annotation_type) CompleteAnnotationType(); + ; + } + + return m_annotation_type; + } + + CompleteStructType& struct_type_() + { + if (0x00000003 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000003; + member_destructor_ = [&]() {m_struct_type.~CompleteStructType();}; + new(&m_struct_type) CompleteStructType(); + ; + } + + return m_struct_type; + } + + CompleteUnionType& union_type_() + { + if (0x00000004 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000004; + member_destructor_ = [&]() {m_union_type.~CompleteUnionType();}; + new(&m_union_type) CompleteUnionType(); + ; + } + + return m_union_type; + } + + CompleteBitsetType& bitset_type_() + { + if (0x00000005 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000005; + member_destructor_ = [&]() {m_bitset_type.~CompleteBitsetType();}; + new(&m_bitset_type) CompleteBitsetType(); + ; + } + + return m_bitset_type; + } + + CompleteSequenceType& sequence_type_() + { + if (0x00000006 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000006; + member_destructor_ = [&]() {m_sequence_type.~CompleteSequenceType();}; + new(&m_sequence_type) CompleteSequenceType(); + ; + } + + return m_sequence_type; + } + + CompleteArrayType& array_type_() + { + if (0x00000007 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000007; + member_destructor_ = [&]() {m_array_type.~CompleteArrayType();}; + new(&m_array_type) CompleteArrayType(); + ; + } + + return m_array_type; + } + + CompleteMapType& map_type_() + { + if (0x00000008 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000008; + member_destructor_ = [&]() {m_map_type.~CompleteMapType();}; + new(&m_map_type) CompleteMapType(); + ; + } + + return m_map_type; + } + + CompleteEnumeratedType& enumerated_type_() + { + if (0x00000009 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000009; + member_destructor_ = [&]() {m_enumerated_type.~CompleteEnumeratedType();}; + new(&m_enumerated_type) CompleteEnumeratedType(); + ; + } + + return m_enumerated_type; + } + + CompleteBitmaskType& bitmask_type_() + { + if (0x0000000a != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0000000a; + member_destructor_ = [&]() {m_bitmask_type.~CompleteBitmaskType();}; + new(&m_bitmask_type) CompleteBitmaskType(); + ; + } + + return m_bitmask_type; + } + + CompleteExtendedType& extended_type_() + { + if (0x0000000b != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0000000b; + member_destructor_ = [&]() {m_extended_type.~CompleteExtendedType();}; + new(&m_extended_type) CompleteExtendedType(); + ; + } + + return m_extended_type; + } + + + uint8_t m__d {0}; + + union + { + CompleteAliasType m_alias_type; + CompleteAnnotationType m_annotation_type; + CompleteStructType m_struct_type; + CompleteUnionType m_union_type; + CompleteBitsetType m_bitset_type; + CompleteSequenceType m_sequence_type; + CompleteArrayType m_array_type; + CompleteMapType m_map_type; + CompleteEnumeratedType m_enumerated_type; + CompleteBitmaskType m_bitmask_type; + CompleteExtendedType m_extended_type; + }; + + uint32_t selected_member_ {0x0FFFFFFFu}; + + std::function member_destructor_; +}; +/*! + * @brief This class represents the structure MinimalExtendedType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalExtendedType +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalExtendedType() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalExtendedType() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalExtendedType that will be copied. + */ + eProsima_user_DllExport MinimalExtendedType( + const MinimalExtendedType& x) + { + static_cast(x); + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalExtendedType that will be copied. + */ + eProsima_user_DllExport MinimalExtendedType( + MinimalExtendedType&& x) noexcept + { + static_cast(x); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalExtendedType that will be copied. + */ + eProsima_user_DllExport MinimalExtendedType& operator =( + const MinimalExtendedType& x) + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalExtendedType that will be copied. + */ + eProsima_user_DllExport MinimalExtendedType& operator =( + MinimalExtendedType&& x) noexcept + { + + static_cast(x); + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalExtendedType object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalExtendedType& x) const + { + static_cast(x); + return true; + } + + /*! + * @brief Comparison operator. + * @param x MinimalExtendedType object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalExtendedType& x) const + { + return !(*this == x); + } + + + +private: + + +}; +/*! + * @brief This class represents the union MinimalTypeObject defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalTypeObject +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport MinimalTypeObject() + { + extended_type_(); + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~MinimalTypeObject() + { + if (member_destructor_) + { + member_destructor_(); + } + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object MinimalTypeObject that will be copied. + */ + eProsima_user_DllExport MinimalTypeObject( + const MinimalTypeObject& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + alias_type_() = x.m_alias_type; + break; + + case 0x00000002: + annotation_type_() = x.m_annotation_type; + break; + + case 0x00000003: + struct_type_() = x.m_struct_type; + break; + + case 0x00000004: + union_type_() = x.m_union_type; + break; + + case 0x00000005: + bitset_type_() = x.m_bitset_type; + break; + + case 0x00000006: + sequence_type_() = x.m_sequence_type; + break; + + case 0x00000007: + array_type_() = x.m_array_type; + break; + + case 0x00000008: + map_type_() = x.m_map_type; + break; + + case 0x00000009: + enumerated_type_() = x.m_enumerated_type; + break; + + case 0x0000000a: + bitmask_type_() = x.m_bitmask_type; + break; + + case 0x0000000b: + extended_type_() = x.m_extended_type; + break; + + } + } + + /*! + * @brief Move constructor. + * @param x Reference to the object MinimalTypeObject that will be copied. + */ + eProsima_user_DllExport MinimalTypeObject( + MinimalTypeObject&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + alias_type_() = std::move(x.m_alias_type); + break; + + case 0x00000002: + annotation_type_() = std::move(x.m_annotation_type); + break; + + case 0x00000003: + struct_type_() = std::move(x.m_struct_type); + break; + + case 0x00000004: + union_type_() = std::move(x.m_union_type); + break; + + case 0x00000005: + bitset_type_() = std::move(x.m_bitset_type); + break; + + case 0x00000006: + sequence_type_() = std::move(x.m_sequence_type); + break; + + case 0x00000007: + array_type_() = std::move(x.m_array_type); + break; + + case 0x00000008: + map_type_() = std::move(x.m_map_type); + break; + + case 0x00000009: + enumerated_type_() = std::move(x.m_enumerated_type); + break; + + case 0x0000000a: + bitmask_type_() = std::move(x.m_bitmask_type); + break; + + case 0x0000000b: + extended_type_() = std::move(x.m_extended_type); + break; + + } + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object MinimalTypeObject that will be copied. + */ + eProsima_user_DllExport MinimalTypeObject& operator =( + const MinimalTypeObject& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + alias_type_() = x.m_alias_type; + break; + + case 0x00000002: + annotation_type_() = x.m_annotation_type; + break; + + case 0x00000003: + struct_type_() = x.m_struct_type; + break; + + case 0x00000004: + union_type_() = x.m_union_type; + break; + + case 0x00000005: + bitset_type_() = x.m_bitset_type; + break; + + case 0x00000006: + sequence_type_() = x.m_sequence_type; + break; + + case 0x00000007: + array_type_() = x.m_array_type; + break; + + case 0x00000008: + map_type_() = x.m_map_type; + break; + + case 0x00000009: + enumerated_type_() = x.m_enumerated_type; + break; + + case 0x0000000a: + bitmask_type_() = x.m_bitmask_type; + break; + + case 0x0000000b: + extended_type_() = x.m_extended_type; + break; + + } + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object MinimalTypeObject that will be copied. + */ + eProsima_user_DllExport MinimalTypeObject& operator =( + MinimalTypeObject&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + alias_type_() = std::move(x.m_alias_type); + break; + + case 0x00000002: + annotation_type_() = std::move(x.m_annotation_type); + break; + + case 0x00000003: + struct_type_() = std::move(x.m_struct_type); + break; + + case 0x00000004: + union_type_() = std::move(x.m_union_type); + break; + + case 0x00000005: + bitset_type_() = std::move(x.m_bitset_type); + break; + + case 0x00000006: + sequence_type_() = std::move(x.m_sequence_type); + break; + + case 0x00000007: + array_type_() = std::move(x.m_array_type); + break; + + case 0x00000008: + map_type_() = std::move(x.m_map_type); + break; + + case 0x00000009: + enumerated_type_() = std::move(x.m_enumerated_type); + break; + + case 0x0000000a: + bitmask_type_() = std::move(x.m_bitmask_type); + break; + + case 0x0000000b: + extended_type_() = std::move(x.m_extended_type); + break; + + } + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x MinimalTypeObject object to compare. + */ + eProsima_user_DllExport bool operator ==( + const MinimalTypeObject& x) const + { + bool ret_value {false}; + + if (m__d == x.m__d && + selected_member_ == x.selected_member_) + { + switch (selected_member_) + { + case 0x00000001: + ret_value = (m_alias_type == x.m_alias_type); + break; + + case 0x00000002: + ret_value = (m_annotation_type == x.m_annotation_type); + break; + + case 0x00000003: + ret_value = (m_struct_type == x.m_struct_type); + break; + + case 0x00000004: + ret_value = (m_union_type == x.m_union_type); + break; + + case 0x00000005: + ret_value = (m_bitset_type == x.m_bitset_type); + break; + + case 0x00000006: + ret_value = (m_sequence_type == x.m_sequence_type); + break; + + case 0x00000007: + ret_value = (m_array_type == x.m_array_type); + break; + + case 0x00000008: + ret_value = (m_map_type == x.m_map_type); + break; + + case 0x00000009: + ret_value = (m_enumerated_type == x.m_enumerated_type); + break; + + case 0x0000000a: + ret_value = (m_bitmask_type == x.m_bitmask_type); + break; + + case 0x0000000b: + ret_value = (m_extended_type == x.m_extended_type); + break; + + } + } + + return ret_value; + } + + /*! + * @brief Comparison operator. + * @param x MinimalTypeObject object to compare. + */ + eProsima_user_DllExport bool operator !=( + const MinimalTypeObject& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + uint8_t __d) + { + bool valid_discriminator = false; + + switch (__d) + { + case TK_ALIAS: + if (0x00000001 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_ANNOTATION: + if (0x00000002 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_STRUCTURE: + if (0x00000003 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_UNION: + if (0x00000004 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_BITSET: + if (0x00000005 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_SEQUENCE: + if (0x00000006 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_ARRAY: + if (0x00000007 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_MAP: + if (0x00000008 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_ENUM: + if (0x00000009 == selected_member_) + { + valid_discriminator = true; + } + break; + + case TK_BITMASK: + if (0x0000000a == selected_member_) + { + valid_discriminator = true; + } + break; + + default: + if (0x0000000b == selected_member_) + { + valid_discriminator = true; + } + break; + + } + + if (!valid_discriminator) + { + throw eprosima::fastcdr::exception::BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; + } + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport uint8_t _d() const + { + return m__d; + } + + /*! + * @brief This function copies the value in member alias_type + * @param _alias_type New value to be copied in member alias_type + */ + eProsima_user_DllExport void alias_type( + const MinimalAliasType& _alias_type) + { + alias_type_() = _alias_type; + m__d = TK_ALIAS; + } + + /*! + * @brief This function moves the value in member alias_type + * @param _alias_type New value to be moved in member alias_type + */ + eProsima_user_DllExport void alias_type( + MinimalAliasType&& _alias_type) + { + alias_type_() = _alias_type; + m__d = TK_ALIAS; + } + + /*! + * @brief This function returns a constant reference to member alias_type + * @return Constant reference to member alias_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const MinimalAliasType& alias_type() const + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_alias_type; + } + + /*! + * @brief This function returns a reference to member alias_type + * @return Reference to member alias_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport MinimalAliasType& alias_type() + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_alias_type; + } + + + /*! + * @brief This function copies the value in member annotation_type + * @param _annotation_type New value to be copied in member annotation_type + */ + eProsima_user_DllExport void annotation_type( + const MinimalAnnotationType& _annotation_type) + { + annotation_type_() = _annotation_type; + m__d = TK_ANNOTATION; + } + + /*! + * @brief This function moves the value in member annotation_type + * @param _annotation_type New value to be moved in member annotation_type + */ + eProsima_user_DllExport void annotation_type( + MinimalAnnotationType&& _annotation_type) + { + annotation_type_() = _annotation_type; + m__d = TK_ANNOTATION; + } + + /*! + * @brief This function returns a constant reference to member annotation_type + * @return Constant reference to member annotation_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const MinimalAnnotationType& annotation_type() const + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_annotation_type; + } + + /*! + * @brief This function returns a reference to member annotation_type + * @return Reference to member annotation_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport MinimalAnnotationType& annotation_type() + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_annotation_type; + } + + + /*! + * @brief This function copies the value in member struct_type + * @param _struct_type New value to be copied in member struct_type + */ + eProsima_user_DllExport void struct_type( + const MinimalStructType& _struct_type) + { + struct_type_() = _struct_type; + m__d = TK_STRUCTURE; + } + + /*! + * @brief This function moves the value in member struct_type + * @param _struct_type New value to be moved in member struct_type + */ + eProsima_user_DllExport void struct_type( + MinimalStructType&& _struct_type) + { + struct_type_() = _struct_type; + m__d = TK_STRUCTURE; + } + + /*! + * @brief This function returns a constant reference to member struct_type + * @return Constant reference to member struct_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const MinimalStructType& struct_type() const + { + if (0x00000003 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_struct_type; + } + + /*! + * @brief This function returns a reference to member struct_type + * @return Reference to member struct_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport MinimalStructType& struct_type() + { + if (0x00000003 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_struct_type; + } + + + /*! + * @brief This function copies the value in member union_type + * @param _union_type New value to be copied in member union_type + */ + eProsima_user_DllExport void union_type( + const MinimalUnionType& _union_type) + { + union_type_() = _union_type; + m__d = TK_UNION; + } + + /*! + * @brief This function moves the value in member union_type + * @param _union_type New value to be moved in member union_type + */ + eProsima_user_DllExport void union_type( + MinimalUnionType&& _union_type) + { + union_type_() = _union_type; + m__d = TK_UNION; + } + + /*! + * @brief This function returns a constant reference to member union_type + * @return Constant reference to member union_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const MinimalUnionType& union_type() const + { + if (0x00000004 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_union_type; + } + + /*! + * @brief This function returns a reference to member union_type + * @return Reference to member union_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport MinimalUnionType& union_type() + { + if (0x00000004 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_union_type; + } + + + /*! + * @brief This function copies the value in member bitset_type + * @param _bitset_type New value to be copied in member bitset_type + */ + eProsima_user_DllExport void bitset_type( + const MinimalBitsetType& _bitset_type) + { + bitset_type_() = _bitset_type; + m__d = TK_BITSET; + } + + /*! + * @brief This function moves the value in member bitset_type + * @param _bitset_type New value to be moved in member bitset_type + */ + eProsima_user_DllExport void bitset_type( + MinimalBitsetType&& _bitset_type) + { + bitset_type_() = _bitset_type; + m__d = TK_BITSET; + } + + /*! + * @brief This function returns a constant reference to member bitset_type + * @return Constant reference to member bitset_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const MinimalBitsetType& bitset_type() const + { + if (0x00000005 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_bitset_type; + } + + /*! + * @brief This function returns a reference to member bitset_type + * @return Reference to member bitset_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport MinimalBitsetType& bitset_type() + { + if (0x00000005 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_bitset_type; + } + + + /*! + * @brief This function copies the value in member sequence_type + * @param _sequence_type New value to be copied in member sequence_type + */ + eProsima_user_DllExport void sequence_type( + const MinimalSequenceType& _sequence_type) + { + sequence_type_() = _sequence_type; + m__d = TK_SEQUENCE; + } + + /*! + * @brief This function moves the value in member sequence_type + * @param _sequence_type New value to be moved in member sequence_type + */ + eProsima_user_DllExport void sequence_type( + MinimalSequenceType&& _sequence_type) + { + sequence_type_() = _sequence_type; + m__d = TK_SEQUENCE; + } + + /*! + * @brief This function returns a constant reference to member sequence_type + * @return Constant reference to member sequence_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const MinimalSequenceType& sequence_type() const + { + if (0x00000006 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_sequence_type; + } + + /*! + * @brief This function returns a reference to member sequence_type + * @return Reference to member sequence_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport MinimalSequenceType& sequence_type() + { + if (0x00000006 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_sequence_type; + } + + + /*! + * @brief This function copies the value in member array_type + * @param _array_type New value to be copied in member array_type + */ + eProsima_user_DllExport void array_type( + const MinimalArrayType& _array_type) + { + array_type_() = _array_type; + m__d = TK_ARRAY; + } + + /*! + * @brief This function moves the value in member array_type + * @param _array_type New value to be moved in member array_type + */ + eProsima_user_DllExport void array_type( + MinimalArrayType&& _array_type) + { + array_type_() = _array_type; + m__d = TK_ARRAY; + } + + /*! + * @brief This function returns a constant reference to member array_type + * @return Constant reference to member array_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const MinimalArrayType& array_type() const + { + if (0x00000007 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_array_type; + } + + /*! + * @brief This function returns a reference to member array_type + * @return Reference to member array_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport MinimalArrayType& array_type() + { + if (0x00000007 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_array_type; + } + + + /*! + * @brief This function copies the value in member map_type + * @param _map_type New value to be copied in member map_type + */ + eProsima_user_DllExport void map_type( + const MinimalMapType& _map_type) + { + map_type_() = _map_type; + m__d = TK_MAP; + } + + /*! + * @brief This function moves the value in member map_type + * @param _map_type New value to be moved in member map_type + */ + eProsima_user_DllExport void map_type( + MinimalMapType&& _map_type) + { + map_type_() = _map_type; + m__d = TK_MAP; + } + + /*! + * @brief This function returns a constant reference to member map_type + * @return Constant reference to member map_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const MinimalMapType& map_type() const + { + if (0x00000008 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_map_type; + } + + /*! + * @brief This function returns a reference to member map_type + * @return Reference to member map_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport MinimalMapType& map_type() + { + if (0x00000008 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_map_type; + } + + + /*! + * @brief This function copies the value in member enumerated_type + * @param _enumerated_type New value to be copied in member enumerated_type + */ + eProsima_user_DllExport void enumerated_type( + const MinimalEnumeratedType& _enumerated_type) + { + enumerated_type_() = _enumerated_type; + m__d = TK_ENUM; + } + + /*! + * @brief This function moves the value in member enumerated_type + * @param _enumerated_type New value to be moved in member enumerated_type + */ + eProsima_user_DllExport void enumerated_type( + MinimalEnumeratedType&& _enumerated_type) + { + enumerated_type_() = _enumerated_type; + m__d = TK_ENUM; + } + + /*! + * @brief This function returns a constant reference to member enumerated_type + * @return Constant reference to member enumerated_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const MinimalEnumeratedType& enumerated_type() const + { + if (0x00000009 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_enumerated_type; + } + + /*! + * @brief This function returns a reference to member enumerated_type + * @return Reference to member enumerated_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport MinimalEnumeratedType& enumerated_type() + { + if (0x00000009 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_enumerated_type; + } + + + /*! + * @brief This function copies the value in member bitmask_type + * @param _bitmask_type New value to be copied in member bitmask_type + */ + eProsima_user_DllExport void bitmask_type( + const MinimalBitmaskType& _bitmask_type) + { + bitmask_type_() = _bitmask_type; + m__d = TK_BITMASK; + } + + /*! + * @brief This function moves the value in member bitmask_type + * @param _bitmask_type New value to be moved in member bitmask_type + */ + eProsima_user_DllExport void bitmask_type( + MinimalBitmaskType&& _bitmask_type) + { + bitmask_type_() = _bitmask_type; + m__d = TK_BITMASK; + } + + /*! + * @brief This function returns a constant reference to member bitmask_type + * @return Constant reference to member bitmask_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const MinimalBitmaskType& bitmask_type() const + { + if (0x0000000a != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_bitmask_type; + } + + /*! + * @brief This function returns a reference to member bitmask_type + * @return Reference to member bitmask_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport MinimalBitmaskType& bitmask_type() + { + if (0x0000000a != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_bitmask_type; + } + + + /*! + * @brief This function copies the value in member extended_type + * @param _extended_type New value to be copied in member extended_type + */ + eProsima_user_DllExport void extended_type( + const MinimalExtendedType& _extended_type) + { + extended_type_() = _extended_type; + m__d = 0; + } + + /*! + * @brief This function moves the value in member extended_type + * @param _extended_type New value to be moved in member extended_type + */ + eProsima_user_DllExport void extended_type( + MinimalExtendedType&& _extended_type) + { + extended_type_() = _extended_type; + m__d = 0; + } + + /*! + * @brief This function returns a constant reference to member extended_type + * @return Constant reference to member extended_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const MinimalExtendedType& extended_type() const + { + if (0x0000000b != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_extended_type; + } + + /*! + * @brief This function returns a reference to member extended_type + * @return Reference to member extended_type + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport MinimalExtendedType& extended_type() + { + if (0x0000000b != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_extended_type; + } + + + +private: + + MinimalAliasType& alias_type_() + { + if (0x00000001 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000001; + member_destructor_ = [&]() {m_alias_type.~MinimalAliasType();}; + new(&m_alias_type) MinimalAliasType(); + ; + } + + return m_alias_type; + } + + MinimalAnnotationType& annotation_type_() + { + if (0x00000002 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000002; + member_destructor_ = [&]() {m_annotation_type.~MinimalAnnotationType();}; + new(&m_annotation_type) MinimalAnnotationType(); + ; + } + + return m_annotation_type; + } + + MinimalStructType& struct_type_() + { + if (0x00000003 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000003; + member_destructor_ = [&]() {m_struct_type.~MinimalStructType();}; + new(&m_struct_type) MinimalStructType(); + ; + } + + return m_struct_type; + } + + MinimalUnionType& union_type_() + { + if (0x00000004 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000004; + member_destructor_ = [&]() {m_union_type.~MinimalUnionType();}; + new(&m_union_type) MinimalUnionType(); + ; + } + + return m_union_type; + } + + MinimalBitsetType& bitset_type_() + { + if (0x00000005 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000005; + member_destructor_ = [&]() {m_bitset_type.~MinimalBitsetType();}; + new(&m_bitset_type) MinimalBitsetType(); + ; + } + + return m_bitset_type; + } + + MinimalSequenceType& sequence_type_() + { + if (0x00000006 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000006; + member_destructor_ = [&]() {m_sequence_type.~MinimalSequenceType();}; + new(&m_sequence_type) MinimalSequenceType(); + ; + } + + return m_sequence_type; + } + + MinimalArrayType& array_type_() + { + if (0x00000007 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000007; + member_destructor_ = [&]() {m_array_type.~MinimalArrayType();}; + new(&m_array_type) MinimalArrayType(); + ; + } + + return m_array_type; + } + + MinimalMapType& map_type_() + { + if (0x00000008 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000008; + member_destructor_ = [&]() {m_map_type.~MinimalMapType();}; + new(&m_map_type) MinimalMapType(); + ; + } + + return m_map_type; + } + + MinimalEnumeratedType& enumerated_type_() + { + if (0x00000009 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000009; + member_destructor_ = [&]() {m_enumerated_type.~MinimalEnumeratedType();}; + new(&m_enumerated_type) MinimalEnumeratedType(); + ; + } + + return m_enumerated_type; + } + + MinimalBitmaskType& bitmask_type_() + { + if (0x0000000a != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0000000a; + member_destructor_ = [&]() {m_bitmask_type.~MinimalBitmaskType();}; + new(&m_bitmask_type) MinimalBitmaskType(); + ; + } + + return m_bitmask_type; + } + + MinimalExtendedType& extended_type_() + { + if (0x0000000b != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0000000b; + member_destructor_ = [&]() {m_extended_type.~MinimalExtendedType();}; + new(&m_extended_type) MinimalExtendedType(); + ; + } + + return m_extended_type; + } + + + uint8_t m__d {0}; + + union + { + MinimalAliasType m_alias_type; + MinimalAnnotationType m_annotation_type; + MinimalStructType m_struct_type; + MinimalUnionType m_union_type; + MinimalBitsetType m_bitset_type; + MinimalSequenceType m_sequence_type; + MinimalArrayType m_array_type; + MinimalMapType m_map_type; + MinimalEnumeratedType m_enumerated_type; + MinimalBitmaskType m_bitmask_type; + MinimalExtendedType m_extended_type; + }; + + uint32_t selected_member_ {0x0FFFFFFFu}; + + std::function member_destructor_; +}; +/*! + * @brief This class represents the union TypeObject defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class TypeObject +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TypeObject() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TypeObject() + { + if (member_destructor_) + { + member_destructor_(); + } + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object TypeObject that will be copied. + */ + eProsima_user_DllExport TypeObject( + const TypeObject& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + complete_() = x.m_complete; + break; + + case 0x00000002: + minimal_() = x.m_minimal; + break; + + } + } + + /*! + * @brief Move constructor. + * @param x Reference to the object TypeObject that will be copied. + */ + eProsima_user_DllExport TypeObject( + TypeObject&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + complete_() = std::move(x.m_complete); + break; + + case 0x00000002: + minimal_() = std::move(x.m_minimal); + break; + + } + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object TypeObject that will be copied. + */ + eProsima_user_DllExport TypeObject& operator =( + const TypeObject& x) + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + complete_() = x.m_complete; + break; + + case 0x00000002: + minimal_() = x.m_minimal; + break; + + } + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object TypeObject that will be copied. + */ + eProsima_user_DllExport TypeObject& operator =( + TypeObject&& x) noexcept + { + m__d = x.m__d; + + switch (x.selected_member_) + { + case 0x00000001: + complete_() = std::move(x.m_complete); + break; + + case 0x00000002: + minimal_() = std::move(x.m_minimal); + break; + + } + + return *this; + } + + /*! + * @brief Comparison operator. + * @param x TypeObject object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TypeObject& x) const + { + bool ret_value {false}; + + if (m__d == x.m__d && + selected_member_ == x.selected_member_) + { + switch (selected_member_) + { + case 0x00000001: + ret_value = (m_complete == x.m_complete); + break; + + case 0x00000002: + ret_value = (m_minimal == x.m_minimal); + break; + + } + } + + return ret_value; + } + + /*! + * @brief Comparison operator. + * @param x TypeObject object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TypeObject& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets the discriminator value. + * @param __d New value for the discriminator. + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. + */ + eProsima_user_DllExport void _d( + uint8_t __d) + { + bool valid_discriminator = false; + + switch (__d) + { + case EK_COMPLETE: + if (0x00000001 == selected_member_) + { + valid_discriminator = true; + } + break; + + case EK_MINIMAL: + if (0x00000002 == selected_member_) + { + valid_discriminator = true; + } + break; + + } + + if (!valid_discriminator) + { + throw eprosima::fastcdr::exception::BadParamException("Discriminator doesn't correspond with the selected union member"); + } + + m__d = __d; + } + + /*! + * @brief This function returns the value of the discriminator. + * @return Value of the discriminator + */ + eProsima_user_DllExport uint8_t _d() const + { + return m__d; + } + + /*! + * @brief This function copies the value in member complete + * @param _complete New value to be copied in member complete + */ + eProsima_user_DllExport void complete( + const CompleteTypeObject& _complete) + { + complete_() = _complete; + m__d = EK_COMPLETE; + } + + /*! + * @brief This function moves the value in member complete + * @param _complete New value to be moved in member complete + */ + eProsima_user_DllExport void complete( + CompleteTypeObject&& _complete) + { + complete_() = _complete; + m__d = EK_COMPLETE; + } + + /*! + * @brief This function returns a constant reference to member complete + * @return Constant reference to member complete + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const CompleteTypeObject& complete() const + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_complete; + } + + /*! + * @brief This function returns a reference to member complete + * @return Reference to member complete + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport CompleteTypeObject& complete() + { + if (0x00000001 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_complete; + } + + + /*! + * @brief This function copies the value in member minimal + * @param _minimal New value to be copied in member minimal + */ + eProsima_user_DllExport void minimal( + const MinimalTypeObject& _minimal) + { + minimal_() = _minimal; + m__d = EK_MINIMAL; + } + + /*! + * @brief This function moves the value in member minimal + * @param _minimal New value to be moved in member minimal + */ + eProsima_user_DllExport void minimal( + MinimalTypeObject&& _minimal) + { + minimal_() = _minimal; + m__d = EK_MINIMAL; + } + + /*! + * @brief This function returns a constant reference to member minimal + * @return Constant reference to member minimal + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport const MinimalTypeObject& minimal() const + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_minimal; + } + + /*! + * @brief This function returns a reference to member minimal + * @return Reference to member minimal + * @exception eprosima::fastcdr::exception::BadParamException This exception is thrown if the requested union member is not the current selection. + */ + eProsima_user_DllExport MinimalTypeObject& minimal() + { + if (0x00000002 != selected_member_) + { + throw eprosima::fastcdr::exception::BadParamException("This member has not been selected"); + } + + return m_minimal; + } + + + void _default() + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x0FFFFFFFu; + } + + +private: + + CompleteTypeObject& complete_() + { + if (0x00000001 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000001; + member_destructor_ = [&]() {m_complete.~CompleteTypeObject();}; + new(&m_complete) CompleteTypeObject(); + ; + } + + return m_complete; + } + + MinimalTypeObject& minimal_() + { + if (0x00000002 != selected_member_) + { + if (member_destructor_) + { + member_destructor_(); + } + + selected_member_ = 0x00000002; + member_destructor_ = [&]() {m_minimal.~MinimalTypeObject();}; + new(&m_minimal) MinimalTypeObject(); + ; + } + + return m_minimal; + } + + + uint8_t m__d {0}; + + union + { + CompleteTypeObject m_complete; + MinimalTypeObject m_minimal; + }; + + uint32_t selected_member_ {0x0FFFFFFFu}; + + std::function member_destructor_; +}; +typedef std::vector TypeObjectSeq; + +typedef TypeObjectSeq StronglyConnectedComponent; + +/*! + * @brief This class represents the structure TypeIdentifierTypeObjectPair defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class TypeIdentifierTypeObjectPair +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TypeIdentifierTypeObjectPair() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TypeIdentifierTypeObjectPair() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object TypeIdentifierTypeObjectPair that will be copied. + */ + eProsima_user_DllExport TypeIdentifierTypeObjectPair( + const TypeIdentifierTypeObjectPair& x) + { + m_type_identifier = x.m_type_identifier; + + m_type_object = x.m_type_object; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object TypeIdentifierTypeObjectPair that will be copied. + */ + eProsima_user_DllExport TypeIdentifierTypeObjectPair( + TypeIdentifierTypeObjectPair&& x) noexcept + { + m_type_identifier = std::move(x.m_type_identifier); + m_type_object = std::move(x.m_type_object); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object TypeIdentifierTypeObjectPair that will be copied. + */ + eProsima_user_DllExport TypeIdentifierTypeObjectPair& operator =( + const TypeIdentifierTypeObjectPair& x) + { + + m_type_identifier = x.m_type_identifier; + + m_type_object = x.m_type_object; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object TypeIdentifierTypeObjectPair that will be copied. + */ + eProsima_user_DllExport TypeIdentifierTypeObjectPair& operator =( + TypeIdentifierTypeObjectPair&& x) noexcept + { + + m_type_identifier = std::move(x.m_type_identifier); + m_type_object = std::move(x.m_type_object); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x TypeIdentifierTypeObjectPair object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TypeIdentifierTypeObjectPair& x) const + { + return (m_type_identifier == x.m_type_identifier && + m_type_object == x.m_type_object); + } + + /*! + * @brief Comparison operator. + * @param x TypeIdentifierTypeObjectPair object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TypeIdentifierTypeObjectPair& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member type_identifier + * @param _type_identifier New value to be copied in member type_identifier + */ + eProsima_user_DllExport void type_identifier( + const TypeIdentifier& _type_identifier) + { + m_type_identifier = _type_identifier; + } + + /*! + * @brief This function moves the value in member type_identifier + * @param _type_identifier New value to be moved in member type_identifier + */ + eProsima_user_DllExport void type_identifier( + TypeIdentifier&& _type_identifier) + { + m_type_identifier = std::move(_type_identifier); + } + + /*! + * @brief This function returns a constant reference to member type_identifier + * @return Constant reference to member type_identifier + */ + eProsima_user_DllExport const TypeIdentifier& type_identifier() const + { + return m_type_identifier; + } + + /*! + * @brief This function returns a reference to member type_identifier + * @return Reference to member type_identifier + */ + eProsima_user_DllExport TypeIdentifier& type_identifier() + { + return m_type_identifier; + } + + + /*! + * @brief This function copies the value in member type_object + * @param _type_object New value to be copied in member type_object + */ + eProsima_user_DllExport void type_object( + const TypeObject& _type_object) + { + m_type_object = _type_object; + } + + /*! + * @brief This function moves the value in member type_object + * @param _type_object New value to be moved in member type_object + */ + eProsima_user_DllExport void type_object( + TypeObject&& _type_object) + { + m_type_object = std::move(_type_object); + } + + /*! + * @brief This function returns a constant reference to member type_object + * @return Constant reference to member type_object + */ + eProsima_user_DllExport const TypeObject& type_object() const + { + return m_type_object; + } + + /*! + * @brief This function returns a reference to member type_object + * @return Reference to member type_object + */ + eProsima_user_DllExport TypeObject& type_object() + { + return m_type_object; + } + + + +private: + + TypeIdentifier m_type_identifier; + TypeObject m_type_object; + +}; +typedef std::vector TypeIdentifierTypeObjectPairSeq; + +/*! + * @brief This class represents the structure TypeIdentifierPair defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class TypeIdentifierPair +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TypeIdentifierPair() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TypeIdentifierPair() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object TypeIdentifierPair that will be copied. + */ + eProsima_user_DllExport TypeIdentifierPair( + const TypeIdentifierPair& x) + { + m_type_identifier1 = x.m_type_identifier1; + + m_type_identifier2 = x.m_type_identifier2; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object TypeIdentifierPair that will be copied. + */ + eProsima_user_DllExport TypeIdentifierPair( + TypeIdentifierPair&& x) noexcept + { + m_type_identifier1 = std::move(x.m_type_identifier1); + m_type_identifier2 = std::move(x.m_type_identifier2); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object TypeIdentifierPair that will be copied. + */ + eProsima_user_DllExport TypeIdentifierPair& operator =( + const TypeIdentifierPair& x) + { + + m_type_identifier1 = x.m_type_identifier1; + + m_type_identifier2 = x.m_type_identifier2; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object TypeIdentifierPair that will be copied. + */ + eProsima_user_DllExport TypeIdentifierPair& operator =( + TypeIdentifierPair&& x) noexcept + { + + m_type_identifier1 = std::move(x.m_type_identifier1); + m_type_identifier2 = std::move(x.m_type_identifier2); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x TypeIdentifierPair object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TypeIdentifierPair& x) const + { + return (m_type_identifier1 == x.m_type_identifier1 && + m_type_identifier2 == x.m_type_identifier2); + } + + /*! + * @brief Comparison operator. + * @param x TypeIdentifierPair object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TypeIdentifierPair& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member type_identifier1 + * @param _type_identifier1 New value to be copied in member type_identifier1 + */ + eProsima_user_DllExport void type_identifier1( + const TypeIdentifier& _type_identifier1) + { + m_type_identifier1 = _type_identifier1; + } + + /*! + * @brief This function moves the value in member type_identifier1 + * @param _type_identifier1 New value to be moved in member type_identifier1 + */ + eProsima_user_DllExport void type_identifier1( + TypeIdentifier&& _type_identifier1) + { + m_type_identifier1 = std::move(_type_identifier1); + } + + /*! + * @brief This function returns a constant reference to member type_identifier1 + * @return Constant reference to member type_identifier1 + */ + eProsima_user_DllExport const TypeIdentifier& type_identifier1() const + { + return m_type_identifier1; + } + + /*! + * @brief This function returns a reference to member type_identifier1 + * @return Reference to member type_identifier1 + */ + eProsima_user_DllExport TypeIdentifier& type_identifier1() + { + return m_type_identifier1; + } + + + /*! + * @brief This function copies the value in member type_identifier2 + * @param _type_identifier2 New value to be copied in member type_identifier2 + */ + eProsima_user_DllExport void type_identifier2( + const TypeIdentifier& _type_identifier2) + { + m_type_identifier2 = _type_identifier2; + } + + /*! + * @brief This function moves the value in member type_identifier2 + * @param _type_identifier2 New value to be moved in member type_identifier2 + */ + eProsima_user_DllExport void type_identifier2( + TypeIdentifier&& _type_identifier2) + { + m_type_identifier2 = std::move(_type_identifier2); + } + + /*! + * @brief This function returns a constant reference to member type_identifier2 + * @return Constant reference to member type_identifier2 + */ + eProsima_user_DllExport const TypeIdentifier& type_identifier2() const + { + return m_type_identifier2; + } + + /*! + * @brief This function returns a reference to member type_identifier2 + * @return Reference to member type_identifier2 + */ + eProsima_user_DllExport TypeIdentifier& type_identifier2() + { + return m_type_identifier2; + } + + + +private: + + TypeIdentifier m_type_identifier1; + TypeIdentifier m_type_identifier2; + +}; +typedef std::vector TypeIdentifierPairSeq; + +/*! + * @brief This class represents the structure TypeIdentfierWithSize defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class TypeIdentfierWithSize +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TypeIdentfierWithSize() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TypeIdentfierWithSize() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object TypeIdentfierWithSize that will be copied. + */ + eProsima_user_DllExport TypeIdentfierWithSize( + const TypeIdentfierWithSize& x) + { + m_type_id = x.m_type_id; + + m_typeobject_serialized_size = x.m_typeobject_serialized_size; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object TypeIdentfierWithSize that will be copied. + */ + eProsima_user_DllExport TypeIdentfierWithSize( + TypeIdentfierWithSize&& x) noexcept + { + m_type_id = std::move(x.m_type_id); + m_typeobject_serialized_size = x.m_typeobject_serialized_size; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object TypeIdentfierWithSize that will be copied. + */ + eProsima_user_DllExport TypeIdentfierWithSize& operator =( + const TypeIdentfierWithSize& x) + { + + m_type_id = x.m_type_id; + + m_typeobject_serialized_size = x.m_typeobject_serialized_size; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object TypeIdentfierWithSize that will be copied. + */ + eProsima_user_DllExport TypeIdentfierWithSize& operator =( + TypeIdentfierWithSize&& x) noexcept + { + + m_type_id = std::move(x.m_type_id); + m_typeobject_serialized_size = x.m_typeobject_serialized_size; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x TypeIdentfierWithSize object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TypeIdentfierWithSize& x) const + { + return (m_type_id == x.m_type_id && + m_typeobject_serialized_size == x.m_typeobject_serialized_size); + } + + /*! + * @brief Comparison operator. + * @param x TypeIdentfierWithSize object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TypeIdentfierWithSize& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member type_id + * @param _type_id New value to be copied in member type_id + */ + eProsima_user_DllExport void type_id( + const TypeIdentifier& _type_id) + { + m_type_id = _type_id; + } + + /*! + * @brief This function moves the value in member type_id + * @param _type_id New value to be moved in member type_id + */ + eProsima_user_DllExport void type_id( + TypeIdentifier&& _type_id) + { + m_type_id = std::move(_type_id); + } + + /*! + * @brief This function returns a constant reference to member type_id + * @return Constant reference to member type_id + */ + eProsima_user_DllExport const TypeIdentifier& type_id() const + { + return m_type_id; + } + + /*! + * @brief This function returns a reference to member type_id + * @return Reference to member type_id + */ + eProsima_user_DllExport TypeIdentifier& type_id() + { + return m_type_id; + } + + + /*! + * @brief This function sets a value in member typeobject_serialized_size + * @param _typeobject_serialized_size New value for member typeobject_serialized_size + */ + eProsima_user_DllExport void typeobject_serialized_size( + uint32_t _typeobject_serialized_size) + { + m_typeobject_serialized_size = _typeobject_serialized_size; + } + + /*! + * @brief This function returns the value of member typeobject_serialized_size + * @return Value of member typeobject_serialized_size + */ + eProsima_user_DllExport uint32_t typeobject_serialized_size() const + { + return m_typeobject_serialized_size; + } + + /*! + * @brief This function returns a reference to member typeobject_serialized_size + * @return Reference to member typeobject_serialized_size + */ + eProsima_user_DllExport uint32_t& typeobject_serialized_size() + { + return m_typeobject_serialized_size; + } + + + +private: + + TypeIdentifier m_type_id; + uint32_t m_typeobject_serialized_size{0}; + +}; +typedef std::vector TypeIdentfierWithSizeSeq; + +/*! + * @brief This class represents the structure TypeIdentifierWithDependencies defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class TypeIdentifierWithDependencies +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TypeIdentifierWithDependencies() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TypeIdentifierWithDependencies() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object TypeIdentifierWithDependencies that will be copied. + */ + eProsima_user_DllExport TypeIdentifierWithDependencies( + const TypeIdentifierWithDependencies& x) + { + m_typeid_with_size = x.m_typeid_with_size; + + m_dependent_typeid_count = x.m_dependent_typeid_count; + + m_dependent_typeids = x.m_dependent_typeids; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object TypeIdentifierWithDependencies that will be copied. + */ + eProsima_user_DllExport TypeIdentifierWithDependencies( + TypeIdentifierWithDependencies&& x) noexcept + { + m_typeid_with_size = std::move(x.m_typeid_with_size); + m_dependent_typeid_count = x.m_dependent_typeid_count; + m_dependent_typeids = std::move(x.m_dependent_typeids); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object TypeIdentifierWithDependencies that will be copied. + */ + eProsima_user_DllExport TypeIdentifierWithDependencies& operator =( + const TypeIdentifierWithDependencies& x) + { + + m_typeid_with_size = x.m_typeid_with_size; + + m_dependent_typeid_count = x.m_dependent_typeid_count; + + m_dependent_typeids = x.m_dependent_typeids; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object TypeIdentifierWithDependencies that will be copied. + */ + eProsima_user_DllExport TypeIdentifierWithDependencies& operator =( + TypeIdentifierWithDependencies&& x) noexcept + { + + m_typeid_with_size = std::move(x.m_typeid_with_size); + m_dependent_typeid_count = x.m_dependent_typeid_count; + m_dependent_typeids = std::move(x.m_dependent_typeids); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x TypeIdentifierWithDependencies object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TypeIdentifierWithDependencies& x) const + { + return (m_typeid_with_size == x.m_typeid_with_size && + m_dependent_typeid_count == x.m_dependent_typeid_count && + m_dependent_typeids == x.m_dependent_typeids); + } + + /*! + * @brief Comparison operator. + * @param x TypeIdentifierWithDependencies object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TypeIdentifierWithDependencies& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member typeid_with_size + * @param _typeid_with_size New value to be copied in member typeid_with_size + */ + eProsima_user_DllExport void typeid_with_size( + const TypeIdentfierWithSize& _typeid_with_size) + { + m_typeid_with_size = _typeid_with_size; + } + + /*! + * @brief This function moves the value in member typeid_with_size + * @param _typeid_with_size New value to be moved in member typeid_with_size + */ + eProsima_user_DllExport void typeid_with_size( + TypeIdentfierWithSize&& _typeid_with_size) + { + m_typeid_with_size = std::move(_typeid_with_size); + } + + /*! + * @brief This function returns a constant reference to member typeid_with_size + * @return Constant reference to member typeid_with_size + */ + eProsima_user_DllExport const TypeIdentfierWithSize& typeid_with_size() const + { + return m_typeid_with_size; + } + + /*! + * @brief This function returns a reference to member typeid_with_size + * @return Reference to member typeid_with_size + */ + eProsima_user_DllExport TypeIdentfierWithSize& typeid_with_size() + { + return m_typeid_with_size; + } + + + /*! + * @brief This function sets a value in member dependent_typeid_count + * @param _dependent_typeid_count New value for member dependent_typeid_count + */ + eProsima_user_DllExport void dependent_typeid_count( + int32_t _dependent_typeid_count) + { + m_dependent_typeid_count = _dependent_typeid_count; + } + + /*! + * @brief This function returns the value of member dependent_typeid_count + * @return Value of member dependent_typeid_count + */ + eProsima_user_DllExport int32_t dependent_typeid_count() const + { + return m_dependent_typeid_count; + } + + /*! + * @brief This function returns a reference to member dependent_typeid_count + * @return Reference to member dependent_typeid_count + */ + eProsima_user_DllExport int32_t& dependent_typeid_count() + { + return m_dependent_typeid_count; + } + + + /*! + * @brief This function copies the value in member dependent_typeids + * @param _dependent_typeids New value to be copied in member dependent_typeids + */ + eProsima_user_DllExport void dependent_typeids( + const std::vector& _dependent_typeids) + { + m_dependent_typeids = _dependent_typeids; + } + + /*! + * @brief This function moves the value in member dependent_typeids + * @param _dependent_typeids New value to be moved in member dependent_typeids + */ + eProsima_user_DllExport void dependent_typeids( + std::vector&& _dependent_typeids) + { + m_dependent_typeids = std::move(_dependent_typeids); + } + + /*! + * @brief This function returns a constant reference to member dependent_typeids + * @return Constant reference to member dependent_typeids + */ + eProsima_user_DllExport const std::vector& dependent_typeids() const + { + return m_dependent_typeids; + } + + /*! + * @brief This function returns a reference to member dependent_typeids + * @return Reference to member dependent_typeids + */ + eProsima_user_DllExport std::vector& dependent_typeids() + { + return m_dependent_typeids; + } + + + +private: + + TypeIdentfierWithSize m_typeid_with_size; + int32_t m_dependent_typeid_count{0}; + std::vector m_dependent_typeids; + +}; +typedef std::vector TypeIdentifierWithDependenciesSeq; + +/*! + * @brief This class represents the structure TypeInformation defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class TypeInformation +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport TypeInformation() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~TypeInformation() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object TypeInformation that will be copied. + */ + eProsima_user_DllExport TypeInformation( + const TypeInformation& x) + { + m_minimal = x.m_minimal; + + m_complete = x.m_complete; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object TypeInformation that will be copied. + */ + eProsima_user_DllExport TypeInformation( + TypeInformation&& x) noexcept + { + m_minimal = std::move(x.m_minimal); + m_complete = std::move(x.m_complete); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object TypeInformation that will be copied. + */ + eProsima_user_DllExport TypeInformation& operator =( + const TypeInformation& x) + { + + m_minimal = x.m_minimal; + + m_complete = x.m_complete; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object TypeInformation that will be copied. + */ + eProsima_user_DllExport TypeInformation& operator =( + TypeInformation&& x) noexcept + { + + m_minimal = std::move(x.m_minimal); + m_complete = std::move(x.m_complete); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x TypeInformation object to compare. + */ + eProsima_user_DllExport bool operator ==( + const TypeInformation& x) const + { + return (m_minimal == x.m_minimal && + m_complete == x.m_complete); + } + + /*! + * @brief Comparison operator. + * @param x TypeInformation object to compare. + */ + eProsima_user_DllExport bool operator !=( + const TypeInformation& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member minimal + * @param _minimal New value to be copied in member minimal + */ + eProsima_user_DllExport void minimal( + const TypeIdentifierWithDependencies& _minimal) + { + m_minimal = _minimal; + } + + /*! + * @brief This function moves the value in member minimal + * @param _minimal New value to be moved in member minimal + */ + eProsima_user_DllExport void minimal( + TypeIdentifierWithDependencies&& _minimal) + { + m_minimal = std::move(_minimal); + } + + /*! + * @brief This function returns a constant reference to member minimal + * @return Constant reference to member minimal + */ + eProsima_user_DllExport const TypeIdentifierWithDependencies& minimal() const + { + return m_minimal; + } + + /*! + * @brief This function returns a reference to member minimal + * @return Reference to member minimal + */ + eProsima_user_DllExport TypeIdentifierWithDependencies& minimal() + { + return m_minimal; + } + + + /*! + * @brief This function copies the value in member complete + * @param _complete New value to be copied in member complete + */ + eProsima_user_DllExport void complete( + const TypeIdentifierWithDependencies& _complete) + { + m_complete = _complete; + } + + /*! + * @brief This function moves the value in member complete + * @param _complete New value to be moved in member complete + */ + eProsima_user_DllExport void complete( + TypeIdentifierWithDependencies&& _complete) + { + m_complete = std::move(_complete); + } + + /*! + * @brief This function returns a constant reference to member complete + * @return Constant reference to member complete + */ + eProsima_user_DllExport const TypeIdentifierWithDependencies& complete() const + { + return m_complete; + } + + /*! + * @brief This function returns a reference to member complete + * @return Reference to member complete + */ + eProsima_user_DllExport TypeIdentifierWithDependencies& complete() + { + return m_complete; + } + + + +private: + + TypeIdentifierWithDependencies m_minimal; + TypeIdentifierWithDependencies m_complete; + +}; +typedef std::vector TypeInformationSeq; + + +} // namespace xtypes + + +} // namespace dds + +} // namespace fastdds + +} // namespace eprosima + + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_XTYPES_DDS_XTYPES_TYPEOBJECT_HPP_ + + diff --git a/include/fastdds/dds/xtypes/type_representation/detail/dds_xtypes_typeobjectCdrAux.hpp b/include/fastdds/dds/xtypes/type_representation/detail/dds_xtypes_typeobjectCdrAux.hpp new file mode 100644 index 00000000000..4a9d0b5e4da --- /dev/null +++ b/include/fastdds/dds/xtypes/type_representation/detail/dds_xtypes_typeobjectCdrAux.hpp @@ -0,0 +1,808 @@ +// 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 dds_xtypes_typeobjectCdrAux.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_DDS_XTYPES_DDS_XTYPES_TYPEOBJECTCDRAUX_HPP_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_XTYPES_DDS_XTYPES_TYPEOBJECTCDRAUX_HPP_ + +#include "dds_xtypes_typeobject.hpp" + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteStructMember_max_cdr_typesize {1436UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteStructMember_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteBitflag_max_cdr_typesize {1404UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteBitflag_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_PlainArraySElemDefn_max_cdr_typesize {40UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_PlainArraySElemDefn_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonEnumeratedLiteral_max_cdr_typesize {10UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonEnumeratedLiteral_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalBitsetType_max_cdr_typesize {20UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalBitsetType_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonBitflag_max_cdr_typesize {4UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonBitflag_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalAliasType_max_cdr_typesize {44UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalAliasType_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteEnumeratedType_max_cdr_typesize {672UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteEnumeratedType_max_key_cdr_typesize {0UL}; + + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteUnionHeader_max_cdr_typesize {653UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteUnionHeader_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalDiscriminatorMember_max_cdr_typesize {36UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalDiscriminatorMember_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteAliasHeader_max_cdr_typesize {653UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteAliasHeader_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteStructType_max_cdr_typesize {700UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteStructType_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonCollectionElement_max_cdr_typesize {32UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonCollectionElement_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalCollectionElement_max_cdr_typesize {36UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalCollectionElement_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_PlainCollectionHeader_max_cdr_typesize {4UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_PlainCollectionHeader_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_ExtendedAnnotationParameterValue_max_cdr_typesize {4UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_ExtendedAnnotationParameterValue_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalUnionHeader_max_cdr_typesize {4UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalUnionHeader_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalCollectionHeader_max_cdr_typesize {8UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalCollectionHeader_max_key_cdr_typesize {0UL}; + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalAnnotationType_max_cdr_typesize {16UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalAnnotationType_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalAliasHeader_max_cdr_typesize {4UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalAliasHeader_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonUnionMember_max_cdr_typesize {40UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonUnionMember_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonCollectionHeader_max_cdr_typesize {4UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonCollectionHeader_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalArrayType_max_cdr_typesize {48UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalArrayType_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteBitsetType_max_cdr_typesize {672UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteBitsetType_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_PlainArrayLElemDefn_max_cdr_typesize {40UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_PlainArrayLElemDefn_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonAliasBody_max_cdr_typesize {32UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonAliasBody_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonBitfield_max_cdr_typesize {6UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonBitfield_max_key_cdr_typesize {0UL}; + + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalStructHeader_max_cdr_typesize {36UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalStructHeader_max_key_cdr_typesize {0UL}; + + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalAnnotationParameter_max_cdr_typesize {304UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalAnnotationParameter_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteExtendedType_max_cdr_typesize {4UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteExtendedType_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteAnnotationHeader_max_cdr_typesize {265UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteAnnotationHeader_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalEnumeratedLiteral_max_cdr_typesize {18UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalEnumeratedLiteral_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteAliasType_max_cdr_typesize {1828UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteAliasType_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonBitmaskHeader_max_cdr_typesize {2UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonBitmaskHeader_max_key_cdr_typesize {0UL}; + + + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalStructMember_max_cdr_typesize {44UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalStructMember_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteTypeDetail_max_cdr_typesize {649UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteTypeDetail_max_key_cdr_typesize {0UL}; + + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalBitmaskType_max_cdr_typesize {24UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalBitmaskType_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteArrayHeader_max_cdr_typesize {657UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteArrayHeader_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalStructType_max_cdr_typesize {48UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalStructType_max_key_cdr_typesize {0UL}; + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteMapType_max_cdr_typesize {3012UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteMapType_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteEnumeratedHeader_max_cdr_typesize {657UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteEnumeratedHeader_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteBitsetHeader_max_cdr_typesize {653UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteBitsetHeader_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteBitfield_max_cdr_typesize {1408UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteBitfield_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_TypeIdentifierPair_max_cdr_typesize {64UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_TypeIdentifierPair_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_AppliedBuiltinMemberAnnotations_max_cdr_typesize {1100UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_AppliedBuiltinMemberAnnotations_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalMemberDetail_max_cdr_typesize {4UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalMemberDetail_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_AppliedBuiltinTypeAnnotations_max_cdr_typesize {356UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_AppliedBuiltinTypeAnnotations_max_key_cdr_typesize {0UL}; + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteCollectionHeader_max_cdr_typesize {669UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteCollectionHeader_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalMapType_max_cdr_typesize {84UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalMapType_max_key_cdr_typesize {0UL}; + + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_TypeInformation_max_cdr_typesize {140UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_TypeInformation_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteEnumeratedLiteral_max_cdr_typesize {1412UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteEnumeratedLiteral_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteCollectionElement_max_cdr_typesize {1168UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteCollectionElement_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalAnnotationHeader_max_cdr_typesize {4UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalAnnotationHeader_max_key_cdr_typesize {0UL}; + + + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_TypeIdentifierWithDependencies_max_cdr_typesize {56UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_TypeIdentifierWithDependencies_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalEnumeratedType_max_cdr_typesize {20UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalEnumeratedType_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteArrayType_max_cdr_typesize {1836UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteArrayType_max_key_cdr_typesize {0UL}; + + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteStructHeader_max_cdr_typesize {685UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteStructHeader_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteAnnotationType_max_cdr_typesize {280UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteAnnotationType_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_AppliedAnnotationParameter_max_cdr_typesize {272UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_AppliedAnnotationParameter_max_key_cdr_typesize {0UL}; + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_PlainMapSTypeDefn_max_cdr_typesize {68UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_PlainMapSTypeDefn_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalAliasBody_max_cdr_typesize {36UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalAliasBody_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_PlainSequenceLElemDefn_max_cdr_typesize {40UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_PlainSequenceLElemDefn_max_key_cdr_typesize {0UL}; + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_StringSTypeDefn_max_cdr_typesize {1UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_StringSTypeDefn_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_ExtendedTypeDefn_max_cdr_typesize {4UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_ExtendedTypeDefn_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteElementDetail_max_cdr_typesize {1132UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteElementDetail_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteAliasBody_max_cdr_typesize {1168UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteAliasBody_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_StringLTypeDefn_max_cdr_typesize {4UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_StringLTypeDefn_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteSequenceType_max_cdr_typesize {1844UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteSequenceType_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteBitmaskType_max_cdr_typesize {676UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteBitmaskType_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonDiscriminatorMember_max_cdr_typesize {32UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonDiscriminatorMember_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalUnionMember_max_cdr_typesize {48UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalUnionMember_max_key_cdr_typesize {0UL}; + + + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonAnnotationParameter_max_cdr_typesize {32UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonAnnotationParameter_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_PlainMapLTypeDefn_max_cdr_typesize {72UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_PlainMapLTypeDefn_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonEnumeratedHeader_max_cdr_typesize {2UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonEnumeratedHeader_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_TypeIdentifierTypeObjectPair_max_cdr_typesize {3048UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_TypeIdentifierTypeObjectPair_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalSequenceType_max_cdr_typesize {48UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalSequenceType_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalBitflag_max_cdr_typesize {12UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalBitflag_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalBitsetHeader_max_cdr_typesize {4UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalBitsetHeader_max_key_cdr_typesize {0UL}; + + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteAnnotationParameter_max_cdr_typesize {560UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteAnnotationParameter_max_key_cdr_typesize {0UL}; + + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_AppliedAnnotation_max_cdr_typesize {56UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_AppliedAnnotation_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonStructMember_max_cdr_typesize {36UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonStructMember_max_key_cdr_typesize {0UL}; + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonArrayHeader_max_cdr_typesize {4UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CommonArrayHeader_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalEnumeratedHeader_max_cdr_typesize {6UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalEnumeratedHeader_max_key_cdr_typesize {0UL}; + + + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalTypeDetail_max_cdr_typesize {0UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalTypeDetail_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteDiscriminatorMember_max_cdr_typesize {424UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteDiscriminatorMember_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalUnionType_max_cdr_typesize {52UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalUnionType_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalBitfield_max_cdr_typesize {14UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalBitfield_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalExtendedType_max_cdr_typesize {4UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalExtendedType_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_StronglyConnectedComponentId_max_cdr_typesize {28UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_StronglyConnectedComponentId_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_TypeIdentfierWithSize_max_cdr_typesize {40UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_TypeIdentfierWithSize_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalArrayHeader_max_cdr_typesize {8UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_MinimalArrayHeader_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_PlainSequenceSElemDefn_max_cdr_typesize {36UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_PlainSequenceSElemDefn_max_key_cdr_typesize {0UL}; + + +constexpr uint32_t eprosima_fastdds_dds_xtypes_AppliedVerbatimAnnotation_max_cdr_typesize {340UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_AppliedVerbatimAnnotation_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteMemberDetail_max_cdr_typesize {1396UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteMemberDetail_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteUnionMember_max_cdr_typesize {1440UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteUnionMember_max_key_cdr_typesize {0UL}; + +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteUnionType_max_cdr_typesize {1092UL}; +constexpr uint32_t eprosima_fastdds_dds_xtypes_CompleteUnionType_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::dds::xtypes::StringSTypeDefn& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::StringLTypeDefn& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::PlainCollectionHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::PlainSequenceSElemDefn& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::PlainSequenceLElemDefn& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::PlainArraySElemDefn& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::PlainArrayLElemDefn& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::PlainMapSTypeDefn& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::PlainMapLTypeDefn& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::StronglyConnectedComponentId& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::ExtendedTypeDefn& data); + + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::ExtendedAnnotationParameterValue& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::AppliedAnnotationParameter& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::AppliedAnnotation& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::AppliedVerbatimAnnotation& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::AppliedBuiltinMemberAnnotations& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonStructMember& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteMemberDetail& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalMemberDetail& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteStructMember& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalStructMember& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::AppliedBuiltinTypeAnnotations& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalTypeDetail& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteTypeDetail& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteStructHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalStructHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteStructType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalStructType& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonUnionMember& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteUnionMember& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalUnionMember& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonDiscriminatorMember& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteDiscriminatorMember& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalDiscriminatorMember& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteUnionHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalUnionHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteUnionType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalUnionType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonAnnotationParameter& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteAnnotationParameter& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalAnnotationParameter& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteAnnotationHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalAnnotationHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteAnnotationType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalAnnotationType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonAliasBody& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteAliasBody& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalAliasBody& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteAliasHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalAliasHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteAliasType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalAliasType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteElementDetail& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonCollectionElement& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteCollectionElement& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalCollectionElement& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonCollectionHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteCollectionHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalCollectionHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteSequenceType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalSequenceType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonArrayHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteArrayHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalArrayHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteArrayType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalArrayType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteMapType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalMapType& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonEnumeratedLiteral& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteEnumeratedLiteral& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalEnumeratedLiteral& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonEnumeratedHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteEnumeratedHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalEnumeratedHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteEnumeratedType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalEnumeratedType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonBitflag& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteBitflag& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalBitflag& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonBitmaskHeader& data); + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteBitmaskType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalBitmaskType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CommonBitfield& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteBitfield& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalBitfield& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteBitsetHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalBitsetHeader& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteBitsetType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalBitsetType& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::CompleteExtendedType& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::MinimalExtendedType& data); + + + + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::TypeIdentifierTypeObjectPair& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::TypeIdentifierPair& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::TypeIdentfierWithSize& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::TypeIdentifierWithDependencies& data); + + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const eprosima::fastdds::dds::xtypes::TypeInformation& data); + + + +} // namespace fastcdr +} // namespace eprosima + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_XTYPES_DDS_XTYPES_TYPEOBJECTCDRAUX_HPP_ + diff --git a/include/fastdds/dds/xtypes/type_representation/detail/dds_xtypes_typeobjectPubSubTypes.h b/include/fastdds/dds/xtypes/type_representation/detail/dds_xtypes_typeobjectPubSubTypes.h new file mode 100644 index 00000000000..e0ab20d2983 --- /dev/null +++ b/include/fastdds/dds/xtypes/type_representation/detail/dds_xtypes_typeobjectPubSubTypes.h @@ -0,0 +1,9261 @@ +// 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 dds_xtypes_typeobjectPubSubTypes.h + * This header file contains the declaration of the serialization functions. + * + * This file was generated by the tool fastddsgen. + */ + + +#ifndef _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_XTYPES_DDS_XTYPES_TYPEOBJECT_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_XTYPES_DDS_XTYPES_TYPEOBJECT_PUBSUBTYPES_H_ + +#include +#include +#include +#include +#include + +#include "dds_xtypes_typeobject.hpp" + + +#if !defined(GEN_API_VER) || (GEN_API_VER != 2) +#error \ + Generated dds_xtypes_typeobject is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. +#endif // GEN_API_VER + +namespace eprosima { + +namespace fastdds { + +namespace dds { + + +namespace xtypes { + + +typedef uint8_t EquivalenceKind; + + + +typedef uint8_t TypeKind; + + + + + + + + + + + + + + + + + + + + + + + + + + + + +typedef uint8_t TypeIdentiferKind; + + + + + + + + + + + + +typedef eprosima::fastcdr::fixed_string MemberName; + +typedef eprosima::fastcdr::fixed_string QualifiedTypeName; +typedef uint8_t PrimitiveTypeId; +typedef std::array EquivalenceHash; +typedef std::array NameHash; +typedef uint32_t LBound; +typedef std::vector LBoundSeq; + +typedef uint8_t SBound; +typedef std::vector SBoundSeq; + + + +typedef eprosima::fastdds::dds::xtypes::MemberFlag CollectionElementFlag; +typedef eprosima::fastdds::dds::xtypes::MemberFlag StructMemberFlag; +typedef eprosima::fastdds::dds::xtypes::MemberFlag UnionMemberFlag; +typedef eprosima::fastdds::dds::xtypes::MemberFlag UnionDiscriminatorFlag; +typedef eprosima::fastdds::dds::xtypes::MemberFlag EnumeratedLiteralFlag; +typedef eprosima::fastdds::dds::xtypes::MemberFlag AnnotationParameterFlag; +typedef eprosima::fastdds::dds::xtypes::MemberFlag AliasMemberFlag; +typedef eprosima::fastdds::dds::xtypes::MemberFlag BitflagFlag; +typedef eprosima::fastdds::dds::xtypes::MemberFlag BitsetMemberFlag; + + +typedef eprosima::fastdds::dds::xtypes::TypeFlag StructTypeFlag; +typedef eprosima::fastdds::dds::xtypes::TypeFlag UnionTypeFlag; +typedef eprosima::fastdds::dds::xtypes::TypeFlag CollectionTypeFlag; +typedef eprosima::fastdds::dds::xtypes::TypeFlag AnnotationTypeFlag; +typedef eprosima::fastdds::dds::xtypes::TypeFlag AliasTypeFlag; +typedef eprosima::fastdds::dds::xtypes::TypeFlag EnumTypeFlag; +typedef eprosima::fastdds::dds::xtypes::TypeFlag BitmaskTypeFlag; +typedef eprosima::fastdds::dds::xtypes::TypeFlag BitsetTypeFlag; + + + +#ifndef SWIG +namespace detail { + +template +struct StringSTypeDefn_rob +{ + friend constexpr typename Tag::type get( + Tag) + { + return M; + } + +}; + +struct StringSTypeDefn_f +{ + typedef eprosima::fastdds::dds::xtypes::SBound StringSTypeDefn::* type; + friend constexpr type get( + StringSTypeDefn_f); +}; + +template struct StringSTypeDefn_rob; + +template +inline size_t constexpr StringSTypeDefn_offset_of() +{ + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); +} + +} // namespace detail +#endif // ifndef SWIG + + +/*! + * @brief This class represents the TopicDataType of the type StringSTypeDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class StringSTypeDefnPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef StringSTypeDefn type; + + eProsima_user_DllExport StringSTypeDefnPubSubType(); + + eProsima_user_DllExport ~StringSTypeDefnPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return 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 + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) StringSTypeDefn(); + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return 1ULL == + (detail::StringSTypeDefn_offset_of() + + sizeof(eprosima::fastdds::dds::xtypes::SBound)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 1ULL == + (detail::StringSTypeDefn_offset_of() + + sizeof(eprosima::fastdds::dds::xtypes::SBound)); + } + +}; + +#ifndef SWIG +namespace detail { + +template +struct StringLTypeDefn_rob +{ + friend constexpr typename Tag::type get( + Tag) + { + return M; + } + +}; + +struct StringLTypeDefn_f +{ + typedef eprosima::fastdds::dds::xtypes::LBound StringLTypeDefn::* type; + friend constexpr type get( + StringLTypeDefn_f); +}; + +template struct StringLTypeDefn_rob; + +template +inline size_t constexpr StringLTypeDefn_offset_of() +{ + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); +} + +} // namespace detail +#endif // ifndef SWIG + + +/*! + * @brief This class represents the TopicDataType of the type StringLTypeDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class StringLTypeDefnPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef StringLTypeDefn type; + + eProsima_user_DllExport StringLTypeDefnPubSubType(); + + eProsima_user_DllExport ~StringLTypeDefnPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return 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 + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) StringLTypeDefn(); + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return 4ULL == + (detail::StringLTypeDefn_offset_of() + + sizeof(eprosima::fastdds::dds::xtypes::LBound)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 4ULL == + (detail::StringLTypeDefn_offset_of() + + sizeof(eprosima::fastdds::dds::xtypes::LBound)); + } + +}; + +/*! + * @brief This class represents the TopicDataType of the type PlainCollectionHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class PlainCollectionHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef PlainCollectionHeader type; + + eProsima_user_DllExport PlainCollectionHeaderPubSubType(); + + eProsima_user_DllExport ~PlainCollectionHeaderPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type PlainSequenceSElemDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class PlainSequenceSElemDefnPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef PlainSequenceSElemDefn type; + + eProsima_user_DllExport PlainSequenceSElemDefnPubSubType(); + + eProsima_user_DllExport ~PlainSequenceSElemDefnPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type PlainSequenceLElemDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class PlainSequenceLElemDefnPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef PlainSequenceLElemDefn type; + + eProsima_user_DllExport PlainSequenceLElemDefnPubSubType(); + + eProsima_user_DllExport ~PlainSequenceLElemDefnPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type PlainArraySElemDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class PlainArraySElemDefnPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef PlainArraySElemDefn type; + + eProsima_user_DllExport PlainArraySElemDefnPubSubType(); + + eProsima_user_DllExport ~PlainArraySElemDefnPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type PlainArrayLElemDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class PlainArrayLElemDefnPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef PlainArrayLElemDefn type; + + eProsima_user_DllExport PlainArrayLElemDefnPubSubType(); + + eProsima_user_DllExport ~PlainArrayLElemDefnPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type PlainMapSTypeDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class PlainMapSTypeDefnPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef PlainMapSTypeDefn type; + + eProsima_user_DllExport PlainMapSTypeDefnPubSubType(); + + eProsima_user_DllExport ~PlainMapSTypeDefnPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type PlainMapLTypeDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class PlainMapLTypeDefnPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef PlainMapLTypeDefn type; + + eProsima_user_DllExport PlainMapLTypeDefnPubSubType(); + + eProsima_user_DllExport ~PlainMapLTypeDefnPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type StronglyConnectedComponentId defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class StronglyConnectedComponentIdPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef StronglyConnectedComponentId type; + + eProsima_user_DllExport StronglyConnectedComponentIdPubSubType(); + + eProsima_user_DllExport ~StronglyConnectedComponentIdPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type ExtendedTypeDefn defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class ExtendedTypeDefnPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef ExtendedTypeDefn type; + + eProsima_user_DllExport ExtendedTypeDefnPubSubType(); + + eProsima_user_DllExport ~ExtendedTypeDefnPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +typedef std::vector TypeIdentifierSeq; +typedef uint32_t MemberId; + + + +/*! + * @brief This class represents the TopicDataType of the type ExtendedAnnotationParameterValue defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class ExtendedAnnotationParameterValuePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef ExtendedAnnotationParameterValue type; + + eProsima_user_DllExport ExtendedAnnotationParameterValuePubSubType(); + + eProsima_user_DllExport ~ExtendedAnnotationParameterValuePubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + + +/*! + * @brief This class represents the TopicDataType of the type AppliedAnnotationParameter defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class AppliedAnnotationParameterPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef AppliedAnnotationParameter type; + + eProsima_user_DllExport AppliedAnnotationParameterPubSubType(); + + eProsima_user_DllExport ~AppliedAnnotationParameterPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector AppliedAnnotationParameterSeq; + +/*! + * @brief This class represents the TopicDataType of the type AppliedAnnotation defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class AppliedAnnotationPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef AppliedAnnotation type; + + eProsima_user_DllExport AppliedAnnotationPubSubType(); + + eProsima_user_DllExport ~AppliedAnnotationPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector AppliedAnnotationSeq; + +/*! + * @brief This class represents the TopicDataType of the type AppliedVerbatimAnnotation defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class AppliedVerbatimAnnotationPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef AppliedVerbatimAnnotation type; + + eProsima_user_DllExport AppliedVerbatimAnnotationPubSubType(); + + eProsima_user_DllExport ~AppliedVerbatimAnnotationPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type AppliedBuiltinMemberAnnotations defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class AppliedBuiltinMemberAnnotationsPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef AppliedBuiltinMemberAnnotations type; + + eProsima_user_DllExport AppliedBuiltinMemberAnnotationsPubSubType(); + + eProsima_user_DllExport ~AppliedBuiltinMemberAnnotationsPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CommonStructMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonStructMemberPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CommonStructMember type; + + eProsima_user_DllExport CommonStructMemberPubSubType(); + + eProsima_user_DllExport ~CommonStructMemberPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteMemberDetail defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteMemberDetailPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteMemberDetail type; + + eProsima_user_DllExport CompleteMemberDetailPubSubType(); + + eProsima_user_DllExport ~CompleteMemberDetailPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +#ifndef SWIG +namespace detail { + +template +struct MinimalMemberDetail_rob +{ + friend constexpr typename Tag::type get( + Tag) + { + return M; + } + +}; + +struct MinimalMemberDetail_f +{ + typedef eprosima::fastdds::dds::xtypes::NameHash MinimalMemberDetail::* type; + friend constexpr type get( + MinimalMemberDetail_f); +}; + +template struct MinimalMemberDetail_rob; + +template +inline size_t constexpr MinimalMemberDetail_offset_of() +{ + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); +} + +} // namespace detail +#endif // ifndef SWIG + + +/*! + * @brief This class represents the TopicDataType of the type MinimalMemberDetail defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalMemberDetailPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalMemberDetail type; + + eProsima_user_DllExport MinimalMemberDetailPubSubType(); + + eProsima_user_DllExport ~MinimalMemberDetailPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return 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 + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) MinimalMemberDetail(); + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return 4ULL == + (detail::MinimalMemberDetail_offset_of() + + sizeof(eprosima::fastdds::dds::xtypes::NameHash)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 4ULL == + (detail::MinimalMemberDetail_offset_of() + + sizeof(eprosima::fastdds::dds::xtypes::NameHash)); + } + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteStructMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteStructMemberPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteStructMember type; + + eProsima_user_DllExport CompleteStructMemberPubSubType(); + + eProsima_user_DllExport ~CompleteStructMemberPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector CompleteStructMemberSeq; + +/*! + * @brief This class represents the TopicDataType of the type MinimalStructMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalStructMemberPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalStructMember type; + + eProsima_user_DllExport MinimalStructMemberPubSubType(); + + eProsima_user_DllExport ~MinimalStructMemberPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector MinimalStructMemberSeq; + +/*! + * @brief This class represents the TopicDataType of the type AppliedBuiltinTypeAnnotations defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class AppliedBuiltinTypeAnnotationsPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef AppliedBuiltinTypeAnnotations type; + + eProsima_user_DllExport AppliedBuiltinTypeAnnotationsPubSubType(); + + eProsima_user_DllExport ~AppliedBuiltinTypeAnnotationsPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalTypeDetail defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalTypeDetailPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalTypeDetail type; + + eProsima_user_DllExport MinimalTypeDetailPubSubType(); + + eProsima_user_DllExport ~MinimalTypeDetailPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return 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 + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) MinimalTypeDetail(); + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return true; + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return true; + } + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteTypeDetail defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteTypeDetailPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteTypeDetail type; + + eProsima_user_DllExport CompleteTypeDetailPubSubType(); + + eProsima_user_DllExport ~CompleteTypeDetailPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteStructHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteStructHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteStructHeader type; + + eProsima_user_DllExport CompleteStructHeaderPubSubType(); + + eProsima_user_DllExport ~CompleteStructHeaderPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalStructHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalStructHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalStructHeader type; + + eProsima_user_DllExport MinimalStructHeaderPubSubType(); + + eProsima_user_DllExport ~MinimalStructHeaderPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteStructType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteStructTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteStructType type; + + eProsima_user_DllExport CompleteStructTypePubSubType(); + + eProsima_user_DllExport ~CompleteStructTypePubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalStructType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalStructTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalStructType type; + + eProsima_user_DllExport MinimalStructTypePubSubType(); + + eProsima_user_DllExport ~MinimalStructTypePubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector UnionCaseLabelSeq; + +/*! + * @brief This class represents the TopicDataType of the type CommonUnionMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonUnionMemberPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CommonUnionMember type; + + eProsima_user_DllExport CommonUnionMemberPubSubType(); + + eProsima_user_DllExport ~CommonUnionMemberPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteUnionMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteUnionMemberPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteUnionMember type; + + eProsima_user_DllExport CompleteUnionMemberPubSubType(); + + eProsima_user_DllExport ~CompleteUnionMemberPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector CompleteUnionMemberSeq; + +/*! + * @brief This class represents the TopicDataType of the type MinimalUnionMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalUnionMemberPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalUnionMember type; + + eProsima_user_DllExport MinimalUnionMemberPubSubType(); + + eProsima_user_DllExport ~MinimalUnionMemberPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector MinimalUnionMemberSeq; + +/*! + * @brief This class represents the TopicDataType of the type CommonDiscriminatorMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonDiscriminatorMemberPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CommonDiscriminatorMember type; + + eProsima_user_DllExport CommonDiscriminatorMemberPubSubType(); + + eProsima_user_DllExport ~CommonDiscriminatorMemberPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteDiscriminatorMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteDiscriminatorMemberPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteDiscriminatorMember type; + + eProsima_user_DllExport CompleteDiscriminatorMemberPubSubType(); + + eProsima_user_DllExport ~CompleteDiscriminatorMemberPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalDiscriminatorMember defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalDiscriminatorMemberPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalDiscriminatorMember type; + + eProsima_user_DllExport MinimalDiscriminatorMemberPubSubType(); + + eProsima_user_DllExport ~MinimalDiscriminatorMemberPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteUnionHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteUnionHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteUnionHeader type; + + eProsima_user_DllExport CompleteUnionHeaderPubSubType(); + + eProsima_user_DllExport ~CompleteUnionHeaderPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalUnionHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalUnionHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalUnionHeader type; + + eProsima_user_DllExport MinimalUnionHeaderPubSubType(); + + eProsima_user_DllExport ~MinimalUnionHeaderPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteUnionType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteUnionTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteUnionType type; + + eProsima_user_DllExport CompleteUnionTypePubSubType(); + + eProsima_user_DllExport ~CompleteUnionTypePubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalUnionType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalUnionTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalUnionType type; + + eProsima_user_DllExport MinimalUnionTypePubSubType(); + + eProsima_user_DllExport ~MinimalUnionTypePubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CommonAnnotationParameter defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonAnnotationParameterPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CommonAnnotationParameter type; + + eProsima_user_DllExport CommonAnnotationParameterPubSubType(); + + eProsima_user_DllExport ~CommonAnnotationParameterPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteAnnotationParameter defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteAnnotationParameterPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteAnnotationParameter type; + + eProsima_user_DllExport CompleteAnnotationParameterPubSubType(); + + eProsima_user_DllExport ~CompleteAnnotationParameterPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector CompleteAnnotationParameterSeq; + +/*! + * @brief This class represents the TopicDataType of the type MinimalAnnotationParameter defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalAnnotationParameterPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalAnnotationParameter type; + + eProsima_user_DllExport MinimalAnnotationParameterPubSubType(); + + eProsima_user_DllExport ~MinimalAnnotationParameterPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector MinimalAnnotationParameterSeq; + +/*! + * @brief This class represents the TopicDataType of the type CompleteAnnotationHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteAnnotationHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteAnnotationHeader type; + + eProsima_user_DllExport CompleteAnnotationHeaderPubSubType(); + + eProsima_user_DllExport ~CompleteAnnotationHeaderPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalAnnotationHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalAnnotationHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalAnnotationHeader type; + + eProsima_user_DllExport MinimalAnnotationHeaderPubSubType(); + + eProsima_user_DllExport ~MinimalAnnotationHeaderPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteAnnotationType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteAnnotationTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteAnnotationType type; + + eProsima_user_DllExport CompleteAnnotationTypePubSubType(); + + eProsima_user_DllExport ~CompleteAnnotationTypePubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalAnnotationType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalAnnotationTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalAnnotationType type; + + eProsima_user_DllExport MinimalAnnotationTypePubSubType(); + + eProsima_user_DllExport ~MinimalAnnotationTypePubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CommonAliasBody defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonAliasBodyPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CommonAliasBody type; + + eProsima_user_DllExport CommonAliasBodyPubSubType(); + + eProsima_user_DllExport ~CommonAliasBodyPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteAliasBody defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteAliasBodyPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteAliasBody type; + + eProsima_user_DllExport CompleteAliasBodyPubSubType(); + + eProsima_user_DllExport ~CompleteAliasBodyPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalAliasBody defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalAliasBodyPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalAliasBody type; + + eProsima_user_DllExport MinimalAliasBodyPubSubType(); + + eProsima_user_DllExport ~MinimalAliasBodyPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteAliasHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteAliasHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteAliasHeader type; + + eProsima_user_DllExport CompleteAliasHeaderPubSubType(); + + eProsima_user_DllExport ~CompleteAliasHeaderPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalAliasHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalAliasHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalAliasHeader type; + + eProsima_user_DllExport MinimalAliasHeaderPubSubType(); + + eProsima_user_DllExport ~MinimalAliasHeaderPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteAliasType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteAliasTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteAliasType type; + + eProsima_user_DllExport CompleteAliasTypePubSubType(); + + eProsima_user_DllExport ~CompleteAliasTypePubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalAliasType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalAliasTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalAliasType type; + + eProsima_user_DllExport MinimalAliasTypePubSubType(); + + eProsima_user_DllExport ~MinimalAliasTypePubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteElementDetail defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteElementDetailPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteElementDetail type; + + eProsima_user_DllExport CompleteElementDetailPubSubType(); + + eProsima_user_DllExport ~CompleteElementDetailPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CommonCollectionElement defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonCollectionElementPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CommonCollectionElement type; + + eProsima_user_DllExport CommonCollectionElementPubSubType(); + + eProsima_user_DllExport ~CommonCollectionElementPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteCollectionElement defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteCollectionElementPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteCollectionElement type; + + eProsima_user_DllExport CompleteCollectionElementPubSubType(); + + eProsima_user_DllExport ~CompleteCollectionElementPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalCollectionElement defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalCollectionElementPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalCollectionElement type; + + eProsima_user_DllExport MinimalCollectionElementPubSubType(); + + eProsima_user_DllExport ~MinimalCollectionElementPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +#ifndef SWIG +namespace detail { + +template +struct CommonCollectionHeader_rob +{ + friend constexpr typename Tag::type get( + Tag) + { + return M; + } + +}; + +struct CommonCollectionHeader_f +{ + typedef eprosima::fastdds::dds::xtypes::LBound CommonCollectionHeader::* type; + friend constexpr type get( + CommonCollectionHeader_f); +}; + +template struct CommonCollectionHeader_rob; + +template +inline size_t constexpr CommonCollectionHeader_offset_of() +{ + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); +} + +} // namespace detail +#endif // ifndef SWIG + + +/*! + * @brief This class represents the TopicDataType of the type CommonCollectionHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonCollectionHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CommonCollectionHeader type; + + eProsima_user_DllExport CommonCollectionHeaderPubSubType(); + + eProsima_user_DllExport ~CommonCollectionHeaderPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return 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 + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) CommonCollectionHeader(); + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return 4ULL == + (detail::CommonCollectionHeader_offset_of() + + sizeof(eprosima::fastdds::dds::xtypes::LBound)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 4ULL == + (detail::CommonCollectionHeader_offset_of() + + sizeof(eprosima::fastdds::dds::xtypes::LBound)); + } + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteCollectionHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteCollectionHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteCollectionHeader type; + + eProsima_user_DllExport CompleteCollectionHeaderPubSubType(); + + eProsima_user_DllExport ~CompleteCollectionHeaderPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalCollectionHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalCollectionHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalCollectionHeader type; + + eProsima_user_DllExport MinimalCollectionHeaderPubSubType(); + + eProsima_user_DllExport ~MinimalCollectionHeaderPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteSequenceType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteSequenceTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteSequenceType type; + + eProsima_user_DllExport CompleteSequenceTypePubSubType(); + + eProsima_user_DllExport ~CompleteSequenceTypePubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalSequenceType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalSequenceTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalSequenceType type; + + eProsima_user_DllExport MinimalSequenceTypePubSubType(); + + eProsima_user_DllExport ~MinimalSequenceTypePubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CommonArrayHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonArrayHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CommonArrayHeader type; + + eProsima_user_DllExport CommonArrayHeaderPubSubType(); + + eProsima_user_DllExport ~CommonArrayHeaderPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteArrayHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteArrayHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteArrayHeader type; + + eProsima_user_DllExport CompleteArrayHeaderPubSubType(); + + eProsima_user_DllExport ~CompleteArrayHeaderPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalArrayHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalArrayHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalArrayHeader type; + + eProsima_user_DllExport MinimalArrayHeaderPubSubType(); + + eProsima_user_DllExport ~MinimalArrayHeaderPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteArrayType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteArrayTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteArrayType type; + + eProsima_user_DllExport CompleteArrayTypePubSubType(); + + eProsima_user_DllExport ~CompleteArrayTypePubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalArrayType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalArrayTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalArrayType type; + + eProsima_user_DllExport MinimalArrayTypePubSubType(); + + eProsima_user_DllExport ~MinimalArrayTypePubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteMapType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteMapTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteMapType type; + + eProsima_user_DllExport CompleteMapTypePubSubType(); + + eProsima_user_DllExport ~CompleteMapTypePubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalMapType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalMapTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalMapType type; + + eProsima_user_DllExport MinimalMapTypePubSubType(); + + eProsima_user_DllExport ~MinimalMapTypePubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef uint16_t BitBound; + +/*! + * @brief This class represents the TopicDataType of the type CommonEnumeratedLiteral defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonEnumeratedLiteralPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CommonEnumeratedLiteral type; + + eProsima_user_DllExport CommonEnumeratedLiteralPubSubType(); + + eProsima_user_DllExport ~CommonEnumeratedLiteralPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteEnumeratedLiteral defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteEnumeratedLiteralPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteEnumeratedLiteral type; + + eProsima_user_DllExport CompleteEnumeratedLiteralPubSubType(); + + eProsima_user_DllExport ~CompleteEnumeratedLiteralPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector CompleteEnumeratedLiteralSeq; + +/*! + * @brief This class represents the TopicDataType of the type MinimalEnumeratedLiteral defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalEnumeratedLiteralPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalEnumeratedLiteral type; + + eProsima_user_DllExport MinimalEnumeratedLiteralPubSubType(); + + eProsima_user_DllExport ~MinimalEnumeratedLiteralPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector MinimalEnumeratedLiteralSeq; + +#ifndef SWIG +namespace detail { + +template +struct CommonEnumeratedHeader_rob +{ + friend constexpr typename Tag::type get( + Tag) + { + return M; + } + +}; + +struct CommonEnumeratedHeader_f +{ + typedef eprosima::fastdds::dds::xtypes::BitBound CommonEnumeratedHeader::* type; + friend constexpr type get( + CommonEnumeratedHeader_f); +}; + +template struct CommonEnumeratedHeader_rob; + +template +inline size_t constexpr CommonEnumeratedHeader_offset_of() +{ + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); +} + +} // namespace detail +#endif // ifndef SWIG + + +/*! + * @brief This class represents the TopicDataType of the type CommonEnumeratedHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonEnumeratedHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CommonEnumeratedHeader type; + + eProsima_user_DllExport CommonEnumeratedHeaderPubSubType(); + + eProsima_user_DllExport ~CommonEnumeratedHeaderPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return 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 + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) CommonEnumeratedHeader(); + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return 2ULL == + (detail::CommonEnumeratedHeader_offset_of() + + sizeof(eprosima::fastdds::dds::xtypes::BitBound)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 2ULL == + (detail::CommonEnumeratedHeader_offset_of() + + sizeof(eprosima::fastdds::dds::xtypes::BitBound)); + } + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteEnumeratedHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteEnumeratedHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteEnumeratedHeader type; + + eProsima_user_DllExport CompleteEnumeratedHeaderPubSubType(); + + eProsima_user_DllExport ~CompleteEnumeratedHeaderPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalEnumeratedHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalEnumeratedHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalEnumeratedHeader type; + + eProsima_user_DllExport MinimalEnumeratedHeaderPubSubType(); + + eProsima_user_DllExport ~MinimalEnumeratedHeaderPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteEnumeratedType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteEnumeratedTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteEnumeratedType type; + + eProsima_user_DllExport CompleteEnumeratedTypePubSubType(); + + eProsima_user_DllExport ~CompleteEnumeratedTypePubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalEnumeratedType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalEnumeratedTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalEnumeratedType type; + + eProsima_user_DllExport MinimalEnumeratedTypePubSubType(); + + eProsima_user_DllExport ~MinimalEnumeratedTypePubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CommonBitflag defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonBitflagPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CommonBitflag type; + + eProsima_user_DllExport CommonBitflagPubSubType(); + + eProsima_user_DllExport ~CommonBitflagPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteBitflag defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteBitflagPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteBitflag type; + + eProsima_user_DllExport CompleteBitflagPubSubType(); + + eProsima_user_DllExport ~CompleteBitflagPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector CompleteBitflagSeq; + +/*! + * @brief This class represents the TopicDataType of the type MinimalBitflag defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalBitflagPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalBitflag type; + + eProsima_user_DllExport MinimalBitflagPubSubType(); + + eProsima_user_DllExport ~MinimalBitflagPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector MinimalBitflagSeq; + +#ifndef SWIG +namespace detail { + +template +struct CommonBitmaskHeader_rob +{ + friend constexpr typename Tag::type get( + Tag) + { + return M; + } + +}; + +struct CommonBitmaskHeader_f +{ + typedef eprosima::fastdds::dds::xtypes::BitBound CommonBitmaskHeader::* type; + friend constexpr type get( + CommonBitmaskHeader_f); +}; + +template struct CommonBitmaskHeader_rob; + +template +inline size_t constexpr CommonBitmaskHeader_offset_of() +{ + return ((::size_t) &reinterpret_cast((((T*)0)->*get(Tag())))); +} + +} // namespace detail +#endif // ifndef SWIG + + +/*! + * @brief This class represents the TopicDataType of the type CommonBitmaskHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonBitmaskHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CommonBitmaskHeader type; + + eProsima_user_DllExport CommonBitmaskHeaderPubSubType(); + + eProsima_user_DllExport ~CommonBitmaskHeaderPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return 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 + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + new (memory) CommonBitmaskHeader(); + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +private: + + static constexpr bool is_plain_xcdrv1_impl() + { + return 2ULL == + (detail::CommonBitmaskHeader_offset_of() + + sizeof(eprosima::fastdds::dds::xtypes::BitBound)); + } + + static constexpr bool is_plain_xcdrv2_impl() + { + return 2ULL == + (detail::CommonBitmaskHeader_offset_of() + + sizeof(eprosima::fastdds::dds::xtypes::BitBound)); + } + +}; +typedef eprosima::fastdds::dds::xtypes::CompleteEnumeratedHeader CompleteBitmaskHeader; +typedef eprosima::fastdds::dds::xtypes::MinimalEnumeratedHeader MinimalBitmaskHeader; + +/*! + * @brief This class represents the TopicDataType of the type CompleteBitmaskType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteBitmaskTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteBitmaskType type; + + eProsima_user_DllExport CompleteBitmaskTypePubSubType(); + + eProsima_user_DllExport ~CompleteBitmaskTypePubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalBitmaskType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalBitmaskTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalBitmaskType type; + + eProsima_user_DllExport MinimalBitmaskTypePubSubType(); + + eProsima_user_DllExport ~MinimalBitmaskTypePubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CommonBitfield defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CommonBitfieldPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CommonBitfield type; + + eProsima_user_DllExport CommonBitfieldPubSubType(); + + eProsima_user_DllExport ~CommonBitfieldPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteBitfield defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteBitfieldPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteBitfield type; + + eProsima_user_DllExport CompleteBitfieldPubSubType(); + + eProsima_user_DllExport ~CompleteBitfieldPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector CompleteBitfieldSeq; + +/*! + * @brief This class represents the TopicDataType of the type MinimalBitfield defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalBitfieldPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalBitfield type; + + eProsima_user_DllExport MinimalBitfieldPubSubType(); + + eProsima_user_DllExport ~MinimalBitfieldPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector MinimalBitfieldSeq; + +/*! + * @brief This class represents the TopicDataType of the type CompleteBitsetHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteBitsetHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteBitsetHeader type; + + eProsima_user_DllExport CompleteBitsetHeaderPubSubType(); + + eProsima_user_DllExport ~CompleteBitsetHeaderPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalBitsetHeader defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalBitsetHeaderPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalBitsetHeader type; + + eProsima_user_DllExport MinimalBitsetHeaderPubSubType(); + + eProsima_user_DllExport ~MinimalBitsetHeaderPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteBitsetType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteBitsetTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteBitsetType type; + + eProsima_user_DllExport CompleteBitsetTypePubSubType(); + + eProsima_user_DllExport ~CompleteBitsetTypePubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type MinimalBitsetType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalBitsetTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalBitsetType type; + + eProsima_user_DllExport MinimalBitsetTypePubSubType(); + + eProsima_user_DllExport ~MinimalBitsetTypePubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + +/*! + * @brief This class represents the TopicDataType of the type CompleteExtendedType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class CompleteExtendedTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef CompleteExtendedType type; + + eProsima_user_DllExport CompleteExtendedTypePubSubType(); + + eProsima_user_DllExport ~CompleteExtendedTypePubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + + +/*! + * @brief This class represents the TopicDataType of the type MinimalExtendedType defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class MinimalExtendedTypePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef MinimalExtendedType type; + + eProsima_user_DllExport MinimalExtendedTypePubSubType(); + + eProsima_user_DllExport ~MinimalExtendedTypePubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; + + +typedef std::vector TypeObjectSeq; +typedef eprosima::fastdds::dds::xtypes::TypeObjectSeq StronglyConnectedComponent; + +/*! + * @brief This class represents the TopicDataType of the type TypeIdentifierTypeObjectPair defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class TypeIdentifierTypeObjectPairPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef TypeIdentifierTypeObjectPair type; + + eProsima_user_DllExport TypeIdentifierTypeObjectPairPubSubType(); + + eProsima_user_DllExport ~TypeIdentifierTypeObjectPairPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector TypeIdentifierTypeObjectPairSeq; + +/*! + * @brief This class represents the TopicDataType of the type TypeIdentifierPair defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class TypeIdentifierPairPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef TypeIdentifierPair type; + + eProsima_user_DllExport TypeIdentifierPairPubSubType(); + + eProsima_user_DllExport ~TypeIdentifierPairPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector TypeIdentifierPairSeq; + +/*! + * @brief This class represents the TopicDataType of the type TypeIdentfierWithSize defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class TypeIdentfierWithSizePubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef TypeIdentfierWithSize type; + + eProsima_user_DllExport TypeIdentfierWithSizePubSubType(); + + eProsima_user_DllExport ~TypeIdentfierWithSizePubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector TypeIdentfierWithSizeSeq; + +/*! + * @brief This class represents the TopicDataType of the type TypeIdentifierWithDependencies defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class TypeIdentifierWithDependenciesPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef TypeIdentifierWithDependencies type; + + eProsima_user_DllExport TypeIdentifierWithDependenciesPubSubType(); + + eProsima_user_DllExport ~TypeIdentifierWithDependenciesPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector TypeIdentifierWithDependenciesSeq; + +/*! + * @brief This class represents the TopicDataType of the type TypeInformation defined by the user in the IDL file. + * @ingroup dds_xtypes_typeobject + */ +class TypeInformationPubSubType : public eprosima::fastdds::dds::TopicDataType +{ +public: + + typedef TypeInformation type; + + eProsima_user_DllExport TypeInformationPubSubType(); + + eProsima_user_DllExport ~TypeInformationPubSubType() override; + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload) override + { + return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport bool serialize( + void* data, + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool deserialize( + eprosima::fastrtps::rtps::SerializedPayload_t* payload, + void* data) override; + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data) override + { + return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); + } + + eProsima_user_DllExport std::function getSerializedSizeProvider( + void* data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + + eProsima_user_DllExport bool getKey( + void* data, + eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, + bool force_md5 = false) override; + + eProsima_user_DllExport void* createData() override; + + eProsima_user_DllExport void deleteData( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() const override; + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + +#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + eProsima_user_DllExport inline bool is_plain() const override + { + return false; + } + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + +#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + +#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + MD5 m_md5; + unsigned char* m_keyBuffer; + +}; +typedef std::vector TypeInformationSeq; + +} // namespace xtypes + + +} // namespace dds + +} // namespace fastdds + +} // namespace eprosima + + +#endif // _FAST_DDS_GENERATED_EPROSIMA_FASTDDS_DDS_XTYPES_DDS_XTYPES_TYPEOBJECT_PUBSUBTYPES_H_ + diff --git a/include/fastdds/rtps/attributes/RTPSParticipantAttributes.h b/include/fastdds/rtps/attributes/RTPSParticipantAttributes.h index 8adcfc7b7c7..bcc0124b9b5 100644 --- a/include/fastdds/rtps/attributes/RTPSParticipantAttributes.h +++ b/include/fastdds/rtps/attributes/RTPSParticipantAttributes.h @@ -330,21 +330,6 @@ class DiscoverySettings std::string static_edp_xml_config_ = ""; }; -/** - * TypeLookupService settings. - */ -class TypeLookupSettings -{ -public: - - //!Indicates to use the TypeLookup Service client endpoints - bool use_client = false; - - //!Indicates to use the TypeLookup Service server endpoints - bool use_server = false; - -}; - /** * Class BuiltinAttributes, to define the behavior of the RTPSParticipant builtin protocols. * @ingroup RTPS_ATTRIBUTES_MODULE @@ -359,9 +344,6 @@ class BuiltinAttributes //! Indicates to use the WriterLiveliness protocol. bool use_WriterLivelinessProtocol = true; - //! TypeLookup Service settings - TypeLookupSettings typelookup_config; - //! Network Configuration NetworkConfigSet_t network_configuration = 0; @@ -406,8 +388,6 @@ class BuiltinAttributes { return (this->discovery_config == b.discovery_config) && (this->use_WriterLivelinessProtocol == b.use_WriterLivelinessProtocol) && - (typelookup_config.use_client == b.typelookup_config.use_client) && - (typelookup_config.use_server == b.typelookup_config.use_server) && (this->network_configuration == b.network_configuration) && (this->metatrafficUnicastLocatorList == b.metatrafficUnicastLocatorList) && (this->metatrafficMulticastLocatorList == b.metatrafficMulticastLocatorList) && diff --git a/include/fastdds/rtps/attributes/TopicAttributes.h b/include/fastdds/rtps/attributes/TopicAttributes.h index 50777c4f8b1..7234ce4242c 100644 --- a/include/fastdds/rtps/attributes/TopicAttributes.h +++ b/include/fastdds/rtps/attributes/TopicAttributes.h @@ -43,7 +43,6 @@ class TopicAttributes : topicKind(rtps::NO_KEY) , topicName("UNDEF") , topicDataType("UNDEF") - , auto_fill_type_object(true) , auto_fill_type_information(true) { } @@ -57,7 +56,6 @@ class TopicAttributes topicKind = tKind; topicName = name; topicDataType = dataType; - auto_fill_type_object = true; auto_fill_type_information = true; } @@ -116,9 +114,7 @@ class TopicAttributes //!Type Object XTYPES 1.1 TypeObjectV1 type; //!XTYPES 1.2 - xtypes::TypeInformation type_information; - //!Tries to complete type identifier and type object (TypeObjectV1) - bool auto_fill_type_object; + xtypes::TypeInformationParameter type_information; //!Tries to complete type information (TypeObjectV2) bool auto_fill_type_information; diff --git a/include/fastdds/rtps/builtin/data/ReaderProxyData.h b/include/fastdds/rtps/builtin/data/ReaderProxyData.h index a18718fb650..774b78625e8 100644 --- a/include/fastdds/rtps/builtin/data/ReaderProxyData.h +++ b/include/fastdds/rtps/builtin/data/ReaderProxyData.h @@ -357,22 +357,22 @@ class ReaderProxyData } FASTDDS_EXPORTED_API void type_information( - const xtypes::TypeInformation& other_type_information) + const xtypes::TypeInformationParameter& other_type_information) { type_information() = other_type_information; } - FASTDDS_EXPORTED_API const xtypes::TypeInformation& type_information() const + FASTDDS_EXPORTED_API const xtypes::TypeInformationParameter& type_information() const { assert(m_type_information != nullptr); return *m_type_information; } - FASTDDS_EXPORTED_API xtypes::TypeInformation& type_information() + FASTDDS_EXPORTED_API xtypes::TypeInformationParameter& type_information() { if (m_type_information == nullptr) { - m_type_information = new xtypes::TypeInformation(); + m_type_information = new xtypes::TypeInformationParameter(); } return *m_type_information; } @@ -506,7 +506,7 @@ class ReaderProxyData //!Type Object TypeObjectV1* m_type; //!Type Information - xtypes::TypeInformation* m_type_information; + xtypes::TypeInformationParameter* m_type_information; //! ParameterPropertyList_t m_properties; //!Information on the content filter applied by the reader. diff --git a/include/fastdds/rtps/builtin/data/WriterProxyData.h b/include/fastdds/rtps/builtin/data/WriterProxyData.h index 03dce715b4a..f538232dbfd 100644 --- a/include/fastdds/rtps/builtin/data/WriterProxyData.h +++ b/include/fastdds/rtps/builtin/data/WriterProxyData.h @@ -362,22 +362,22 @@ class WriterProxyData } FASTDDS_EXPORTED_API void type_information( - const xtypes::TypeInformation& other_type_information) + const xtypes::TypeInformationParameter& other_type_information) { type_information() = other_type_information; } - FASTDDS_EXPORTED_API const xtypes::TypeInformation& type_information() const + FASTDDS_EXPORTED_API const xtypes::TypeInformationParameter& type_information() const { assert(m_type_information != nullptr); return *m_type_information; } - FASTDDS_EXPORTED_API xtypes::TypeInformation& type_information() + FASTDDS_EXPORTED_API xtypes::TypeInformationParameter& type_information() { if (m_type_information == nullptr) { - m_type_information = new xtypes::TypeInformation(); + m_type_information = new xtypes::TypeInformationParameter(); } return *m_type_information; } @@ -502,7 +502,7 @@ class WriterProxyData TypeObjectV1* m_type; //!Type Information - xtypes::TypeInformation* m_type_information; + xtypes::TypeInformationParameter* m_type_information; //! ParameterPropertyList_t m_properties; diff --git a/include/fastdds/rtps/participant/RTPSParticipant.h b/include/fastdds/rtps/participant/RTPSParticipant.h index 36ff10d496c..df880e79b89 100644 --- a/include/fastdds/rtps/participant/RTPSParticipant.h +++ b/include/fastdds/rtps/participant/RTPSParticipant.h @@ -33,13 +33,13 @@ namespace eprosima { -namespace fastdds { - #ifdef FASTDDS_STATISTICS +namespace fastdds { namespace statistics { class MonitorServiceStatusData; + namespace rtps { struct IStatusQueryable; @@ -47,18 +47,10 @@ struct IStatusObserver; } // namespace rtps } // namespace statistics +} // namespace fastdds #endif //FASTDDS_STATISTICS -namespace dds { -namespace builtin { - -class TypeLookupManager; - -} // namespace builtin -} // namespace dds -} // namespace fastdds - namespace fastrtps { class TopicAttributes; @@ -249,12 +241,6 @@ class FASTDDS_EXPORTED_API RTPSParticipant void set_check_type_function( std::function&& check_type); - /** - * @brief Retrieves the built-in typelookup service manager. - * @return - */ - fastdds::dds::builtin::TypeLookupManager* typelookup_manager() const; - /** * @brief Modifies the participant listener * @param listener diff --git a/include/fastdds/rtps/participant/RTPSParticipantListener.h b/include/fastdds/rtps/participant/RTPSParticipantListener.h index 9602d487124..0e7406261e3 100644 --- a/include/fastdds/rtps/participant/RTPSParticipantListener.h +++ b/include/fastdds/rtps/participant/RTPSParticipantListener.h @@ -24,10 +24,6 @@ #include #include -#include -#include -#include - namespace eprosima { namespace fastrtps { namespace rtps { @@ -159,63 +155,6 @@ class FASTDDS_EXPORTED_API RTPSParticipantListener static_cast(should_be_ignored); } - /*! - * This method is called when a participant discovers a new Type - * The ownership of all object belongs to the caller so if needs to be used after the - * method ends, a full copy should be perform (except for dyn_type due to its shared_ptr nature. - * The field "topic" it is only available if the type was discovered using "Discovery-Time Data Typing", - * in which case the field request_sample_id will contain INVALID_SAMPLE_IDENTITY. - * If the type was discovered using TypeLookup Service then "topic" will be empty, but will have - * the request_sample_id of the petition that caused the discovery. - * For example: - * fastrtps::types::TypeIdentifier new_type_id = *identifier; - */ - virtual void on_type_discovery( - RTPSParticipant* participant, - const SampleIdentity& request_sample_id, - const fastcdr::string_255& topic, - const types::TypeIdentifier* identifier, - const types::TypeObject* object, - types::DynamicType_ptr dyn_type) - { - static_cast(participant); - static_cast(request_sample_id); - static_cast(topic); - static_cast(identifier); - static_cast(object); - static_cast(dyn_type); - } - - /*! - * This method is called when the typelookup client received a reply to a getTypeDependencies request. - * The user may want to retrieve these new types using the getTypes request and create a new - * DynamicType using the retrieved TypeObject. - */ - virtual void on_type_dependencies_reply( - RTPSParticipant* participant, - const SampleIdentity& request_sample_id, - const types::TypeIdentifierWithSizeSeq& dependencies) - { - static_cast(participant); - static_cast(request_sample_id); - static_cast(dependencies); - } - - /*! - * This method is called when a participant receives a TypeInformation while discovering another participant. - */ - virtual void on_type_information_received( - RTPSParticipant* participant, - const fastcdr::string_255& topic_name, - const fastcdr::string_255& type_name, - const types::TypeInformation& type_information) - { - static_cast(participant); - static_cast(topic_name); - static_cast(type_name); - static_cast(type_information); - } - }; } // namespace rtps diff --git a/include/fastdds/statistics/dds/domain/DomainParticipant.hpp b/include/fastdds/statistics/dds/domain/DomainParticipant.hpp index 80ac46d1218..e5ab3a6f559 100644 --- a/include/fastdds/statistics/dds/domain/DomainParticipant.hpp +++ b/include/fastdds/statistics/dds/domain/DomainParticipant.hpp @@ -22,12 +22,10 @@ #include +#include #include #include #include -#include - -using eprosima::fastrtps::types::ReturnCode_t; namespace eprosima { namespace fastrtps { @@ -66,7 +64,7 @@ class DomainParticipant : public eprosima::fastdds::dds::DomainParticipant * RETCODE_OK if the DataWriter has been created or if it has been created previously, * and RETCODE_ERROR otherwise */ - FASTDDS_EXPORTED_API ReturnCode_t enable_statistics_datawriter( + FASTDDS_EXPORTED_API fastdds::dds::ReturnCode_t enable_statistics_datawriter( const std::string& topic_name, const eprosima::fastdds::dds::DataWriterQos& dwqos); @@ -81,7 +79,7 @@ class DomainParticipant : public eprosima::fastdds::dds::DomainParticipant * RETCODE_OK if the DataWriter has been created or if it has been created previously, * and RETCODE_ERROR otherwise */ - FASTDDS_EXPORTED_API ReturnCode_t enable_statistics_datawriter_with_profile( + FASTDDS_EXPORTED_API fastdds::dds::ReturnCode_t enable_statistics_datawriter_with_profile( const std::string& profile_name, const std::string& topic_name); @@ -93,7 +91,7 @@ class DomainParticipant : public eprosima::fastdds::dds::DomainParticipant * RETCODE_OK if the DataWriter has been correctly deleted or does not exist, * and RETCODE_ERROR otherwise */ - FASTDDS_EXPORTED_API ReturnCode_t disable_statistics_datawriter( + FASTDDS_EXPORTED_API fastdds::dds::ReturnCode_t disable_statistics_datawriter( const std::string& topic_name); /** @@ -123,7 +121,7 @@ class DomainParticipant : public eprosima::fastdds::dds::DomainParticipant * * @note Not supported yet. Currently returns RETCODE_UNSUPPORTED */ - FASTDDS_EXPORTED_API ReturnCode_t enable_monitor_service(); + FASTDDS_EXPORTED_API eprosima::fastdds::dds::ReturnCode_t enable_monitor_service(); /** * Disables the monitor service in this DomainParticipant. Does nothing if the service was not enabled before. @@ -135,7 +133,7 @@ class DomainParticipant : public eprosima::fastdds::dds::DomainParticipant * * @note Not supported yet. Currently returns RETCODE_UNSUPPORTED */ - FASTDDS_EXPORTED_API ReturnCode_t disable_monitor_service(); + FASTDDS_EXPORTED_API eprosima::fastdds::dds::ReturnCode_t disable_monitor_service(); /** * fills in the ParticipantProxyData from a MonitorService Message @@ -146,7 +144,7 @@ class DomainParticipant : public eprosima::fastdds::dds::DomainParticipant * @return RETCODE_OK if the operation succeeds. * @return RETCODE_ERROR if the operation fails. */ - FASTDDS_EXPORTED_API ReturnCode_t fill_discovery_data_from_cdr_message( + FASTDDS_EXPORTED_API eprosima::fastdds::dds::ReturnCode_t fill_discovery_data_from_cdr_message( fastrtps::rtps::ParticipantProxyData& data, statistics::MonitorServiceStatusData& msg); @@ -159,7 +157,7 @@ class DomainParticipant : public eprosima::fastdds::dds::DomainParticipant * @return RETCODE_OK if the operation succeeds. * @return RETCODE_ERROR if the operation fails. */ - FASTDDS_EXPORTED_API ReturnCode_t fill_discovery_data_from_cdr_message( + FASTDDS_EXPORTED_API eprosima::fastdds::dds::ReturnCode_t fill_discovery_data_from_cdr_message( fastrtps::rtps::WriterProxyData& data, statistics::MonitorServiceStatusData& msg); @@ -172,7 +170,7 @@ class DomainParticipant : public eprosima::fastdds::dds::DomainParticipant * @return RETCODE_OK if the operation succeeds. * @return RETCODE_ERROR if the operation fails. */ - FASTDDS_EXPORTED_API ReturnCode_t fill_discovery_data_from_cdr_message( + FASTDDS_EXPORTED_API eprosima::fastdds::dds::ReturnCode_t fill_discovery_data_from_cdr_message( fastrtps::rtps::ReaderProxyData& data, statistics::MonitorServiceStatusData& msg); @@ -185,7 +183,7 @@ class DomainParticipant : public eprosima::fastdds::dds::DomainParticipant * @return RETCODE_OK if the operation succeeds. * @return RETCODE_ERROR if the operation fails. */ - FASTDDS_EXPORTED_API ReturnCode_t fill_discovery_data_from_cdr_message( + FASTDDS_EXPORTED_API eprosima::fastdds::dds::ReturnCode_t fill_discovery_data_from_cdr_message( fastrtps::rtps::ParticipantProxyData& data, const statistics::MonitorServiceStatusData& msg); @@ -198,7 +196,7 @@ class DomainParticipant : public eprosima::fastdds::dds::DomainParticipant * @return RETCODE_OK if the operation succeeds. * @return RETCODE_ERROR if the operation fails. */ - FASTDDS_EXPORTED_API ReturnCode_t fill_discovery_data_from_cdr_message( + FASTDDS_EXPORTED_API eprosima::fastdds::dds::ReturnCode_t fill_discovery_data_from_cdr_message( fastrtps::rtps::WriterProxyData& data, const statistics::MonitorServiceStatusData& msg); @@ -211,7 +209,7 @@ class DomainParticipant : public eprosima::fastdds::dds::DomainParticipant * @return RETCODE_OK if the operation succeeds. * @return RETCODE_ERROR if the operation fails. */ - FASTDDS_EXPORTED_API ReturnCode_t fill_discovery_data_from_cdr_message( + FASTDDS_EXPORTED_API eprosima::fastdds::dds::ReturnCode_t fill_discovery_data_from_cdr_message( fastrtps::rtps::ReaderProxyData& data, const statistics::MonitorServiceStatusData& msg); diff --git a/include/fastdds/statistics/monitorservice_types.idl b/include/fastdds/statistics/monitorservice_types.idl index 0b7ec9e09cd..2bfe59fd2e2 100644 --- a/include/fastdds/statistics/monitorservice_types.idl +++ b/include/fastdds/statistics/monitorservice_types.idl @@ -74,45 +74,47 @@ module statistics { typedef BaseStatus_s InconsistentTopicStatus_s; typedef BaseStatus_s SampleLostStatus_s; - enum StatusKind + module StatusKind { - PROXY, - CONNECTION_LIST, - INCOMPATIBLE_QOS, - INCONSISTENT_TOPIC, - LIVELINESS_LOST, - LIVELINESS_CHANGED, - DEADLINE_MISSED, - SAMPLE_LOST, - STATUSES_SIZE - }; - - union MonitorServiceData switch(StatusKind) + typedef unsigned long StatusKind; + + const StatusKind PROXY = 0; + const StatusKind CONNECTION_LIST = 1; + const StatusKind INCOMPATIBLE_QOS = 2; + const StatusKind INCONSISTENT_TOPIC = 3; + const StatusKind LIVELINESS_LOST = 4; + const StatusKind LIVELINESS_CHANGED = 5; + const StatusKind DEADLINE_MISSED = 6; + const StatusKind SAMPLE_LOST = 7; + const StatusKind STATUSES_SIZE = 8; + }; // module StatusKind + + union MonitorServiceData switch(StatusKind::StatusKind) { - case PROXY: + case StatusKind::PROXY: sequence entity_proxy; - case CONNECTION_LIST: + case StatusKind::CONNECTION_LIST: sequence connection_list; - case INCOMPATIBLE_QOS: + case StatusKind::INCOMPATIBLE_QOS: IncompatibleQoSStatus_s incompatible_qos_status; - case INCONSISTENT_TOPIC: + case StatusKind::INCONSISTENT_TOPIC: InconsistentTopicStatus_s inconsistent_topic_status; - case LIVELINESS_LOST: + case StatusKind::LIVELINESS_LOST: LivelinessLostStatus_s liveliness_lost_status; - case LIVELINESS_CHANGED: + case StatusKind::LIVELINESS_CHANGED: LivelinessChangedStatus_s liveliness_changed_status; - case DEADLINE_MISSED: + case StatusKind::DEADLINE_MISSED: DeadlineMissedStatus_s deadline_missed_status; - case SAMPLE_LOST: + case StatusKind::SAMPLE_LOST: SampleLostStatus_s sample_lost_status; - case STATUSES_SIZE: + case StatusKind::STATUSES_SIZE: octet statuses_size; }; struct MonitorServiceStatusData { @Key detail::GUID_s local_entity; - @Key StatusKind status_kind; + @Key StatusKind::StatusKind status_kind; MonitorServiceData value; }; diff --git a/include/fastrtps/qos/QosPolicies.h b/include/fastrtps/qos/QosPolicies.h index 940371b8c89..5c1348e16b1 100644 --- a/include/fastrtps/qos/QosPolicies.h +++ b/include/fastrtps/qos/QosPolicies.h @@ -103,7 +103,7 @@ using TypeIdV1 = fastdds::dds::TypeIdV1; using TypeObjectV1 = fastdds::dds::TypeObjectV1; namespace xtypes { -using TypeInformation = fastdds::dds::xtypes::TypeInformation; +using TypeInformationParameter = fastdds::dds::xtypes::TypeInformationParameter; } //namespace xtypes } // namespace fastrtps diff --git a/include/fastrtps/types/AnnotationDescriptor.h b/include/fastrtps/types/AnnotationDescriptor.h deleted file mode 100644 index 2e67622774d..00000000000 --- a/include/fastrtps/types/AnnotationDescriptor.h +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2018 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. - -#ifndef TYPES_ANNOTATION_DESCRIPTOR_H -#define TYPES_ANNOTATION_DESCRIPTOR_H - -#include -#include - -namespace eprosima{ -namespace fastrtps{ -namespace types{ - -class MemberDescriptor; -class DynamicType; - -class AnnotationDescriptor -{ -protected: - friend class DynamicTypeBuilderFactory; - - DynamicType_ptr type_; - std::map value_; - -public: - AnnotationDescriptor(); - ~AnnotationDescriptor(); - AnnotationDescriptor(const AnnotationDescriptor* descriptor); - AnnotationDescriptor(DynamicType_ptr p_type); - - ReturnCode_t copy_from(const AnnotationDescriptor* other); - bool equals(const AnnotationDescriptor*) const; - bool is_consistent() const; - bool key_annotation() const; - - ReturnCode_t get_value( - std::string& value, - const std::string& key); - - ReturnCode_t get_value(std::string& value); // key = "value" - - ReturnCode_t get_all_value(std::map& value) const; - - ReturnCode_t set_value( - const std::string& key, - const std::string& value); - - void set_type(DynamicType_ptr pType); - - const DynamicType_ptr type() const - { - return type_; - } -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPES_ANNOTATION_DESCRIPTOR_H diff --git a/include/fastrtps/types/AnnotationParameterValue.h b/include/fastrtps/types/AnnotationParameterValue.h deleted file mode 100644 index ec09b7f6e52..00000000000 --- a/include/fastrtps/types/AnnotationParameterValue.h +++ /dev/null @@ -1,1303 +0,0 @@ -// 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 AnnotationParameterValue.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#ifndef _ANNOTATIONPARAMETERVALUE_H_ -#define _ANNOTATIONPARAMETERVALUE_H_ - -#if _MSC_VER - -#if defined(max) -#pragma push_macro("max") -#undef max -#define FASTDDS_RESTORE_MAX -#endif // defined(max) - -#if defined(min) -#pragma push_macro("min") -#undef min -#define FASTDDS_RESTORE_MIN -#endif // defined(min) - -#endif // if _MSC_VER - -#include -#include -#include - -#include -#include -#include -#include - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima -namespace eprosima { -namespace fastrtps { - -namespace types { - -/*! - * @brief This class represents the structure ExtendedAnnotationParameterValue defined by the user in the IDL file. - * @ingroup TYPES_MODULE - */ -class ExtendedAnnotationParameterValue -{ -public: - - /*! - * @brief Default constructor. - */ - FASTDDS_EXPORTED_API ExtendedAnnotationParameterValue(); - - /*! - * @brief Default destructor. - */ - FASTDDS_EXPORTED_API ~ExtendedAnnotationParameterValue(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ExtendedAnnotationParameterValue that will be copied. - */ - FASTDDS_EXPORTED_API ExtendedAnnotationParameterValue( - const ExtendedAnnotationParameterValue& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ExtendedAnnotationParameterValue that will be copied. - */ - FASTDDS_EXPORTED_API ExtendedAnnotationParameterValue( - ExtendedAnnotationParameterValue&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object ExtendedAnnotationParameterValue that will be copied. - */ - FASTDDS_EXPORTED_API ExtendedAnnotationParameterValue& operator =( - const ExtendedAnnotationParameterValue& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ExtendedAnnotationParameterValue that will be copied. - */ - FASTDDS_EXPORTED_API ExtendedAnnotationParameterValue& operator =( - ExtendedAnnotationParameterValue&& x); - - /*! - * @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. - */ - FASTDDS_EXPORTED_API static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - FASTDDS_EXPORTED_API static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_EXPORTED_API void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_EXPORTED_API bool operator ==( - const ExtendedAnnotationParameterValue&) const - { - return true; - } - -private: -}; -/*! - * @brief This class represents the union AnnotationParameterValue defined by the user in the IDL file. - * @ingroup TYPES_MODULE - */ -class AnnotationParameterValue -{ -public: - - /*! - * @brief Default constructor. - */ - FASTDDS_EXPORTED_API AnnotationParameterValue(); - - /*! - * @brief Default destructor. - */ - FASTDDS_EXPORTED_API ~AnnotationParameterValue(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object AnnotationParameterValue that will be copied. - */ - FASTDDS_EXPORTED_API AnnotationParameterValue( - const AnnotationParameterValue& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object AnnotationParameterValue that will be copied. - */ - FASTDDS_EXPORTED_API AnnotationParameterValue( - AnnotationParameterValue&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object AnnotationParameterValue that will be copied. - */ - FASTDDS_EXPORTED_API AnnotationParameterValue& operator =( - const AnnotationParameterValue& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object AnnotationParameterValue that will be copied. - */ - FASTDDS_EXPORTED_API AnnotationParameterValue& operator =( - AnnotationParameterValue&& x); - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - FASTDDS_EXPORTED_API void _d( - char __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - FASTDDS_EXPORTED_API char _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - FASTDDS_EXPORTED_API char& _d(); - - /*! - * @brief This function sets a value in member boolean_value - * @param _boolean_value New value for member boolean_value - */ - FASTDDS_EXPORTED_API void boolean_value( - bool _boolean_value); - - /*! - * @brief This function returns the value of member boolean_value - * @return Value of member boolean_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API bool boolean_value() const; - - /*! - * @brief This function returns a reference to member boolean_value - * @return Reference to member boolean_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API bool& boolean_value(); - /*! - * @brief This function sets a value in member byte_value - * @param _byte_value New value for member byte_value - */ - FASTDDS_EXPORTED_API void byte_value( - uint8_t _byte_value); - - /*! - * @brief This function returns the value of member byte_value - * @return Value of member byte_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API uint8_t byte_value() const; - - /*! - * @brief This function returns a reference to member byte_value - * @return Reference to member byte_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API uint8_t& byte_value(); - /*! - * @brief This function sets a value in member int16_value - * @param _int16_value New value for member int16_value - */ - FASTDDS_EXPORTED_API void int16_value( - int16_t _int16_value); - - /*! - * @brief This function returns the value of member int16_value - * @return Value of member int16_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API int16_t int16_value() const; - - /*! - * @brief This function returns a reference to member int16_value - * @return Reference to member int16_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API int16_t& int16_value(); - /*! - * @brief This function sets a value in member uint_16_value - * @param _uint_16_value New value for member uint_16_value - */ - FASTDDS_EXPORTED_API void uint_16_value( - uint16_t _uint_16_value); - - /*! - * @brief This function returns the value of member uint_16_value - * @return Value of member uint_16_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API uint16_t uint_16_value() const; - - /*! - * @brief This function returns a reference to member uint_16_value - * @return Reference to member uint_16_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API uint16_t& uint_16_value(); - /*! - * @brief This function sets a value in member int32_value - * @param _int32_value New value for member int32_value - */ - FASTDDS_EXPORTED_API void int32_value( - int32_t _int32_value); - - /*! - * @brief This function returns the value of member int32_value - * @return Value of member int32_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API int32_t int32_value() const; - - /*! - * @brief This function returns a reference to member int32_value - * @return Reference to member int32_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API int32_t& int32_value(); - /*! - * @brief This function sets a value in member uint32_value - * @param _uint32_value New value for member uint32_value - */ - FASTDDS_EXPORTED_API void uint32_value( - uint32_t _uint32_value); - - /*! - * @brief This function returns the value of member uint32_value - * @return Value of member uint32_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API uint32_t uint32_value() const; - - /*! - * @brief This function returns a reference to member uint32_value - * @return Reference to member uint32_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API uint32_t& uint32_value(); - /*! - * @brief This function sets a value in member int64_value - * @param _int64_value New value for member int64_value - */ - FASTDDS_EXPORTED_API void int64_value( - int64_t _int64_value); - - /*! - * @brief This function returns the value of member int64_value - * @return Value of member int64_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API int64_t int64_value() const; - - /*! - * @brief This function returns a reference to member int64_value - * @return Reference to member int64_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API int64_t& int64_value(); - - /*! - * @brief This function sets a value in member uint64_value - * @param _uint64_value New value for member uint64_value - */ - FASTDDS_EXPORTED_API void uint64_value( - uint64_t _uint64_value); - - /*! - * @brief This function returns the value of member uint64_value - * @return Value of member uint64_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API uint64_t uint64_value() const; - - /*! - * @brief This function returns a reference to member uint64_value - * @return Reference to member uint64_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API uint64_t& uint64_value(); - /*! - * @brief This function sets a value in member float32_value - * @param _float32_value New value for member float32_value - */ - FASTDDS_EXPORTED_API void float32_value( - float _float32_value); - - /*! - * @brief This function returns the value of member float32_value - * @return Value of member float32_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API float float32_value() const; - - /*! - * @brief This function returns a reference to member float32_value - * @return Reference to member float32_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API float& float32_value(); - /*! - * @brief This function sets a value in member float64_value - * @param _float64_value New value for member float64_value - */ - FASTDDS_EXPORTED_API void float64_value( - double _float64_value); - - /*! - * @brief This function returns the value of member float64_value - * @return Value of member float64_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API double float64_value() const; - - /*! - * @brief This function returns a reference to member float64_value - * @return Reference to member float64_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API double& float64_value(); - - /*! - * @brief This function sets a value in member float128_value - * @param _float128_value New value for member float128_value - */ - FASTDDS_EXPORTED_API void float128_value( - long double _float128_value); - - /*! - * @brief This function returns the value of member float128_value - * @return Value of member float128_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API long double float128_value() const; - - /*! - * @brief This function returns a reference to member float128_value - * @return Reference to member float128_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API long double& float128_value(); - /*! - * @brief This function sets a value in member char_value - * @param _char_value New value for member char_value - */ - FASTDDS_EXPORTED_API void char_value( - char _char_value); - - /*! - * @brief This function returns the value of member char_value - * @return Value of member char_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API char char_value() const; - - /*! - * @brief This function returns a reference to member char_value - * @return Reference to member char_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API char& char_value(); - /*! - * @brief This function sets a value in member wchar_value - * @param _wchar_value New value for member wchar_value - */ - FASTDDS_EXPORTED_API void wchar_value( - wchar_t _wchar_value); - - /*! - * @brief This function returns the value of member wchar_value - * @return Value of member wchar_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API wchar_t wchar_value() const; - - /*! - * @brief This function returns a reference to member wchar_value - * @return Reference to member wchar_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API wchar_t& wchar_value(); - /*! - * @brief This function sets a value in member enumerated_value - * @param _enumerated_value New value for member enumerated_value - */ - FASTDDS_EXPORTED_API void enumerated_value( - int32_t _enumerated_value); - - /*! - * @brief This function returns the value of member enumerated_value - * @return Value of member enumerated_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API int32_t enumerated_value() const; - - /*! - * @brief This function returns a reference to member enumerated_value - * @return Reference to member enumerated_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API int32_t& enumerated_value(); - /*! - * @brief This function copies the value in member string8_value - * @param _string8_value New value to be copied in member string8_value - */ - FASTDDS_EXPORTED_API void string8_value( - const std::string& _string8_value); - - /*! - * @brief This function moves the value in member string8_value - * @param _string8_value New value to be moved in member string8_value - */ - FASTDDS_EXPORTED_API void string8_value( - std::string&& _string8_value); - - /*! - * @brief This function returns a constant reference to member string8_value - * @return Constant reference to member string8_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API const std::string& string8_value() const; - - /*! - * @brief This function returns a reference to member string8_value - * @return Reference to member string8_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API std::string& string8_value(); - /*! - * @brief This function copies the value in member string16_value - * @param _string16_value New value to be copied in member string16_value - */ - FASTDDS_EXPORTED_API void string16_value( - const std::wstring& _string16_value); - - /*! - * @brief This function moves the value in member string16_value - * @param _string16_value New value to be moved in member string16_value - */ - FASTDDS_EXPORTED_API void string16_value( - std::wstring&& _string16_value); - - /*! - * @brief This function returns a constant reference to member string16_value - * @return Constant reference to member string16_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API const std::wstring& string16_value() const; - - /*! - * @brief This function returns a reference to member string16_value - * @return Reference to member string16_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API std::wstring& string16_value(); - - /*! - * @brief This function copies the value in member extended_value - * @param _extended_value New value to be copied in member extended_value - */ - FASTDDS_EXPORTED_API void extended_value( - const ExtendedAnnotationParameterValue& _extended_value); - - /*! - * @brief This function moves the value in member extended_value - * @param _extended_value New value to be moved in member extended_value - */ - FASTDDS_EXPORTED_API void extended_value( - ExtendedAnnotationParameterValue&& _extended_value); - - /*! - * @brief This function returns a constant reference to member extended_value - * @return Constant reference to member extended_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API const ExtendedAnnotationParameterValue& extended_value() const; - - /*! - * @brief This function returns a reference to member extended_value - * @return Reference to member extended_value - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API ExtendedAnnotationParameterValue& extended_value(); - - /*! - * @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. - */ - FASTDDS_EXPORTED_API static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - FASTDDS_EXPORTED_API static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_EXPORTED_API void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_EXPORTED_API bool operator ==( - const AnnotationParameterValue& other) const; - - /** - * Aux method to return value as its string representation. - */ - FASTDDS_EXPORTED_API std::string to_string() const - { - switch (m__d) - { - case TK_BOOLEAN: - return (m_boolean_value) ? "true" : "false"; - case TK_BYTE: - return std::to_string(m_byte_value); - case TK_INT16: - return std::to_string(m_int16_value); - case TK_UINT16: - return std::to_string(m_uint_16_value); - case TK_INT32: - return std::to_string(m_int32_value); - case TK_UINT32: - return std::to_string(m_uint32_value); - case TK_INT64: - return std::to_string(m_int64_value); - case TK_UINT64: - return std::to_string(m_uint64_value); - case TK_FLOAT32: - return std::to_string(m_float32_value); - case TK_FLOAT64: - return std::to_string(m_float64_value); - case TK_FLOAT128: - return std::to_string(m_float128_value); - case TK_CHAR8: - return std::to_string(m_char_value); - case TK_CHAR16: - return std::to_string(m_wchar_value); - case TK_ENUM: - return std::to_string(m_enumerated_value); - case TK_STRING16: - { - return wstring_to_bytes(m_string16_value); - } - case TK_STRING8: - case TK_NONE: // Cheat! - return m_string8_value; - default: - return ""; - } - } - - /** - * Aux method to set value from its string representation. - */ - FASTDDS_EXPORTED_API void from_string( - const std::string& value) - { - switch (m__d) - { - case TK_BOOLEAN: - { - std::string val_ = value; - std::transform(val_.begin(), val_.end(), val_.begin(), - [](unsigned char c) - { - return static_cast(std::tolower(c)); - }); - boolean_value(val_.compare("0") != 0 || val_.compare(CONST_TRUE) == 0); - } - break; - case TK_BYTE: - { - byte_value(static_cast(std::stoul(value))); - } - break; - case TK_INT16: - { - int16_value(static_cast(std::stoi(value))); - } - break; - case TK_INT32: - { - int32_value(static_cast(std::stoi(value))); - } - break; - case TK_INT64: - { - int64_value(static_cast(std::stoll(value))); - } - break; - case TK_UINT16: - { - uint_16_value(static_cast(std::stoul(value))); - } - break; - case TK_UINT32: - { - uint32_value(static_cast(std::stoul(value))); - } - break; - case TK_UINT64: - { - uint64_value(static_cast(std::stoull(value))); - } - break; - case TK_FLOAT32: - { - float32_value(std::stof(value)); - } - break; - case TK_FLOAT64: - { - float64_value(std::stod(value)); - } - break; - case TK_FLOAT128: - { - float128_value(std::stold(value)); - } - break; - case TK_CHAR8: - { - char_value(value.c_str()[0]); - } - break; - case TK_CHAR16: - { - wchar_value(wstring_from_bytes(value).c_str()[0]); - } - break; - case TK_STRING8: - case TK_NONE: // Cheat! - { - string8_value(value); - } - break; - case TK_STRING16: - { - string16_value(wstring_from_bytes(value)); - } - break; - case TK_ENUM: - { - // TODO Translate from enum value name to integer value - enumerated_value(static_cast(std::stoul(value))); - } - break; - default: - break; - } - } - -private: - - char m__d; - - bool m_boolean_value; - uint8_t m_byte_value; - int16_t m_int16_value; - uint16_t m_uint_16_value; - int32_t m_int32_value; - uint32_t m_uint32_value; - int64_t m_int64_value; - uint64_t m_uint64_value; - float m_float32_value; - double m_float64_value; - long double m_float128_value; - char m_char_value; - wchar_t m_wchar_value; - int32_t m_enumerated_value; - std::string m_string8_value; - std::wstring m_string16_value; - ExtendedAnnotationParameterValue m_extended_value; -}; - -/*! - * @brief This class represents the structure AppliedAnnotationParameter defined by the user in the IDL file. - * @ingroup TYPES_MODULE - */ -class AppliedAnnotationParameter -{ -public: - - /*! - * @brief Default constructor. - */ - FASTDDS_EXPORTED_API AppliedAnnotationParameter(); - - /*! - * @brief Default destructor. - */ - FASTDDS_EXPORTED_API ~AppliedAnnotationParameter(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object AppliedAnnotationParameter that will be copied. - */ - FASTDDS_EXPORTED_API AppliedAnnotationParameter( - const AppliedAnnotationParameter& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object AppliedAnnotationParameter that will be copied. - */ - FASTDDS_EXPORTED_API AppliedAnnotationParameter( - AppliedAnnotationParameter&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object AppliedAnnotationParameter that will be copied. - */ - FASTDDS_EXPORTED_API AppliedAnnotationParameter& operator =( - const AppliedAnnotationParameter& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object AppliedAnnotationParameter that will be copied. - */ - FASTDDS_EXPORTED_API AppliedAnnotationParameter& operator =( - AppliedAnnotationParameter&& x); - - /*! - * @brief This function copies the value in member paramname_hash - * @param _paramname_hash New value to be copied in member paramname_hash - */ - inline void paramname_hash( - const NameHash& _paramname_hash) - { - m_paramname_hash = _paramname_hash; - } - - /*! - * @brief This function moves the value in member paramname_hash - * @param _paramname_hash New value to be moved in member paramname_hash - */ - inline void paramname_hash( - NameHash&& _paramname_hash) - { - m_paramname_hash = std::move(_paramname_hash); - } - - /*! - * @brief This function returns a constant reference to member paramname_hash - * @return Constant reference to member paramname_hash - */ - inline const NameHash& paramname_hash() const - { - return m_paramname_hash; - } - - /*! - * @brief This function returns a reference to member paramname_hash - * @return Reference to member paramname_hash - */ - inline NameHash& paramname_hash() - { - return m_paramname_hash; - } - - /*! - * @brief This function copies the value in member value - * @param _value New value to be copied in member value - */ - inline void value( - const AnnotationParameterValue& _value) - { - m_value = _value; - } - - /*! - * @brief This function moves the value in member value - * @param _value New value to be moved in member value - */ - inline void value( - AnnotationParameterValue&& _value) - { - m_value = std::move(_value); - } - - /*! - * @brief This function returns a constant reference to member value - * @return Constant reference to member value - */ - inline const AnnotationParameterValue& value() const - { - return m_value; - } - - /*! - * @brief This function returns a reference to member value - * @return Reference to member value - */ - inline AnnotationParameterValue& value() - { - return m_value; - } - - /*! - * @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. - */ - FASTDDS_EXPORTED_API static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - FASTDDS_EXPORTED_API static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - FASTDDS_EXPORTED_API void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_EXPORTED_API bool operator ==( - const AppliedAnnotationParameter& other) const; - -private: - - NameHash m_paramname_hash; - AnnotationParameterValue m_value; -}; - - -// The application of an annotation to some type or type member -/*struct AppliedAnnotationParameter { - NameHash paramname_hash; - AnnotationParameterValue value; - };*/ -/* - class AppliedAnnotationParameter - { - public: - AppliedAnnotationParameter(); - ~AppliedAnnotationParameter(); - AppliedAnnotationParameter(const AppliedAnnotationParameter &x); - AppliedAnnotationParameter(AppliedAnnotationParameter &&x); - AppliedAnnotationParameter& operator=(const AppliedAnnotationParameter &x); - AppliedAnnotationParameter& operator=(AppliedAnnotationParameter &&x); - - inline void paramname_hash(const NameHash &_paramname_hash) { m_paramname_hash = _paramname_hash; } - inline void paramname_hash(NameHash &&_paramname_hash) { m_paramname_hash = std::move(_paramname_hash); } - inline const NameHash& paramname_hash() const { return m_paramname_hash; } - inline NameHash& paramname_hash() { return m_paramname_hash; } - - inline void value(const AnnotationParameterValue &_value) { m_value = _value; } - inline void value(AnnotationParameterValue &&_value) { m_value = std::move(_value); } - inline const AnnotationParameterValue& value() const { return m_value; } - inline AnnotationParameterValue& value() { return m_value; } - - static size_t getCdrSerializedSize(const AppliedAnnotationParameter& data, size_t current_alignment = 0); - void serialize(eprosima::fastcdr::Cdr &cdr) const; - void deserialize(eprosima::fastcdr::Cdr &cdr); - static size_t getKeyMaxCdrSerializedSize(size_t current_alignment = 0); - static bool isKeyDefined(); - void serializeKey(eprosima::fastcdr::Cdr &cdr) const; - - private: - NameHash m_paramname_hash; - AnnotationParameterValue m_value; - }; - */ -// Sorted by AppliedAnnotationParameter.paramname_hash -typedef std::vector AppliedAnnotationParameterSeq; - -/*struct AppliedAnnotation { - TypeIdentifier annotation_typeid; - AppliedAnnotationParameterSeq param_seq; // @Optional - };*/ -class AppliedAnnotation -{ -public: - - FASTDDS_EXPORTED_API AppliedAnnotation(); - - FASTDDS_EXPORTED_API ~AppliedAnnotation(); - - FASTDDS_EXPORTED_API AppliedAnnotation( - const AppliedAnnotation& x); - - FASTDDS_EXPORTED_API AppliedAnnotation( - AppliedAnnotation&& x); - FASTDDS_EXPORTED_API AppliedAnnotation& operator =( - const AppliedAnnotation& x); - FASTDDS_EXPORTED_API AppliedAnnotation& operator =( - AppliedAnnotation&& x); - - inline void annotation_typeid( - const TypeIdentifier& _annotation_typeid) - { - m_annotation_typeid = _annotation_typeid; - } - - inline void annotation_typeid( - TypeIdentifier&& _annotation_typeid) - { - m_annotation_typeid = std::move(_annotation_typeid); - } - - inline const TypeIdentifier& annotation_typeid() const - { - return m_annotation_typeid; - } - - inline TypeIdentifier& annotation_typeid() - { - return m_annotation_typeid; - } - - inline void param_seq( - const AppliedAnnotationParameterSeq& _param_seq) - { - m_param_seq = _param_seq; - } - - inline void param_seq( - AppliedAnnotationParameterSeq&& _param_seq) - { - m_param_seq = std::move(_param_seq); - } - - inline const AppliedAnnotationParameterSeq& param_seq() const - { - return m_param_seq; - } - - inline AppliedAnnotationParameterSeq& param_seq() - { - return m_param_seq; - } - - FASTDDS_EXPORTED_API static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - FASTDDS_EXPORTED_API static bool isKeyDefined(); - FASTDDS_EXPORTED_API void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_EXPORTED_API bool operator ==( - const AppliedAnnotation& other) const; - -private: - - TypeIdentifier m_annotation_typeid; - AppliedAnnotationParameterSeq m_param_seq; -}; - -// Sorted by AppliedAnnotation.annotation_typeid -typedef std::vector AppliedAnnotationSeq; - -// @verbatim(placement="", language="", text="") -/*struct AppliedVerbatimAnnotation { - std::string placement; // 32 - std::string language; // 32 - std::string text; - };*/ -class AppliedVerbatimAnnotation -{ -public: - - FASTDDS_EXPORTED_API AppliedVerbatimAnnotation(); - - FASTDDS_EXPORTED_API ~AppliedVerbatimAnnotation(); - - FASTDDS_EXPORTED_API AppliedVerbatimAnnotation( - const AppliedVerbatimAnnotation& x); - - FASTDDS_EXPORTED_API AppliedVerbatimAnnotation( - AppliedVerbatimAnnotation&& x); - - FASTDDS_EXPORTED_API AppliedVerbatimAnnotation& operator =( - const AppliedVerbatimAnnotation& x); - - FASTDDS_EXPORTED_API AppliedVerbatimAnnotation& operator =( - AppliedVerbatimAnnotation&& x); - - inline void placement( - const std::string& _placement) - { - m_placement = _placement; - } - - inline void placement( - std::string&& _placement) - { - m_placement = std::move(_placement); - } - - inline const std::string& placement() const - { - return m_placement; - } - - inline std::string& placement() - { - return m_placement; - } - - inline void language( - const std::string& _language) - { - m_language = _language; - } - - inline void language( - std::string&& _language) - { - m_language = std::move(_language); - } - - inline const std::string& language() const - { - return m_language; - } - - inline std::string& language() - { - return m_language; - } - - inline void text( - const std::string& _text) - { - m_text = _text; - } - - inline void text( - std::string&& _text) - { - m_text = std::move(_text); - } - - inline const std::string& text() const - { - return m_text; - } - - inline std::string& text() - { - return m_text; - } - - FASTDDS_EXPORTED_API static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - FASTDDS_EXPORTED_API static bool isKeyDefined(); - - FASTDDS_EXPORTED_API void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_EXPORTED_API bool operator ==( - const AppliedVerbatimAnnotation& other) const; - -private: - - std::string m_placement; - std::string m_language; - std::string m_text; -}; - -// --- Aggregate types: ----------------------------------------------- -/*struct AppliedBuiltinMemberAnnotations { - std::string unit; // @unit("") // @Optional - AnnotationParameterValue min; // @min , @range // @Optional - AnnotationParameterValue max; // @max , @range // @Optional - std::string hash_id; // @hash_id("") // @Optional - }; - */ -class AppliedBuiltinMemberAnnotations -{ -public: - - FASTDDS_EXPORTED_API AppliedBuiltinMemberAnnotations(); - - FASTDDS_EXPORTED_API ~AppliedBuiltinMemberAnnotations(); - - FASTDDS_EXPORTED_API AppliedBuiltinMemberAnnotations( - const AppliedBuiltinMemberAnnotations& x); - - FASTDDS_EXPORTED_API AppliedBuiltinMemberAnnotations( - AppliedBuiltinMemberAnnotations&& x); - - FASTDDS_EXPORTED_API AppliedBuiltinMemberAnnotations& operator =( - const AppliedBuiltinMemberAnnotations& x); - - FASTDDS_EXPORTED_API AppliedBuiltinMemberAnnotations& operator =( - AppliedBuiltinMemberAnnotations&& x); - - inline void unit( - const std::string& _unit) - { - m_unit = _unit; - } - - inline void unit( - std::string&& _unit) - { - m_unit = std::move(_unit); - } - - inline const std::string& unit() const - { - return m_unit; - } - - inline std::string& unit() - { - return m_unit; - } - - inline void min( - const AnnotationParameterValue& _min) - { - m_min = _min; - } - - inline void min( - AnnotationParameterValue&& _min) - { - m_min = std::move(_min); - } - - inline const AnnotationParameterValue& min() const - { - return m_min; - } - - inline AnnotationParameterValue& min() - { - return m_min; - } - - inline void max( - const AnnotationParameterValue& _max) - { - m_max = _max; - } - - inline void max( - AnnotationParameterValue&& _max) - { - m_max = std::move(_max); - } - - inline const AnnotationParameterValue& max() const - { - return m_max; - } - - inline AnnotationParameterValue& max() - { - return m_max; - } - - inline void hash_id( - const std::string& _hash_id) - { - m_hash_id = _hash_id; - } - - inline void hash_id( - std::string&& _hash_id) - { - m_hash_id = std::move(_hash_id); - } - - inline const std::string& hash_id() const - { - return m_hash_id; - } - - inline std::string& hash_id() - { - return m_hash_id; - } - - FASTDDS_EXPORTED_API static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - FASTDDS_EXPORTED_API static bool isKeyDefined(); - - FASTDDS_EXPORTED_API void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - FASTDDS_EXPORTED_API bool operator ==( - const AppliedBuiltinMemberAnnotations& other) const; - -private: - - std::string m_unit; - AnnotationParameterValue m_min; - AnnotationParameterValue m_max; - std::string m_hash_id; -}; - - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#if _MSC_VER - -#if defined(FASTDDS_RESTORE_MIN) -#pragma pop_macro("min") -#undef FASTDDS_RESTORE_MIN -#endif // defined(FASTDDS_RESTORE_MIN) - -#if defined(FASTDDS_RESTORE_MAX) -#pragma pop_macro("max") -#undef FASTDDS_RESTORE_MAX -#endif // defined(FASTDDS_RESTORE_MAX) - -#endif // if _MSC_VER - -#endif // _ANNOTATIONPARAMETERVALUE_H_ diff --git a/include/fastrtps/types/BuiltinAnnotationsTypeObject.h b/include/fastrtps/types/BuiltinAnnotationsTypeObject.h deleted file mode 100644 index 69364ca5181..00000000000 --- a/include/fastrtps/types/BuiltinAnnotationsTypeObject.h +++ /dev/null @@ -1,183 +0,0 @@ -// 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 BuiltinAnnotationsTypeObject.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#ifndef _BUILTIN_ANNOTATIONS_TYPE_OBJECT_H_ -#define _BUILTIN_ANNOTATIONS_TYPE_OBJECT_H_ - - -#include -#include -#include - -using namespace eprosima::fastrtps::types; - -void register_builtin_annotations_types(TypeObjectFactory* factory); - -const TypeIdentifier* GetidIdentifier(bool complete = false); -const TypeObject* GetidObject(bool complete = false); -const TypeObject* GetMinimalidObject(); -const TypeObject* GetCompleteidObject(); - -const TypeIdentifier* GetautoidIdentifier(bool complete = false); -const TypeObject* GetautoidObject(bool complete = false); -const TypeObject* GetMinimalautoidObject(); -const TypeObject* GetCompleteautoidObject(); - -namespace autoid -{ - const TypeIdentifier* GetAutoidKindIdentifier(bool complete = false); - const TypeObject* GetAutoidKindObject(bool complete = false); - const TypeObject* GetMinimalAutoidKindObject(); - const TypeObject* GetCompleteAutoidKindObject(); -} - -const TypeIdentifier* GetoptionalIdentifier(bool complete = false); -const TypeObject* GetoptionalObject(bool complete = false); -const TypeObject* GetMinimaloptionalObject(); -const TypeObject* GetCompleteoptionalObject(); - -const TypeIdentifier* GetpositionIdentifier(bool complete = false); -const TypeObject* GetpositionObject(bool complete = false); -const TypeObject* GetMinimalpositionObject(); -const TypeObject* GetCompletepositionObject(); - -const TypeIdentifier* GetvalueIdentifier(bool complete = false); -const TypeObject* GetvalueObject(bool complete = false); -const TypeObject* GetMinimalvalueObject(); -const TypeObject* GetCompletevalueObject(); - -const TypeIdentifier* GetextensibilityIdentifier(bool complete = false); -const TypeObject* GetextensibilityObject(bool complete = false); -const TypeObject* GetMinimalextensibilityObject(); -const TypeObject* GetCompleteextensibilityObject(); - -namespace extensibility -{ - const TypeIdentifier* GetExtensibilityKindIdentifier(bool complete = false); - const TypeObject* GetExtensibilityKindObject(bool complete = false); - const TypeObject* GetMinimalExtensibilityKindObject(); - const TypeObject* GetCompleteExtensibilityKindObject(); -} - -const TypeIdentifier* GetfinalIdentifier(bool complete = false); -const TypeObject* GetfinalObject(bool complete = false); -const TypeObject* GetMinimalfinalObject(); -const TypeObject* GetCompletefinalObject(); - -const TypeIdentifier* GetappendableIdentifier(bool complete = false); -const TypeObject* GetappendableObject(bool complete = false); -const TypeObject* GetMinimalappendableObject(); -const TypeObject* GetCompleteappendableObject(); - -const TypeIdentifier* GetmutableIdentifier(bool complete = false); -const TypeObject* GetmutableObject(bool complete = false); -const TypeObject* GetMinimalmutableObject(); -const TypeObject* GetCompletemutableObject(); - -const TypeIdentifier* GetkeyIdentifier(bool complete = false); -const TypeObject* GetkeyObject(bool complete = false); -const TypeObject* GetMinimalkeyObject(); -const TypeObject* GetCompletekeyObject(); - -const TypeIdentifier* Getmust_understandIdentifier(bool complete = false); -const TypeObject* Getmust_understandObject(bool complete = false); -const TypeObject* GetMinimalmust_understandObject(); -const TypeObject* GetCompletemust_understandObject(); - -const TypeIdentifier* Getdefault_literalIdentifier(bool complete = false); -const TypeObject* Getdefault_literalObject(bool complete = false); -const TypeObject* GetMinimaldefault_literalObject(); -const TypeObject* GetCompletedefault_literalObject(); - -const TypeIdentifier* GetdefaultIdentifier(bool complete = false); -const TypeObject* GetdefaultObject(bool complete = false); -const TypeObject* GetMinimaldefaultObject(); -const TypeObject* GetCompletedefaultObject(); - -const TypeIdentifier* GetrangeIdentifier(bool complete = false); -const TypeObject* GetrangeObject(bool complete = false); -const TypeObject* GetMinimalrangeObject(); -const TypeObject* GetCompleterangeObject(); - -const TypeIdentifier* GetminIdentifier(bool complete = false); -const TypeObject* GetminObject(bool complete = false); -const TypeObject* GetMinimalminObject(); -const TypeObject* GetCompleteminObject(); - -const TypeIdentifier* GetmaxIdentifier(bool complete = false); -const TypeObject* GetmaxObject(bool complete = false); -const TypeObject* GetMinimalmaxObject(); -const TypeObject* GetCompletemaxObject(); - -const TypeIdentifier* GetunitIdentifier(bool complete = false); -const TypeObject* GetunitObject(bool complete = false); -const TypeObject* GetMinimalunitObject(); -const TypeObject* GetCompleteunitObject(); - -const TypeIdentifier* Getbit_boundIdentifier(bool complete = false); -const TypeObject* Getbit_boundObject(bool complete = false); -const TypeObject* GetMinimalbit_boundObject(); -const TypeObject* GetCompletebit_boundObject(); - -const TypeIdentifier* GetexternalIdentifier(bool complete = false); -const TypeObject* GetexternalObject(bool complete = false); -const TypeObject* GetMinimalexternalObject(); -const TypeObject* GetCompleteexternalObject(); - -const TypeIdentifier* GetnestedIdentifier(bool complete = false); -const TypeObject* GetnestedObject(bool complete = false); -const TypeObject* GetMinimalnestedObject(); -const TypeObject* GetCompletenestedObject(); - -const TypeIdentifier* GetverbatimIdentifier(bool complete = false); -const TypeObject* GetverbatimObject(bool complete = false); -const TypeObject* GetMinimalverbatimObject(); -const TypeObject* GetCompleteverbatimObject(); - -namespace verbatim -{ - const TypeIdentifier* GetPlacementKindIdentifier(bool complete = false); - const TypeObject* GetPlacementKindObject(bool complete = false); - const TypeObject* GetMinimalPlacementKindObject(); - const TypeObject* GetCompletePlacementKindObject(); -} - -const TypeIdentifier* GetserviceIdentifier(bool complete = false); -const TypeObject* GetserviceObject(bool complete = false); -const TypeObject* GetMinimalserviceObject(); -const TypeObject* GetCompleteserviceObject(); - -const TypeIdentifier* GetonewayIdentifier(bool complete = false); -const TypeObject* GetonewayObject(bool complete = false); -const TypeObject* GetMinimalonewayObject(); -const TypeObject* GetCompleteonewayObject(); - -const TypeIdentifier* GetamiIdentifier(bool complete = false); -const TypeObject* GetamiObject(bool complete = false); -const TypeObject* GetMinimalamiObject(); -const TypeObject* GetCompleteamiObject(); - -const TypeIdentifier* Getnon_serializedIdentifier(bool complete = false); -const TypeObject* Getnon_serializedObject(bool complete = false); -const TypeObject* GetMinimalnon_serializedObject(); -const TypeObject* GetCompletenon_serializedObject(); - -#endif // _BUILTIN_ANNOTATIONS_TYPE_OBJECT_H_ \ No newline at end of file diff --git a/include/fastrtps/types/DynamicData.h b/include/fastrtps/types/DynamicData.h deleted file mode 100644 index 855fc3d1b4e..00000000000 --- a/include/fastrtps/types/DynamicData.h +++ /dev/null @@ -1,788 +0,0 @@ -// Copyright 2018 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. - -#ifndef TYPES_DYNAMIC_DATA_H -#define TYPES_DYNAMIC_DATA_H - -#include -#include -#include - -//#define DYNAMIC_TYPES_CHECKING - -namespace eprosima { -namespace fastdds { -namespace dds { -namespace DDSSQLFilter { - -class DDSFilterExpression; - -} // namespace DDSSQLFilter -} // namespace dds -} // namespace fastdds -} // namespace eprosima - -namespace eprosima { -namespace fastrtps { -namespace types { - -class DynamicType; -class MemberDescriptor; - -class DynamicData -{ -protected: - - DynamicData(); - DynamicData( - const DynamicData* pData); - DynamicData( - DynamicType_ptr pType); - - ~DynamicData(); - - void add_value( - TypeKind kind, - MemberId id); - - void create_members( - DynamicType_ptr pType); - - void create_members( - const DynamicData* pData); - - void clean(); - - void clean_members(); - - void* clone_value( - MemberId id, - TypeKind kind) const; - - bool compare_values( - TypeKind kind, - void* left, - void* right) const; - - ReturnCode_t insert_array_data( - MemberId indexId); - - void serialize_empty_data( - const DynamicType_ptr pType, - eprosima::fastcdr::Cdr& cdr) const; - - void set_default_value( - MemberId id); - - void get_value( - std::string& sOutValue, - MemberId id = MEMBER_ID_INVALID) const; - - void set_value( - const std::string& sValue, - MemberId id = MEMBER_ID_INVALID); - - void set_type_name( - const std::string& name); - - MemberId get_union_id() const; - - ReturnCode_t set_union_id( - MemberId id); - - void update_union_discriminator(); - - void sort_member_ids( - MemberId startId); - - void set_union_discriminator( - DynamicData* pData); - - // Serializes and deserializes the Dynamic Data. - bool deserialize( - eprosima::fastcdr::Cdr& cdr); - - bool deserialize_discriminator( - eprosima::fastcdr::Cdr& cdr); - - static size_t getCdrSerializedSize( - const DynamicData* data, - size_t current_alignment = 0); - - static size_t getEmptyCdrSerializedSize( - const DynamicType* type, - size_t current_alignment = 0); - - static size_t getKeyMaxCdrSerializedSize( - const DynamicType_ptr type, - size_t current_alignment = 0); - - static size_t getMaxCdrSerializedSize( - const DynamicType_ptr type, - size_t current_alignment = 0); - - void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - void serialize_discriminator( - eprosima::fastcdr::Cdr& cdr) const; - - void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - DynamicType_ptr type_; - std::map descriptors_; - -#ifdef DYNAMIC_TYPES_CHECKING - int32_t int32_value_; - uint32_t uint32_value_; - int16_t int16_value_; - uint16_t uint16_value_; - int64_t int64_value_; - uint64_t uint64_value_; - float float32_value_; - double float64_value_; - long double float128_value_; - char char8_value_; - wchar_t char16_value_; - octet byte_value_; - bool bool_value_; - std::string string_value_; - std::wstring wstring_value_; - std::map complex_values_; -#else - std::map values_; -#endif // ifdef DYNAMIC_TYPES_CHECKING - std::vector loaned_values_; - bool key_element_; - DynamicData* default_array_value_; - uint64_t union_label_; - MemberId union_id_; - DynamicData* union_discriminator_; - uint64_t discriminator_value_; - - friend class DynamicDataFactory; - friend class DynamicPubSubType; - friend class DynamicDataHelper; - friend class eprosima::fastdds::dds::DDSSQLFilter::DDSFilterExpression; - -public: - - FASTDDS_EXPORTED_API ReturnCode_t get_descriptor( - MemberDescriptor& value, - MemberId id); - - FASTDDS_EXPORTED_API ReturnCode_t set_descriptor( - MemberId id, - const MemberDescriptor* value); - - FASTDDS_EXPORTED_API ReturnCode_t clear_all_values(); - - FASTDDS_EXPORTED_API ReturnCode_t clear_nonkey_values(); - - FASTDDS_EXPORTED_API ReturnCode_t clear_value( - MemberId id); - - FASTDDS_EXPORTED_API bool equals( - const DynamicData* other) const; - - FASTDDS_EXPORTED_API TypeKind get_kind() const; - - FASTDDS_EXPORTED_API uint32_t get_item_count() const; - - FASTDDS_EXPORTED_API std::string get_name(); - - FASTDDS_EXPORTED_API MemberId get_member_id_by_name( - const std::string& name) const; - - FASTDDS_EXPORTED_API MemberId get_member_id_at_index( - uint32_t index) const; - - FASTDDS_EXPORTED_API DynamicData* loan_value( - MemberId id); - - FASTDDS_EXPORTED_API ReturnCode_t return_loaned_value( - const DynamicData* value); - - FASTDDS_EXPORTED_API MemberId get_array_index( - const std::vector& position); - - FASTDDS_EXPORTED_API ReturnCode_t insert_sequence_data( - MemberId& outId); - - FASTDDS_EXPORTED_API ReturnCode_t insert_int32_value( - int32_t value, - MemberId& outId); - - FASTDDS_EXPORTED_API ReturnCode_t insert_uint32_value( - uint32_t value, - MemberId& outId); - - FASTDDS_EXPORTED_API ReturnCode_t insert_int16_value( - int16_t value, - MemberId& outId); - - FASTDDS_EXPORTED_API ReturnCode_t insert_uint16_value( - uint16_t value, - MemberId& outId); - - FASTDDS_EXPORTED_API ReturnCode_t insert_int64_value( - int64_t value, - MemberId& outId); - - FASTDDS_EXPORTED_API ReturnCode_t insert_uint64_value( - uint64_t value, - MemberId& outId); - - FASTDDS_EXPORTED_API ReturnCode_t insert_float32_value( - float value, - MemberId& outId); - - FASTDDS_EXPORTED_API ReturnCode_t insert_float64_value( - double value, - MemberId& outId); - - FASTDDS_EXPORTED_API ReturnCode_t insert_float128_value( - long double value, - MemberId& outId); - - FASTDDS_EXPORTED_API ReturnCode_t insert_char8_value( - char value, - MemberId& outId); - - FASTDDS_EXPORTED_API ReturnCode_t insert_char16_value( - wchar_t value, - MemberId& outId); - - FASTDDS_EXPORTED_API ReturnCode_t insert_byte_value( - octet value, - MemberId& outId); - - FASTDDS_EXPORTED_API ReturnCode_t insert_bool_value( - bool value, - MemberId& outId); - - FASTDDS_EXPORTED_API ReturnCode_t insert_string_value( - const std::string& value, - MemberId& outId); - - FASTDDS_EXPORTED_API ReturnCode_t insert_wstring_value( - const std::wstring& value, - MemberId& outId); - - FASTDDS_EXPORTED_API ReturnCode_t insert_enum_value( - const std::string& value, - MemberId& outId); - - FASTDDS_EXPORTED_API ReturnCode_t insert_complex_value( - const DynamicData* value, - MemberId& outId); - - FASTDDS_EXPORTED_API ReturnCode_t insert_complex_value( - DynamicData* value, - MemberId& outId); - - FASTDDS_EXPORTED_API ReturnCode_t insert_complex_value( - DynamicData_ptr value, - MemberId& outId); - - FASTDDS_EXPORTED_API ReturnCode_t remove_sequence_data( - MemberId id); - - FASTDDS_EXPORTED_API ReturnCode_t clear_data(); - - FASTDDS_EXPORTED_API ReturnCode_t clear_array_data( - MemberId indexId); - - FASTDDS_EXPORTED_API ReturnCode_t insert_map_data( - const DynamicData* key, - MemberId& outKeyId, - MemberId& outValueId); - - FASTDDS_EXPORTED_API ReturnCode_t insert_map_data( - const DynamicData* key, - DynamicData* value, - MemberId& outKey, - MemberId& outValue); - - FASTDDS_EXPORTED_API ReturnCode_t insert_map_data( - const DynamicData* key, - const DynamicData* value, - MemberId& outKey, - MemberId& outValue); - - FASTDDS_EXPORTED_API ReturnCode_t insert_map_data( - const DynamicData* key, - DynamicData_ptr value, - MemberId& outKey, - MemberId& outValue); - - FASTDDS_EXPORTED_API ReturnCode_t remove_map_data( - MemberId keyId); - - FASTDDS_EXPORTED_API ReturnCode_t get_int32_value( - int32_t& value, - MemberId id) const; - - FASTDDS_EXPORTED_API ReturnCode_t set_int32_value( - int32_t value, - MemberId id = MEMBER_ID_INVALID); - - FASTDDS_EXPORTED_API ReturnCode_t get_uint32_value( - uint32_t& value, - MemberId id) const; - - FASTDDS_EXPORTED_API ReturnCode_t set_uint32_value( - uint32_t value, - MemberId id = MEMBER_ID_INVALID); - - FASTDDS_EXPORTED_API ReturnCode_t get_int16_value( - int16_t& value, - MemberId id) const; - - FASTDDS_EXPORTED_API ReturnCode_t set_int16_value( - int16_t value, - MemberId id = MEMBER_ID_INVALID); - - FASTDDS_EXPORTED_API ReturnCode_t get_uint16_value( - uint16_t& value, - MemberId id) const; - - FASTDDS_EXPORTED_API ReturnCode_t set_uint16_value( - uint16_t value, - MemberId id = MEMBER_ID_INVALID); - - FASTDDS_EXPORTED_API ReturnCode_t get_int64_value( - int64_t& value, - MemberId id) const; - - FASTDDS_EXPORTED_API ReturnCode_t set_int64_value( - int64_t value, - MemberId id = MEMBER_ID_INVALID); - - FASTDDS_EXPORTED_API ReturnCode_t get_uint64_value( - uint64_t& value, - MemberId id) const; - - FASTDDS_EXPORTED_API ReturnCode_t set_uint64_value( - uint64_t value, - MemberId id = MEMBER_ID_INVALID); - - FASTDDS_EXPORTED_API ReturnCode_t get_float32_value( - float& value, - MemberId id) const; - - FASTDDS_EXPORTED_API ReturnCode_t set_float32_value( - float value, - MemberId id = MEMBER_ID_INVALID); - - FASTDDS_EXPORTED_API ReturnCode_t get_float64_value( - double& value, - MemberId id) const; - - FASTDDS_EXPORTED_API ReturnCode_t set_float64_value( - double value, - MemberId id = MEMBER_ID_INVALID); - - FASTDDS_EXPORTED_API ReturnCode_t get_float128_value( - long double& value, - MemberId id) const; - - FASTDDS_EXPORTED_API ReturnCode_t set_float128_value( - long double value, - MemberId id = MEMBER_ID_INVALID); - - FASTDDS_EXPORTED_API ReturnCode_t get_char8_value( - char& value, - MemberId id) const; - - FASTDDS_EXPORTED_API ReturnCode_t set_char8_value( - char value, - MemberId id = MEMBER_ID_INVALID); - - FASTDDS_EXPORTED_API ReturnCode_t get_char16_value( - wchar_t& value, - MemberId id) const; - - FASTDDS_EXPORTED_API ReturnCode_t set_char16_value( - wchar_t value, - MemberId id = MEMBER_ID_INVALID); - - FASTDDS_EXPORTED_API ReturnCode_t get_byte_value( - octet& value, - MemberId id) const; - - FASTDDS_EXPORTED_API ReturnCode_t set_byte_value( - octet value, - MemberId id = MEMBER_ID_INVALID); - - FASTDDS_EXPORTED_API ReturnCode_t get_int8_value( - int8_t& value, - MemberId id) const - { - octet aux; - ReturnCode_t result = get_byte_value(aux, id); - value = static_cast(aux); - return result; - } - - FASTDDS_EXPORTED_API ReturnCode_t set_int8_value( - int8_t value, - MemberId id = MEMBER_ID_INVALID) - { - return set_byte_value(static_cast(value), id); - } - - FASTDDS_EXPORTED_API ReturnCode_t get_uint8_value( - uint8_t& value, - MemberId id) const - { - octet aux; - ReturnCode_t result = get_byte_value(aux, id); - value = static_cast(aux); - return result; - } - - FASTDDS_EXPORTED_API ReturnCode_t set_uint8_value( - uint8_t value, - MemberId id = MEMBER_ID_INVALID) - { - return set_byte_value(static_cast(value), id); - } - - FASTDDS_EXPORTED_API ReturnCode_t get_bool_value( - bool& value, - MemberId id) const; - - FASTDDS_EXPORTED_API ReturnCode_t set_bool_value( - bool value, - MemberId id = MEMBER_ID_INVALID); - - FASTDDS_EXPORTED_API ReturnCode_t set_bool_value( - bool value, - const std::string& name) - { - MemberId id = get_member_id_by_name(name); - if (id != MEMBER_ID_INVALID) - { - return set_bool_value(value, id); - } - return ReturnCode_t::RETCODE_BAD_PARAMETER; - } - - FASTDDS_EXPORTED_API ReturnCode_t get_string_value( - std::string& value, - MemberId id) const; - - FASTDDS_EXPORTED_API ReturnCode_t set_string_value( - const std::string& value, - MemberId id = MEMBER_ID_INVALID); - - FASTDDS_EXPORTED_API ReturnCode_t get_wstring_value( - std::wstring& value, - MemberId id) const; - - FASTDDS_EXPORTED_API ReturnCode_t set_wstring_value( - const std::wstring& value, - MemberId id = MEMBER_ID_INVALID); - - FASTDDS_EXPORTED_API ReturnCode_t get_enum_value( - std::string& value, - MemberId id) const; - - FASTDDS_EXPORTED_API ReturnCode_t set_enum_value( - const std::string& value, - MemberId id = MEMBER_ID_INVALID); - - FASTDDS_EXPORTED_API ReturnCode_t get_enum_value( - uint32_t& value, - MemberId id) const; - - FASTDDS_EXPORTED_API ReturnCode_t set_enum_value( - const uint32_t& value, - MemberId id = MEMBER_ID_INVALID); - - FASTDDS_EXPORTED_API ReturnCode_t get_bitmask_value( - uint64_t& value) const; - - FASTDDS_EXPORTED_API uint64_t get_bitmask_value() const - { - uint64_t value; - if (get_bitmask_value(value) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - FASTDDS_EXPORTED_API ReturnCode_t set_bitmask_value( - uint64_t value); - - FASTDDS_EXPORTED_API ReturnCode_t get_complex_value( - DynamicData** value, - MemberId id) const; - - FASTDDS_EXPORTED_API ReturnCode_t set_complex_value( - DynamicData* value, - MemberId id = MEMBER_ID_INVALID); - - FASTDDS_EXPORTED_API ReturnCode_t get_union_label( - uint64_t& value) const; - - // Basic types returns (copy) - FASTDDS_EXPORTED_API int32_t get_int32_value( - MemberId id) const - { - int32_t value; - if (get_int32_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - FASTDDS_EXPORTED_API uint32_t get_uint32_value( - MemberId id) const - { - uint32_t value; - if (get_uint32_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - FASTDDS_EXPORTED_API int16_t get_int16_value( - MemberId id) const - { - int16_t value; - if (get_int16_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - FASTDDS_EXPORTED_API uint16_t get_uint16_value( - MemberId id) const - { - uint16_t value; - if (get_uint16_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - FASTDDS_EXPORTED_API int64_t get_int64_value( - MemberId id) const - { - int64_t value; - if (get_int64_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - FASTDDS_EXPORTED_API uint64_t get_uint64_value( - MemberId id) const - { - uint64_t value; - if (get_uint64_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - FASTDDS_EXPORTED_API float get_float32_value( - MemberId id) const - { - float value; - if (get_float32_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - FASTDDS_EXPORTED_API double get_float64_value( - MemberId id) const - { - double value; - if (get_float64_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - FASTDDS_EXPORTED_API long double get_float128_value( - MemberId id) const - { - long double value; - if (get_float128_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - FASTDDS_EXPORTED_API char get_char8_value( - MemberId id) const - { - char value; - if (get_char8_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - FASTDDS_EXPORTED_API wchar_t get_char16_value( - MemberId id) const - { - wchar_t value; - if (get_char16_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - FASTDDS_EXPORTED_API octet get_byte_value( - MemberId id) const - { - octet value; - if (get_byte_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - FASTDDS_EXPORTED_API int8_t get_int8_value( - MemberId id) const - { - int8_t value; - if (get_int8_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - FASTDDS_EXPORTED_API uint8_t get_uint8_value( - MemberId id) const - { - uint8_t value; - if (get_uint8_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - FASTDDS_EXPORTED_API bool get_bool_value( - MemberId id) const - { - bool value; - if (get_bool_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - FASTDDS_EXPORTED_API bool get_bool_value( - const std::string& name) const - { - MemberId id = get_member_id_by_name(name); - bool value; - if (get_bool_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - FASTDDS_EXPORTED_API std::string get_string_value( - MemberId id) const - { - std::string value; - if (get_string_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - FASTDDS_EXPORTED_API std::wstring get_wstring_value( - MemberId id) const - { - std::wstring value; - if (get_wstring_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - FASTDDS_EXPORTED_API std::string get_enum_value( - MemberId id) const - { - std::string value; - if (get_enum_value(value, id) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - FASTDDS_EXPORTED_API uint64_t get_union_label() const - { - uint64_t value; - if (get_union_label(value) != ReturnCode_t::RETCODE_OK) - { - throw ReturnCode_t::RETCODE_BAD_PARAMETER; - } - return value; - } - - FASTDDS_EXPORTED_API uint64_t get_discriminator_value() const - { - return discriminator_value_; - } - - FASTDDS_EXPORTED_API void get_discriminator_value( - uint64_t& outValue) const - { - outValue = discriminator_value_; - } - - FASTDDS_EXPORTED_API void set_discriminator_value( - uint64_t value) - { - discriminator_value_ = value; - } - -}; - - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPES_DYNAMIC_DATA_H diff --git a/include/fastrtps/types/DynamicDataFactory.h b/include/fastrtps/types/DynamicDataFactory.h deleted file mode 100644 index a5ea5b6837a..00000000000 --- a/include/fastrtps/types/DynamicDataFactory.h +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2018 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. - -#ifndef TYPES_DYNAMIC_DATA_FACTORY_H -#define TYPES_DYNAMIC_DATA_FACTORY_H - -#include -#include -#include -#include -#include -#include - -//#define DISABLE_DYNAMIC_MEMORY_CHECK - -namespace eprosima { -namespace fastrtps { -namespace types { - -class DynamicDataFactory -{ -protected: - - DynamicDataFactory(); - - ReturnCode_t create_members( - DynamicData* pData, - DynamicType_ptr pType); - -#ifndef DISABLE_DYNAMIC_MEMORY_CHECK - std::vector dynamic_datas_; - mutable std::recursive_mutex mutex_; -#endif // ifndef DISABLE_DYNAMIC_MEMORY_CHECK - -public: - - ~DynamicDataFactory(); - - FASTDDS_EXPORTED_API static DynamicDataFactory* get_instance(); - - FASTDDS_EXPORTED_API static ReturnCode_t delete_instance(); - - FASTDDS_EXPORTED_API DynamicData* create_data( - DynamicTypeBuilder* pBuilder); - - FASTDDS_EXPORTED_API DynamicData* create_data( - DynamicType_ptr pType); - - FASTDDS_EXPORTED_API DynamicData* create_copy( - const DynamicData* pData); - - FASTDDS_EXPORTED_API ReturnCode_t delete_data( - DynamicData* pData); - - FASTDDS_EXPORTED_API bool is_empty() const; -}; - - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPES_DYNAMIC_DATA_FACTORY_H diff --git a/include/fastrtps/types/DynamicDataHelper.hpp b/include/fastrtps/types/DynamicDataHelper.hpp deleted file mode 100644 index 3607cb773e7..00000000000 --- a/include/fastrtps/types/DynamicDataHelper.hpp +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright 2019 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. - -#ifndef _FASTRTPS_TYPES_DYNAMICDATAHELPER_HPP_ -#define _FASTRTPS_TYPES_DYNAMICDATAHELPER_HPP_ - -#include -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -class DynamicDataHelper -{ -public: - - FASTDDS_EXPORTED_API static void print( - const DynamicData_ptr& data); - - FASTDDS_EXPORTED_API static std::ostream& print( - std::ostream& output, - const DynamicData_ptr& data); - - FASTDDS_EXPORTED_API static void print( - const DynamicData* data); - - FASTDDS_EXPORTED_API static std::ostream& print( - std::ostream& output, - const DynamicData* data); - -protected: - - static void print_basic_element( - DynamicData* data, - MemberId id, - TypeKind kind); - - static void print_basic_element( - DynamicData* data, - MemberId id, - TypeKind kind, - std::ostream& output); - - static void print_collection( - DynamicData* data, - const std::string& tabs = ""); - - static void print_collection( - DynamicData* data, - std::ostream& output, - const std::string& tabs = ""); - - static void fill_array_positions( - const std::vector& bounds, - std::vector>& positions); - - static void get_index_position( - uint32_t index, - const std::vector& bounds, - std::vector& position); - - static void aux_index_position( - uint32_t index, - uint32_t inner_index, - const std::vector& bounds, - std::vector& position); - - static void print_basic_collection( - DynamicData* data); - - static void print_basic_collection( - DynamicData* data, - std::ostream& output); - - static void print_complex_collection( - DynamicData* data, - const std::string& tabs = ""); - - static void print_complex_collection( - DynamicData* data, - std::ostream& output, - const std::string& tabs = ""); - - static void print_complex_element( - DynamicData* data, - MemberId id, - const std::string& tabs = ""); - - static void print_complex_element( - DynamicData* data, - MemberId id, - std::ostream& output, - const std::string& tabs = ""); - - static void print_member( - DynamicData* data, - const DynamicTypeMember* type, - const std::string& tabs = ""); - - static void print_member( - DynamicData* data, - std::ostream& output, - const DynamicTypeMember* type, - const std::string& tabs = ""); -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // _FASTRTPS_TYPES_DYNAMICDATAHELPER_HPP_ diff --git a/include/fastrtps/types/DynamicDataPtr.h b/include/fastrtps/types/DynamicDataPtr.h deleted file mode 100644 index 63075aa33ba..00000000000 --- a/include/fastrtps/types/DynamicDataPtr.h +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2018 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. - -#ifndef TYPES_DYNAMIC_DATA_PTR_H -#define TYPES_DYNAMIC_DATA_PTR_H - -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -class DynamicData; - -class DynamicData_ptr : public std::shared_ptr -{ -public: - - typedef std::shared_ptr Base; - - using Base::operator ->; - using Base::operator *; - using Base::operator bool; - - FASTDDS_EXPORTED_API DynamicData_ptr() - { - } - - FASTDDS_EXPORTED_API explicit DynamicData_ptr( - DynamicData* pData); - - FASTDDS_EXPORTED_API DynamicData_ptr( - const DynamicData_ptr& other) = default; - - FASTDDS_EXPORTED_API DynamicData_ptr( - DynamicData_ptr&& other) = default; - - FASTDDS_EXPORTED_API DynamicData_ptr& operator =( - const DynamicData_ptr&) = default; - - FASTDDS_EXPORTED_API DynamicData_ptr& operator =( - DynamicData_ptr&&) = default; - - FASTDDS_EXPORTED_API DynamicData_ptr& operator =( - DynamicData*); -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPES_DYNAMIC_DATA_PTR_H diff --git a/include/fastrtps/types/DynamicPubSubType.h b/include/fastrtps/types/DynamicPubSubType.h deleted file mode 100644 index ca6fc0ab566..00000000000 --- a/include/fastrtps/types/DynamicPubSubType.h +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright 2018 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. - -#ifndef TYPES_DYNAMIC_PUB_SUB_TYPE_H -#define TYPES_DYNAMIC_PUB_SUB_TYPE_H - -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -class DynamicPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -protected: - - void UpdateDynamicTypeInfo(); - - DynamicType_ptr dynamic_type_; - MD5 m_md5; - unsigned char* m_keyBuffer; - - enum - { - FINAL, - APPENDABLE, - MUTABLE - } - extensibility_ {APPENDABLE}; - -public: - - FASTDDS_EXPORTED_API DynamicPubSubType(); - - FASTDDS_EXPORTED_API DynamicPubSubType( - DynamicType_ptr pDynamicType); - - FASTDDS_EXPORTED_API virtual ~DynamicPubSubType(); - - FASTDDS_EXPORTED_API void* createData() override; - - FASTDDS_EXPORTED_API void deleteData ( - void* data) override; - - FASTDDS_EXPORTED_API bool deserialize ( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - FASTDDS_EXPORTED_API bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - FASTDDS_EXPORTED_API std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - FASTDDS_EXPORTED_API std::function getSerializedSizeProvider( - void* data, - fastdds::dds::DataRepresentationId_t data_representation) override; - - FASTDDS_EXPORTED_API bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - FASTDDS_EXPORTED_API bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - fastdds::dds::DataRepresentationId_t data_representation) override; - - FASTDDS_EXPORTED_API void CleanDynamicType(); - - FASTDDS_EXPORTED_API DynamicType_ptr GetDynamicType() const; - - FASTDDS_EXPORTED_API ReturnCode_t SetDynamicType( - DynamicData_ptr pData); - - FASTDDS_EXPORTED_API ReturnCode_t SetDynamicType( - DynamicType_ptr pType); -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPES_DYNAMIC_PUB_SUB_TYPE_H diff --git a/include/fastrtps/types/DynamicType.h b/include/fastrtps/types/DynamicType.h deleted file mode 100644 index f14ecf26b74..00000000000 --- a/include/fastrtps/types/DynamicType.h +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright 2018 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. - -#ifndef TYPES_DYNAMIC_TYPE_H -#define TYPES_DYNAMIC_TYPE_H - -#include -#include - -namespace eprosima { - -namespace fastdds { -namespace dds { -class DomainParticipantImpl; -} // namespace dds -} // namespace fastdds - -namespace fastrtps { -namespace types { - -class AnnotationDescriptor; -class TypeDescriptor; -class DynamicTypeMember; -class DynamicTypeBuilder; - -class DynamicType -{ -protected: - - friend class DynamicTypeBuilder; - friend class DynamicTypeBuilderFactory; - friend class MemberDescriptor; - friend class TypeDescriptor; - friend class DynamicData; - friend class DynamicDataFactory; - friend class AnnotationDescriptor; - friend class TypeObjectFactory; - friend class DynamicTypeMember; - friend class DynamicDataHelper; - friend class fastdds::dds::DomainParticipantImpl; - - DynamicType(); - - FASTDDS_EXPORTED_API DynamicType( - const TypeDescriptor* descriptor); - - DynamicType( - const DynamicTypeBuilder* other); - - FASTDDS_EXPORTED_API virtual ~DynamicType(); - - FASTDDS_EXPORTED_API virtual void clear(); - - ReturnCode_t copy_from_builder( - const DynamicTypeBuilder* other); - - // Checks if there is a member with the given name. - bool exists_member_by_name( - const std::string& name) const; - - // This method is used by Dynamic Data to override the name of the types based on ALIAS. - void set_name( - const std::string& name); - - ReturnCode_t apply_annotation( - AnnotationDescriptor& descriptor); - - ReturnCode_t apply_annotation( - const std::string& annotation_name, - const std::string& key, - const std::string& value); - - ReturnCode_t apply_annotation_to_member( - MemberId id, - AnnotationDescriptor& descriptor); - - ReturnCode_t apply_annotation_to_member( - MemberId id, - const std::string& annotation_name, - const std::string& key, - const std::string& value); - - ReturnCode_t get_annotation( - AnnotationDescriptor& descriptor, - uint32_t idx); - - uint32_t get_annotation_count(); - - DynamicType_ptr get_base_type() const; - - DynamicType_ptr get_discriminator_type() const; - - DynamicType_ptr get_element_type() const; - - DynamicType_ptr get_key_element_type() const; - - ReturnCode_t get_member( - DynamicTypeMember& member, - MemberId id); - - ReturnCode_t get_member_by_name( - DynamicTypeMember& member, - const std::string& name); - - TypeDescriptor* descriptor_; - std::map member_by_id_; // Aggregated members - std::map member_by_name_; // Uses the pointers from "member_by_id_". - std::string name_; - TypeKind kind_; - bool is_key_defined_; - -public: - - FASTDDS_EXPORTED_API bool equals( - const DynamicType* other) const; - - FASTDDS_EXPORTED_API ReturnCode_t get_all_members( - std::map& members); - - FASTDDS_EXPORTED_API ReturnCode_t get_all_members_by_name( - std::map& members); - - FASTDDS_EXPORTED_API uint32_t get_bounds( - uint32_t index = 0) const; - - FASTDDS_EXPORTED_API uint32_t get_bounds_size() const; - - FASTDDS_EXPORTED_API ReturnCode_t get_descriptor( - TypeDescriptor* descriptor) const; - - FASTDDS_EXPORTED_API const TypeDescriptor* get_descriptor() const; - - FASTDDS_EXPORTED_API TypeDescriptor* get_descriptor(); - - FASTDDS_EXPORTED_API bool key_annotation() const; - - FASTDDS_EXPORTED_API inline TypeKind get_kind() const - { - return kind_; - } - - FASTDDS_EXPORTED_API std::string get_name() const; - - FASTDDS_EXPORTED_API MemberId get_members_count() const; - - FASTDDS_EXPORTED_API uint32_t get_total_bounds() const; - - FASTDDS_EXPORTED_API const TypeDescriptor* get_type_descriptor() const - { - return descriptor_; - } - - FASTDDS_EXPORTED_API bool has_children() const; - - FASTDDS_EXPORTED_API bool is_consistent() const; - - FASTDDS_EXPORTED_API bool is_complex_kind() const; - - FASTDDS_EXPORTED_API bool is_discriminator_type() const; - - FASTDDS_EXPORTED_API size_t get_size() const; - -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPES_DYNAMIC_TYPE_H diff --git a/include/fastrtps/types/DynamicTypeBuilder.h b/include/fastrtps/types/DynamicTypeBuilder.h deleted file mode 100644 index 4dca61cb0e7..00000000000 --- a/include/fastrtps/types/DynamicTypeBuilder.h +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright 2018 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. - -#ifndef TYPES_DYNAMIC_TYPE_BUILDER_H -#define TYPES_DYNAMIC_TYPE_BUILDER_H - -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -class AnnotationDescriptor; -class TypeDescriptor; -class MemberDescriptor; -class DynamicType; -class DynamicTypeMember; - -class DynamicTypeBuilder -{ -protected: - - DynamicTypeBuilder(); - - DynamicTypeBuilder( - const DynamicTypeBuilder* builder); - - DynamicTypeBuilder( - const TypeDescriptor* descriptor); - - virtual ~DynamicTypeBuilder(); - - friend class DynamicType; - friend class DynamicTypeBuilderFactory; - - TypeDescriptor* descriptor_; - std::map member_by_id_; // Aggregated members - std::map member_by_name_; // Uses the pointers from "member_by_id_". - std::string name_; - TypeKind kind_; - MemberId current_member_id_; - uint32_t max_index_; - - ReturnCode_t _apply_annotation_to_member( - MemberId id, - AnnotationDescriptor& descriptor); - - ReturnCode_t _apply_annotation_to_member( - MemberId id, - const std::string& annotation_name, - const std::string& key, - const std::string& value); - - bool check_union_configuration( - const MemberDescriptor* descriptor); - - // Checks if there is a member with the given name. - bool exists_member_by_name( - const std::string& name) const; - - void refresh_member_ids(); - - void clear(); - - ReturnCode_t copy_from_builder( - const DynamicTypeBuilder* other); - -public: - - FASTDDS_EXPORTED_API ReturnCode_t add_empty_member( - uint32_t index, - const std::string& name); - - FASTDDS_EXPORTED_API ReturnCode_t add_member( - const MemberDescriptor* descriptor); - - FASTDDS_EXPORTED_API ReturnCode_t add_member( - MemberId id, - const std::string& name, - DynamicTypeBuilder* type_ = nullptr); - - FASTDDS_EXPORTED_API ReturnCode_t add_member( - MemberId id, - const std::string& name, - DynamicTypeBuilder* type_, - const std::string& defaultValue); - - FASTDDS_EXPORTED_API ReturnCode_t add_member( - MemberId id, - const std::string& name, - DynamicTypeBuilder* type_, - const std::string& defaultValue, - const std::vector& unionLabels, - bool isDefaultLabel); - - FASTDDS_EXPORTED_API ReturnCode_t add_member( - MemberId id, - const std::string& name, - DynamicType_ptr type_ = DynamicType_ptr(nullptr)); - - FASTDDS_EXPORTED_API ReturnCode_t add_member( - MemberId id, - const std::string& name, - DynamicType_ptr type_, - const std::string& defaultValue); - - FASTDDS_EXPORTED_API ReturnCode_t add_member( - MemberId id, - const std::string& name, - DynamicType_ptr type_, - const std::string& defaultValue, - const std::vector& unionLabels, - bool isDefaultLabel); - - FASTDDS_EXPORTED_API ReturnCode_t apply_annotation( - AnnotationDescriptor& descriptor); - - FASTDDS_EXPORTED_API ReturnCode_t apply_annotation( - const std::string& annotation_name, - const std::string& key, - const std::string& value); - - FASTDDS_EXPORTED_API ReturnCode_t apply_annotation_to_member( - MemberId id, - AnnotationDescriptor& descriptor); - - FASTDDS_EXPORTED_API ReturnCode_t apply_annotation_to_member( - MemberId id, - const std::string& annotation_name, - const std::string& key, - const std::string& value); - - FASTDDS_EXPORTED_API DynamicType_ptr build(); - - FASTDDS_EXPORTED_API ReturnCode_t copy_from( - const DynamicTypeBuilder* other); - - ReturnCode_t get_all_members( - std::map& members); - - FASTDDS_EXPORTED_API inline TypeKind get_kind() const - { - return kind_; - } - - FASTDDS_EXPORTED_API std::string get_name() const; - - FASTDDS_EXPORTED_API MemberId get_member_id_by_name( - const std::string& name) const; - - const TypeDescriptor* get_type_descriptor() const - { - return descriptor_; - } - - bool is_consistent() const; - - bool is_discriminator_type() const; - - FASTDDS_EXPORTED_API ReturnCode_t set_name( - const std::string& name); -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPES_DYNAMIC_TYPE_BUILDER_H diff --git a/include/fastrtps/types/DynamicTypeBuilderFactory.h b/include/fastrtps/types/DynamicTypeBuilderFactory.h deleted file mode 100644 index dd9ff13d813..00000000000 --- a/include/fastrtps/types/DynamicTypeBuilderFactory.h +++ /dev/null @@ -1,317 +0,0 @@ -// Copyright 2018 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. - -#ifndef TYPES_DYNAMIC_TYPE_BUILDER_FACTORY_H -#define TYPES_DYNAMIC_TYPE_BUILDER_FACTORY_H - -#include -#include -#include -#include - -//#define DISABLE_DYNAMIC_MEMORY_CHECK - -namespace eprosima { -namespace fastrtps { -namespace types { - -class AnnotationDescriptor; -class DynamicTypeBuilder; -class TypeDescriptor; -class TypeIdentifier; -class MemberDescriptor; -class TypeObject; -class DynamicType; -class DynamicType_ptr; -class AnnotationParameterValue; - -class DynamicTypeBuilderFactory -{ -protected: - - DynamicTypeBuilderFactory(); - - inline void add_builder_to_list( - DynamicTypeBuilder* pBuilder); - - DynamicType_ptr build_type( - DynamicType_ptr other); - - void build_alias_type_code( - const TypeDescriptor* descriptor, - TypeObject& object, - bool complete = true) const; - - void build_string8_type_code( - const TypeDescriptor* descriptor) const; - - void build_string16_type_code( - const TypeDescriptor* descriptor) const; - - void build_sequence_type_code( - const TypeDescriptor* descriptor, - TypeObject& object, - bool complete = true) const; - - void build_array_type_code( - const TypeDescriptor* descriptor, - TypeObject& object, - bool complete = true) const; - - void build_map_type_code( - const TypeDescriptor* descriptor, - TypeObject& object, - bool complete = true) const; - - void build_enum_type_code( - const TypeDescriptor* descriptor, - TypeObject& object, - const std::vector members, - bool complete = true) const; - - void build_struct_type_code( - const TypeDescriptor* descriptor, - TypeObject& object, - const std::vector members, - bool complete = true) const; - - void build_union_type_code( - const TypeDescriptor* descriptor, - TypeObject& object, - const std::vector members, - bool complete = true) const; - - void build_bitset_type_code( - const TypeDescriptor* descriptor, - TypeObject& object, - const std::vector members, - bool complete = true) const; - - void build_bitmask_type_code( - const TypeDescriptor* descriptor, - TypeObject& object, - const std::vector members, - bool complete = true) const; - - void build_annotation_type_code( - const TypeDescriptor* descriptor, - TypeObject& object, - const std::vector members, - bool complete = true) const; - - void set_annotation_default_value( - AnnotationParameterValue& apv, - const MemberDescriptor* member) const; - - void apply_type_annotations( - AppliedAnnotationSeq& annotations, - const TypeDescriptor* descriptor) const; - -#ifndef DISABLE_DYNAMIC_MEMORY_CHECK - std::vector builders_list_; - mutable std::recursive_mutex mutex_; -#endif // ifndef DISABLE_DYNAMIC_MEMORY_CHECK - -public: - - FASTDDS_EXPORTED_API static DynamicTypeBuilderFactory* get_instance(); - - FASTDDS_EXPORTED_API static ReturnCode_t delete_instance(); - - ~DynamicTypeBuilderFactory(); - - FASTDDS_EXPORTED_API DynamicType_ptr get_primitive_type( - TypeKind kind); - - FASTDDS_EXPORTED_API ReturnCode_t delete_builder( - DynamicTypeBuilder* builder); - - FASTDDS_EXPORTED_API ReturnCode_t delete_type( - DynamicType* type); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_custom_builder( - const TypeDescriptor* descriptor, - const std::string& name = ""); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_builder_copy( - const DynamicTypeBuilder* type); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_int32_builder(); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_uint32_builder(); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_int16_builder(); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_uint16_builder(); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_int64_builder(); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_uint64_builder(); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_float32_builder(); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_float64_builder(); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_float128_builder(); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_char8_builder(); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_char16_builder(); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_bool_builder(); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_byte_builder(); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_string_builder( - uint32_t bound = MAX_STRING_LENGTH); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_wstring_builder( - uint32_t bound = MAX_STRING_LENGTH); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_sequence_builder( - const DynamicTypeBuilder* element_type, - uint32_t bound = MAX_ELEMENTS_COUNT); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_sequence_builder( - const DynamicType_ptr type, - uint32_t bound = MAX_ELEMENTS_COUNT); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_array_builder( - const DynamicTypeBuilder* element_type, - const std::vector& bounds); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_array_builder( - const DynamicType_ptr type, - const std::vector& bounds); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_map_builder( - DynamicTypeBuilder* key_element_type, - DynamicTypeBuilder* element_type, - uint32_t bound = MAX_ELEMENTS_COUNT); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_map_builder( - DynamicType_ptr key_type, - DynamicType_ptr value_type, - uint32_t bound = MAX_ELEMENTS_COUNT); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_bitmask_builder( - uint32_t bound); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_bitset_builder(); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_alias_builder( - DynamicTypeBuilder* base_type, - const std::string& sName); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_alias_builder( - DynamicType_ptr base_type, - const std::string& sName); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_enum_builder(); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_struct_builder(); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_child_struct_builder( - DynamicTypeBuilder* parent_type); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_union_builder( - DynamicTypeBuilder* discriminator_type); - - FASTDDS_EXPORTED_API DynamicTypeBuilder* create_union_builder( - DynamicType_ptr discriminator_type); - - FASTDDS_EXPORTED_API DynamicType_ptr create_annotation_primitive( - const std::string& name); - - FASTDDS_EXPORTED_API DynamicType_ptr create_type( - const TypeDescriptor* descriptor, - const std::string& name = ""); - - FASTDDS_EXPORTED_API DynamicType_ptr create_type( - const DynamicTypeBuilder* other); - - FASTDDS_EXPORTED_API DynamicType_ptr create_alias_type( - DynamicTypeBuilder* base_type, - const std::string& sName); - - FASTDDS_EXPORTED_API DynamicType_ptr create_alias_type( - DynamicType_ptr base_type, - const std::string& sName); - - FASTDDS_EXPORTED_API DynamicType_ptr create_int32_type(); - - FASTDDS_EXPORTED_API DynamicType_ptr create_uint32_type(); - - FASTDDS_EXPORTED_API DynamicType_ptr create_int16_type(); - - FASTDDS_EXPORTED_API DynamicType_ptr create_uint16_type(); - - FASTDDS_EXPORTED_API DynamicType_ptr create_int64_type(); - - FASTDDS_EXPORTED_API DynamicType_ptr create_uint64_type(); - - FASTDDS_EXPORTED_API DynamicType_ptr create_float32_type(); - - FASTDDS_EXPORTED_API DynamicType_ptr create_float64_type(); - - FASTDDS_EXPORTED_API DynamicType_ptr create_float128_type(); - - FASTDDS_EXPORTED_API DynamicType_ptr create_char8_type(); - - FASTDDS_EXPORTED_API DynamicType_ptr create_char16_type(); - - FASTDDS_EXPORTED_API DynamicType_ptr create_bool_type(); - - FASTDDS_EXPORTED_API DynamicType_ptr create_byte_type(); - - FASTDDS_EXPORTED_API DynamicType_ptr create_string_type( - uint32_t bound = MAX_STRING_LENGTH); - - FASTDDS_EXPORTED_API DynamicType_ptr create_wstring_type( - uint32_t bound = MAX_STRING_LENGTH); - - FASTDDS_EXPORTED_API DynamicType_ptr create_bitset_type( - uint32_t bound); - - FASTDDS_EXPORTED_API void build_type_identifier( - const DynamicType_ptr type, - TypeIdentifier& identifier, - bool complete = true) const; - - FASTDDS_EXPORTED_API void build_type_identifier( - const TypeDescriptor* descriptor, - TypeIdentifier& identifier, - bool complete = true) const; - - FASTDDS_EXPORTED_API void build_type_object( - const DynamicType_ptr type, - TypeObject& object, - bool complete = true, - bool force = false) const; - - FASTDDS_EXPORTED_API void build_type_object( - const TypeDescriptor* descriptor, - TypeObject& object, - const std::vector* members = nullptr, - bool complete = true, - bool force = false) const; - - FASTDDS_EXPORTED_API bool is_empty() const; -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPES_DYNAMIC_TYPE_BUILDER_FACTORY_H diff --git a/include/fastrtps/types/DynamicTypeBuilderPtr.h b/include/fastrtps/types/DynamicTypeBuilderPtr.h deleted file mode 100644 index b208286b30e..00000000000 --- a/include/fastrtps/types/DynamicTypeBuilderPtr.h +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2018 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. - -#ifndef TYPES_DYNAMIC_TYPE_BUILDER_PTR_H -#define TYPES_DYNAMIC_TYPE_BUILDER_PTR_H - -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -class DynamicTypeBuilder; - -class DynamicTypeBuilder_ptr : public std::shared_ptr -{ -public: - - typedef std::shared_ptr Base; - - using Base::operator ->; - using Base::operator *; - using Base::operator bool; - - FASTDDS_EXPORTED_API DynamicTypeBuilder_ptr() - { - } - - FASTDDS_EXPORTED_API DynamicTypeBuilder_ptr( - DynamicTypeBuilder* pType); - - FASTDDS_EXPORTED_API DynamicTypeBuilder_ptr( - DynamicTypeBuilder_ptr&& other) = default; - - FASTDDS_EXPORTED_API DynamicTypeBuilder_ptr& operator =( - DynamicTypeBuilder_ptr&&) = default; - - FASTDDS_EXPORTED_API bool operator !=( - std::nullptr_t) const - { - return bool(*this); - } - - FASTDDS_EXPORTED_API bool operator ==( - std::nullptr_t) const - { - return !*this; - } - -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPES_DYNAMIC_TYPE_BUILDER_PTR_H diff --git a/include/fastrtps/types/DynamicTypeMember.h b/include/fastrtps/types/DynamicTypeMember.h deleted file mode 100644 index 3b3f5f3654b..00000000000 --- a/include/fastrtps/types/DynamicTypeMember.h +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2018 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. - -#ifndef TYPES_DYNAMIC_TYPE_MEMBER_H -#define TYPES_DYNAMIC_TYPE_MEMBER_H - -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -class AnnotationDescriptor; -class DynamicType; - -class DynamicTypeMember -{ -protected: - - DynamicType* parent_; - MemberDescriptor descriptor_; - MemberId id_; - - uint32_t get_index() const; - - void set_index( - uint32_t index); - - void set_parent( - DynamicType* pType); - - friend class DynamicTypeBuilder; - friend class DynamicType; - friend class DynamicData; - -public: - - FASTDDS_EXPORTED_API DynamicTypeMember(); - - FASTDDS_EXPORTED_API DynamicTypeMember( - const DynamicTypeMember* other); - - FASTDDS_EXPORTED_API DynamicTypeMember( - const MemberDescriptor* descriptor, - MemberId id); - - ~DynamicTypeMember(); - - FASTDDS_EXPORTED_API ReturnCode_t apply_annotation( - AnnotationDescriptor& descriptor); - - FASTDDS_EXPORTED_API ReturnCode_t apply_annotation( - const std::string& annotation_name, - const std::string& key, - const std::string& value); - - FASTDDS_EXPORTED_API bool equals( - const DynamicTypeMember*) const; - - FASTDDS_EXPORTED_API ReturnCode_t get_annotation( - AnnotationDescriptor& descriptor, - uint32_t idx); - - FASTDDS_EXPORTED_API uint32_t get_annotation_count(); - - FASTDDS_EXPORTED_API bool key_annotation() const; - - FASTDDS_EXPORTED_API std::vector get_union_labels() const; - - FASTDDS_EXPORTED_API ReturnCode_t get_descriptor( - MemberDescriptor* descriptor) const; - - FASTDDS_EXPORTED_API MemberId get_id() const; - - FASTDDS_EXPORTED_API std::string get_name() const; - - FASTDDS_EXPORTED_API bool is_default_union_value() const; - - FASTDDS_EXPORTED_API const MemberDescriptor* get_descriptor() const - { - return &descriptor_; - } - -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPES_DYNAMIC_TYPE_MEMBER_H diff --git a/include/fastrtps/types/DynamicTypePtr.h b/include/fastrtps/types/DynamicTypePtr.h deleted file mode 100644 index f53c811e519..00000000000 --- a/include/fastrtps/types/DynamicTypePtr.h +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2018 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. - -#ifndef TYPES_DYNAMIC_TYPE_PTR_H -#define TYPES_DYNAMIC_TYPE_PTR_H - -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -class DynamicType; - -class DynamicType_ptr : public std::shared_ptr -{ -public: - - typedef std::shared_ptr Base; - - using Base::operator ->; - using Base::operator *; - using Base::operator bool; - - DynamicType_ptr() - { - } - - FASTDDS_EXPORTED_API explicit DynamicType_ptr( - DynamicType* pType); - - FASTDDS_EXPORTED_API DynamicType_ptr( - const DynamicType_ptr& other) = default; - - FASTDDS_EXPORTED_API DynamicType_ptr( - DynamicType_ptr&& other) = default; - - FASTDDS_EXPORTED_API DynamicType_ptr& operator =( - const DynamicType_ptr&) = default; - - FASTDDS_EXPORTED_API DynamicType_ptr& operator =( - DynamicType_ptr&&) = default; - - FASTDDS_EXPORTED_API DynamicType_ptr& operator =( - DynamicType*); - - FASTDDS_EXPORTED_API bool operator !=( - std::nullptr_t) const - { - return bool(*this); - } - - FASTDDS_EXPORTED_API bool operator ==( - std::nullptr_t) const - { - return !*this; - } - -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPES_DYNAMIC_TYPE_PTR_H diff --git a/include/fastrtps/types/MemberDescriptor.h b/include/fastrtps/types/MemberDescriptor.h deleted file mode 100644 index f6f1fc69706..00000000000 --- a/include/fastrtps/types/MemberDescriptor.h +++ /dev/null @@ -1,220 +0,0 @@ -// Copyright 2018 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. - -#ifndef TYPES_MEMBER_DESCRIPTOR_H -#define TYPES_MEMBER_DESCRIPTOR_H - -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -class DynamicType; -class AnnotationDescriptor; - -class MemberDescriptor -{ -protected: - - std::string name_; // Name of the member - MemberId id_; // MemberId, it should be filled automatically when the member is added. - DynamicType_ptr type_; // Member's Type. - std::string default_value_; // Default value of the member in string. - uint32_t index_; // Definition order of the member inside it's parent. - std::vector labels_; // Case Labels for unions. - bool default_label_; // TRUE if it's the default option of a union. - - std::vector annotation_; // Annotations to apply - - friend class DynamicTypeBuilderFactory; - friend class DynamicData; - friend class DynamicTypeMember; - friend class TypeObjectFactory; - - bool is_default_value_consistent( - const std::string& sDefaultValue) const; - - bool is_type_name_consistent( - const std::string& sName) const; - -public: - - FASTDDS_EXPORTED_API MemberDescriptor(); - - FASTDDS_EXPORTED_API MemberDescriptor( - uint32_t index, - const std::string& name); - - FASTDDS_EXPORTED_API MemberDescriptor( - MemberId id, - const std::string& name, - DynamicType_ptr type_); - - FASTDDS_EXPORTED_API MemberDescriptor( - MemberId id, - const std::string& name, - DynamicType_ptr type_, - const std::string& defaultValue); - - FASTDDS_EXPORTED_API MemberDescriptor( - MemberId id, - const std::string& name, - DynamicType_ptr type_, - const std::string& defaultValue, - const std::vector& unionLabels, - bool isDefaultLabel); - - FASTDDS_EXPORTED_API MemberDescriptor( - const MemberDescriptor* descriptor); - - FASTDDS_EXPORTED_API ~MemberDescriptor(); - - bool check_union_labels( - const std::vector& labels) const; - - FASTDDS_EXPORTED_API ReturnCode_t copy_from( - const MemberDescriptor* other); - - FASTDDS_EXPORTED_API bool equals( - const MemberDescriptor* other) const; - - FASTDDS_EXPORTED_API TypeKind get_kind() const; - - FASTDDS_EXPORTED_API MemberId get_id() const; - - FASTDDS_EXPORTED_API uint32_t get_index() const; - - FASTDDS_EXPORTED_API std::string get_name() const; - - FASTDDS_EXPORTED_API std::vector get_union_labels() const; - - FASTDDS_EXPORTED_API std::string get_default_value() const - { - if (!default_value_.empty()) - { - return default_value_; - } - // Try annotation - return annotation_get_default(); - } - - FASTDDS_EXPORTED_API bool is_default_union_value() const; - - FASTDDS_EXPORTED_API bool is_consistent( - TypeKind parentKind) const; - - FASTDDS_EXPORTED_API void add_union_case_index( - uint64_t value); - - FASTDDS_EXPORTED_API void set_id( - MemberId id); - - FASTDDS_EXPORTED_API void set_index( - uint32_t index); - - FASTDDS_EXPORTED_API void set_name( - const std::string& name); - - FASTDDS_EXPORTED_API void set_type( - DynamicType_ptr type); - - FASTDDS_EXPORTED_API DynamicType_ptr get_type() const - { - return type_; - } - - FASTDDS_EXPORTED_API void set_default_union_value( - bool bDefault); - - FASTDDS_EXPORTED_API void set_default_value( - const std::string& value) - { - default_value_ = value; - } - - // Annotations - ReturnCode_t apply_annotation( - AnnotationDescriptor& descriptor); - - ReturnCode_t apply_annotation( - const std::string& annotation_name, - const std::string& key, - const std::string& value); - - AnnotationDescriptor* get_annotation( - const std::string& name) const; - - // Annotations application - FASTDDS_EXPORTED_API bool annotation_is_optional() const; - - FASTDDS_EXPORTED_API bool annotation_is_key() const; - - FASTDDS_EXPORTED_API bool annotation_is_must_understand() const; - - FASTDDS_EXPORTED_API bool annotation_is_non_serialized() const; - - FASTDDS_EXPORTED_API bool annotation_is_value() const; - - FASTDDS_EXPORTED_API bool annotation_is_default_literal() const; - - FASTDDS_EXPORTED_API bool annotation_is_position() const; - - FASTDDS_EXPORTED_API bool annotation_is_bit_bound() const; - - // Annotations getters - FASTDDS_EXPORTED_API bool annotation_get_key() const; - - FASTDDS_EXPORTED_API std::string annotation_get_value() const; - - FASTDDS_EXPORTED_API std::string annotation_get_default() const; - - FASTDDS_EXPORTED_API uint16_t annotation_get_position() const; - - FASTDDS_EXPORTED_API uint16_t annotation_get_bit_bound() const; - - // Annotations setters - FASTDDS_EXPORTED_API void annotation_set_optional( - bool optional); - - FASTDDS_EXPORTED_API void annotation_set_key( - bool key); - - FASTDDS_EXPORTED_API void annotation_set_must_understand( - bool must_understand); - - FASTDDS_EXPORTED_API void annotation_set_non_serialized( - bool non_serialized); - - FASTDDS_EXPORTED_API void annotation_set_value( - const std::string& value); - - FASTDDS_EXPORTED_API void annotation_set_default( - const std::string& default_value); - - FASTDDS_EXPORTED_API void annotation_set_default_literal(); - - FASTDDS_EXPORTED_API void annotation_set_position( - uint16_t position); - - FASTDDS_EXPORTED_API void annotation_set_bit_bound( - uint16_t bit_bound); -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPES_MEMBER_DESCRIPTOR_H diff --git a/include/fastrtps/types/TypeDescriptor.h b/include/fastrtps/types/TypeDescriptor.h deleted file mode 100644 index 996d7344658..00000000000 --- a/include/fastrtps/types/TypeDescriptor.h +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright 2018 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. - -#ifndef TYPES_TYPE_DESCRIPTOR_H -#define TYPES_TYPE_DESCRIPTOR_H - -#include -#include -#include - -class MemberDescriptor; -class DynamicType; - -namespace eprosima { -namespace fastrtps { -namespace types { - -class TypeDescriptor -{ -protected: - - TypeKind kind_; // Type Kind. - std::string name_; // Type Name. - DynamicType_ptr base_type_; // SuperType of an structure or base type of an alias type. - DynamicType_ptr discriminator_type_; // Discrimination type for a union. - std::vector bound_; // Length for strings, arrays, sequences, maps and bitmasks. - DynamicType_ptr element_type_; // Value Type for arrays, sequences, maps, bitmasks. - DynamicType_ptr key_element_type_; // Key Type for maps. - std::vector annotation_; // Annotations to apply - - FASTDDS_EXPORTED_API void clean(); - - static bool is_type_name_consistent( - const std::string& sName); - - friend class DynamicTypeBuilderFactory; - friend class TypeObjectFactory; - friend class DynamicType; - friend class MemberDescriptor; - friend class DynamicDataHelper; - -public: - - FASTDDS_EXPORTED_API TypeDescriptor(); - - FASTDDS_EXPORTED_API TypeDescriptor( - const TypeDescriptor* other); - - FASTDDS_EXPORTED_API TypeDescriptor( - const std::string& name, - TypeKind kind); - - FASTDDS_EXPORTED_API ~TypeDescriptor(); - - FASTDDS_EXPORTED_API ReturnCode_t copy_from( - const TypeDescriptor* descriptor); - - FASTDDS_EXPORTED_API bool equals( - const TypeDescriptor* descriptor) const; - - FASTDDS_EXPORTED_API bool is_consistent() const; - - FASTDDS_EXPORTED_API DynamicType_ptr get_base_type() const; - - FASTDDS_EXPORTED_API uint32_t get_bounds( - uint32_t index = 0) const; - - FASTDDS_EXPORTED_API uint32_t get_bounds_size() const; - - FASTDDS_EXPORTED_API DynamicType_ptr get_discriminator_type() const; - - FASTDDS_EXPORTED_API DynamicType_ptr get_element_type() const; - - FASTDDS_EXPORTED_API DynamicType_ptr get_key_element_type() const; - - FASTDDS_EXPORTED_API TypeKind get_kind() const; - - FASTDDS_EXPORTED_API std::string get_name() const; - - FASTDDS_EXPORTED_API uint32_t get_total_bounds() const; - - FASTDDS_EXPORTED_API void set_kind( - TypeKind kind); - - FASTDDS_EXPORTED_API void set_name( - std::string name); - - FASTDDS_EXPORTED_API ReturnCode_t apply_annotation( - AnnotationDescriptor& descriptor); - - FASTDDS_EXPORTED_API ReturnCode_t apply_annotation( - const std::string& annotation_name, - const std::string& key, - const std::string& value); - - FASTDDS_EXPORTED_API AnnotationDescriptor* get_annotation( - const std::string& name) const; - - // Annotations application - FASTDDS_EXPORTED_API bool annotation_is_extensibility() const; - - FASTDDS_EXPORTED_API bool annotation_is_mutable() const; - - FASTDDS_EXPORTED_API bool annotation_is_final() const; - - FASTDDS_EXPORTED_API bool annotation_is_appendable() const; - - FASTDDS_EXPORTED_API bool annotation_is_nested() const; - - FASTDDS_EXPORTED_API bool annotation_is_bit_bound() const; - - FASTDDS_EXPORTED_API bool annotation_is_key() const; - - FASTDDS_EXPORTED_API bool annotation_is_non_serialized() const; - - // Annotation getters - FASTDDS_EXPORTED_API std::string annotation_get_extensibility() const; - - FASTDDS_EXPORTED_API bool annotation_get_nested() const; - - FASTDDS_EXPORTED_API uint16_t annotation_get_bit_bound() const; - - FASTDDS_EXPORTED_API bool annotation_get_key() const; - - // Annotation setters - FASTDDS_EXPORTED_API void annotation_set_extensibility( - const std::string& extensibility); - - FASTDDS_EXPORTED_API void annotation_set_mutable(); - - FASTDDS_EXPORTED_API void annotation_set_final(); - - FASTDDS_EXPORTED_API void annotation_set_appendable(); - - FASTDDS_EXPORTED_API void annotation_set_nested( - bool nested); - - FASTDDS_EXPORTED_API void annotation_set_bit_bound( - uint16_t bit_bound); - - FASTDDS_EXPORTED_API void annotation_set_key( - bool key); - - FASTDDS_EXPORTED_API void annotation_set_non_serialized( - bool non_serialized); -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPES_TYPE_DESCRIPTOR_H diff --git a/include/fastrtps/types/TypeIdentifier.h b/include/fastrtps/types/TypeIdentifier.h deleted file mode 100644 index 03e4ca8cc9f..00000000000 --- a/include/fastrtps/types/TypeIdentifier.h +++ /dev/null @@ -1,402 +0,0 @@ -// 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 TypeIdentifier.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#ifndef _TYPEIDENTIFIER_H_ -#define _TYPEIDENTIFIER_H_ - -#include -#include -#include -#include -#include -#include - -namespace eprosima { - -namespace fastcdr { -class Cdr; -} // namespace fastcdr - -namespace fastdds { -namespace dds { -class TypeConsistencyEnforcementQosPolicy; -} // namespace dds -} // namespace fastdds - -namespace fastrtps { -namespace types { - -typedef octet TypeIdentiferKind; -const octet TI_STRING8_SMALL = 0x70; -const octet TI_STRING8_LARGE = 0x71; -const octet TI_STRING16_SMALL = 0x72; -const octet TI_STRING16_LARGE = 0x73; -const octet TI_PLAIN_SEQUENCE_SMALL = 0x80; -const octet TI_PLAIN_SEQUENCE_LARGE = 0x81; -const octet TI_PLAIN_ARRAY_SMALL = 0x90; -const octet TI_PLAIN_ARRAY_LARGE = 0x91; -const octet TI_PLAIN_MAP_SMALL = 0xA0; -const octet TI_PLAIN_MAP_LARGE = 0xA1; -const octet TI_STRONGLY_CONNECTED_COMPONENT = 0xB0; - -// The TypeIdentifier uniquely identifies a type (a set of equivalent -// types according to an equivalence relationship: COMPLETE, MNIMAL). -// -// In some cases (primitive types, strings, plain types) the identifier -// is a explicit description of the type. -// In other cases the Identifier is a Hash of the type description -// -// In the case of primitive types and strings the implied equivalence -// relation is the identity. -// -// For Plain Types and Hash-defined TypeIdentifiers there are three -// possibilities: MINIMAL, COMPLETE, and COMMON: -// - MINIMAL indicates the TypeIdentifier identifies equivalent types -// according to the MINIMAL equivalence relation -// - COMPLETE indicates the TypeIdentifier identifies equivalent types -// according to the COMPLETE equivalence relation -// - COMMON indicates the TypeIdentifier identifies equivalent types -// according to both the MINIMAL and the COMMON equivalence relation. -// This means the TypeIdentifier is the same for both relationships -// -class TypeIdentifier -{ -public: - - /*! - * @brief Default constructor. - */ - FASTDDS_EXPORTED_API TypeIdentifier(); - - /*! - * @brief Default destructor. - */ - FASTDDS_EXPORTED_API ~TypeIdentifier(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object TypeIdentifier that will be copied. - */ - FASTDDS_EXPORTED_API TypeIdentifier( - const TypeIdentifier& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object TypeIdentifier that will be copied. - */ - FASTDDS_EXPORTED_API TypeIdentifier( - TypeIdentifier&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object TypeIdentifier that will be copied. - */ - FASTDDS_EXPORTED_API TypeIdentifier& operator =( - const TypeIdentifier& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object TypeIdentifier that will be copied. - */ - FASTDDS_EXPORTED_API TypeIdentifier& operator =( - TypeIdentifier&& x); - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - FASTDDS_EXPORTED_API void _d( - octet __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - FASTDDS_EXPORTED_API octet _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - FASTDDS_EXPORTED_API octet& _d(); - - /*! - * @brief This function sets a value in member string_sdefn - * @param _string_sdefn New value for member string_sdefn - */ - FASTDDS_EXPORTED_API void string_sdefn( - StringSTypeDefn _string_sdefn); - - /*! - * @brief This function returns the value of member string_sdefn - * @return Value of member string_sdefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API const StringSTypeDefn& string_sdefn() const; - - /*! - * @brief This function returns a reference to member string_sdefn - * @return Reference to member string_sdefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API StringSTypeDefn& string_sdefn(); - /*! - * @brief This function sets a value in member string_ldefn - * @param _string_ldefn New value for member string_ldefn - */ - FASTDDS_EXPORTED_API void string_ldefn( - StringLTypeDefn _string_ldefn); - - /*! - * @brief This function returns the value of member string_ldefn - * @return Value of member string_ldefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API const StringLTypeDefn& string_ldefn() const; - - /*! - * @brief This function returns a reference to member string_ldefn - * @return Reference to member string_ldefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API StringLTypeDefn& string_ldefn(); - /*! - * @brief This function sets a value in member seq_sdefn - * @param _seq_sdefn New value for member seq_sdefn - */ - FASTDDS_EXPORTED_API void seq_sdefn( - PlainSequenceSElemDefn _seq_sdefn); - - /*! - * @brief This function returns the value of member seq_sdefn - * @return Value of member seq_sdefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API const PlainSequenceSElemDefn& seq_sdefn() const; - - /*! - * @brief This function returns a reference to member seq_sdefn - * @return Reference to member seq_sdefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API PlainSequenceSElemDefn& seq_sdefn(); - /*! - * @brief This function sets a value in member seq_ldefn - * @param _seq_ldefn New value for member seq_ldefn - */ - FASTDDS_EXPORTED_API void seq_ldefn( - PlainSequenceLElemDefn _seq_ldefn); - - /*! - * @brief This function returns the value of member seq_ldefn - * @return Value of member seq_ldefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API const PlainSequenceLElemDefn& seq_ldefn() const; - - /*! - * @brief This function returns a reference to member seq_ldefn - * @return Reference to member seq_ldefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API PlainSequenceLElemDefn& seq_ldefn(); - /*! - * @brief This function sets a value in member array_sdefn - * @param _array_sdefn New value for member array_sdefn - */ - FASTDDS_EXPORTED_API void array_sdefn( - PlainArraySElemDefn _array_sdefn); - - /*! - * @brief This function returns the value of member array_sdefn - * @return Value of member array_sdefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API const PlainArraySElemDefn& array_sdefn() const; - - /*! - * @brief This function returns a reference to member array_sdefn - * @return Reference to member array_sdefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API PlainArraySElemDefn& array_sdefn(); - /*! - * @brief This function sets a value in member array_ldefn - * @param _array_ldefn New value for member array_ldefn - */ - FASTDDS_EXPORTED_API void array_ldefn( - PlainArrayLElemDefn _array_ldefn); - - /*! - * @brief This function returns the value of member array_ldefn - * @return Value of member array_ldefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API const PlainArrayLElemDefn& array_ldefn() const; - - /*! - * @brief This function returns a reference to member array_ldefn - * @return Reference to member array_ldefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API PlainArrayLElemDefn& array_ldefn(); - /*! - * @brief This function sets a value in member map_sdefn - * @param _map_sdefn New value for member map_sdefn - */ - FASTDDS_EXPORTED_API void map_sdefn( - PlainMapSTypeDefn _map_sdefn); - - /*! - * @brief This function returns the value of member map_sdefn - * @return Value of member map_sdefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API const PlainMapSTypeDefn& map_sdefn() const; - - /*! - * @brief This function returns a reference to member map_sdefn - * @return Reference to member map_sdefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API PlainMapSTypeDefn& map_sdefn(); - /*! - * @brief This function sets a value in member map_ldefn - * @param _map_ldefn New value for member map_ldefn - */ - FASTDDS_EXPORTED_API void map_ldefn( - PlainMapLTypeDefn _map_ldefn); - - /*! - * @brief This function returns the value of member map_ldefn - * @return Value of member map_ldefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API const PlainMapLTypeDefn& map_ldefn() const; - - /*! - * @brief This function returns a reference to member map_ldefn - * @return Reference to member map_ldefn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API PlainMapLTypeDefn& map_ldefn(); - /*! - * @brief This function sets a value in member sc_component_id - * @param _sc_component_id New value for member sc_component_id - */ - FASTDDS_EXPORTED_API void sc_component_id( - StronglyConnectedComponentId _sc_component_id); - - /*! - * @brief This function returns the value of member sc_component_id - * @return Value of member sc_component_id - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API StronglyConnectedComponentId sc_component_id() const; - - /*! - * @brief This function returns a reference to member sc_component_id - * @return Reference to member sc_component_id - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API StronglyConnectedComponentId& sc_component_id(); - /*! - * @brief This function sets a value in member equivalence_hash - * @param _equivalence_hash New value for member equivalence_hash - */ - FASTDDS_EXPORTED_API void equivalence_hash( - EquivalenceHash _equivalence_hash); - - /*! - * @brief This function returns the value of member equivalence_hash - * @return Value of member equivalence_hash - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API const octet* equivalence_hash() const; - - /*! - * @brief This function returns a reference to member equivalence_hash - * @return Reference to member equivalence_hash - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API octet* equivalence_hash(); - /*! - * @brief This function sets a value in member extended_defn - * @param _extended_defn New value for member extended_defn - */ - FASTDDS_EXPORTED_API void extended_defn( - ExtendedTypeDefn _extended_defn); - - /*! - * @brief This function returns the value of member extended_defn - * @return Value of member extended_defn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API const ExtendedTypeDefn& extended_defn() const; - - /*! - * @brief This function returns a reference to member extended_defn - * @return Reference to member extended_defn - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API ExtendedTypeDefn& extended_defn(); - - /** - * Equals - * */ - bool operator ==( - const TypeIdentifier& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const TypeIdentifier& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - - /** - * @brief equivalence_hash_to_string - * @return string representation of the equivalence hash - */ - FASTDDS_EXPORTED_API std::string equivalence_hash_to_string() const; - -private: - - octet m__d; - - StringSTypeDefn m_string_sdefn; - StringLTypeDefn m_string_ldefn; - PlainSequenceSElemDefn m_seq_sdefn; - PlainSequenceLElemDefn m_seq_ldefn; - PlainArraySElemDefn m_array_sdefn; - PlainArrayLElemDefn m_array_ldefn; - PlainMapSTypeDefn m_map_sdefn; - PlainMapLTypeDefn m_map_ldefn; - StronglyConnectedComponentId m_sc_component_id; - EquivalenceHash m_equivalence_hash; - ExtendedTypeDefn m_extended_defn; -}; - -typedef std::vector TypeIdentifierSeq; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // _TYPEIDENTIFIER_H_ diff --git a/include/fastrtps/types/TypeIdentifierTypes.h b/include/fastrtps/types/TypeIdentifierTypes.h deleted file mode 100644 index 376912f7914..00000000000 --- a/include/fastrtps/types/TypeIdentifierTypes.h +++ /dev/null @@ -1,1557 +0,0 @@ -// 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 TypeIdentifierTypes.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool gen. - */ - -#ifndef _TYPEIDENTIFIERTYPES_H_ -#define _TYPEIDENTIFIERTYPES_H_ - -#include -#include -#include -#include - -#include -#include - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - -namespace eprosima { - -namespace fastdds { -namespace dds { -class TypeConsistencyEnforcementQosPolicy; -} // namespace dds -} // namespace fastdds - -namespace fastrtps { -namespace types { - - -// Forward declaration -class TypeIdentifier; -class StringLTypeDefn; - -/*! - * @brief This class represents the structure StringSTypeDefn defined by the user in the IDL file. - * @ingroup TYPES_MODULE - */ -class StringSTypeDefn final -{ -public: - - /*! - * @brief Default constructor. - */ - FASTDDS_EXPORTED_API StringSTypeDefn(); - - /*! - * @brief Default destructor. - */ - FASTDDS_EXPORTED_API ~StringSTypeDefn(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object StringSTypeDefn that will be copied. - */ - FASTDDS_EXPORTED_API StringSTypeDefn( - const StringSTypeDefn& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object StringSTypeDefn that will be copied. - */ - FASTDDS_EXPORTED_API StringSTypeDefn( - StringSTypeDefn&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object StringSTypeDefn that will be copied. - */ - FASTDDS_EXPORTED_API StringSTypeDefn& operator =( - const StringSTypeDefn& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object StringSTypeDefn that will be copied. - */ - FASTDDS_EXPORTED_API StringSTypeDefn& operator =( - StringSTypeDefn&& x); - - /*! - * @brief This function sets a value in member bound - * @param _bound New value for member bound - */ - FASTDDS_EXPORTED_API inline void bound( - SBound _bound) - { - m_bound = _bound; - } - - /*! - * @brief This function returns the value of member bound - * @return Value of member bound - */ - FASTDDS_EXPORTED_API inline SBound bound() const - { - return m_bound; - } - - /*! - * @brief This function returns a reference to member bound - * @return Reference to member bound - */ - FASTDDS_EXPORTED_API inline SBound& bound() - { - return m_bound; - } - - FASTDDS_EXPORTED_API bool consistent( - const StringSTypeDefn& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - - FASTDDS_EXPORTED_API bool consistent( - const StringLTypeDefn& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - SBound m_bound; -}; -/*! - * @brief This class represents the structure StringLTypeDefn defined by the user in the IDL file. - * @ingroup TYPES_MODULE - */ -class StringLTypeDefn final -{ -public: - - /*! - * @brief Default constructor. - */ - FASTDDS_EXPORTED_API StringLTypeDefn(); - - /*! - * @brief Default destructor. - */ - FASTDDS_EXPORTED_API ~StringLTypeDefn(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object StringLTypeDefn that will be copied. - */ - FASTDDS_EXPORTED_API StringLTypeDefn( - const StringLTypeDefn& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object StringLTypeDefn that will be copied. - */ - FASTDDS_EXPORTED_API StringLTypeDefn( - StringLTypeDefn&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object StringLTypeDefn that will be copied. - */ - FASTDDS_EXPORTED_API StringLTypeDefn& operator =( - const StringLTypeDefn& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object StringLTypeDefn that will be copied. - */ - FASTDDS_EXPORTED_API StringLTypeDefn& operator =( - StringLTypeDefn&& x); - - /*! - * @brief This function sets a value in member bound - * @param _bound New value for member bound - */ - FASTDDS_EXPORTED_API inline void bound( - LBound _bound) - { - m_bound = _bound; - } - - /*! - * @brief This function returns the value of member bound - * @return Value of member bound - */ - FASTDDS_EXPORTED_API inline LBound bound() const - { - return m_bound; - } - - /*! - * @brief This function returns a reference to member bound - * @return Reference to member bound - */ - FASTDDS_EXPORTED_API inline LBound& bound() - { - return m_bound; - } - - FASTDDS_EXPORTED_API bool consistent( - const StringLTypeDefn& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - - FASTDDS_EXPORTED_API bool consistent( - const StringSTypeDefn& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - LBound m_bound; -}; -/*! - * @brief This class represents the structure PlainCollectionHeader defined by the user in the IDL file. - * @ingroup TYPES_MODULE - */ -class PlainCollectionHeader final -{ -public: - - /*! - * @brief Default constructor. - */ - FASTDDS_EXPORTED_API PlainCollectionHeader(); - - /*! - * @brief Default destructor. - */ - FASTDDS_EXPORTED_API ~PlainCollectionHeader(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object PlainCollectionHeader that will be copied. - */ - FASTDDS_EXPORTED_API PlainCollectionHeader( - const PlainCollectionHeader& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object PlainCollectionHeader that will be copied. - */ - FASTDDS_EXPORTED_API PlainCollectionHeader( - PlainCollectionHeader&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object PlainCollectionHeader that will be copied. - */ - FASTDDS_EXPORTED_API PlainCollectionHeader& operator =( - const PlainCollectionHeader& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object PlainCollectionHeader that will be copied. - */ - FASTDDS_EXPORTED_API PlainCollectionHeader& operator =( - PlainCollectionHeader&& x); - - /*! - * @brief This function sets a value in member equiv_kind - * @param _equiv_kind New value for member equiv_kind - */ - FASTDDS_EXPORTED_API inline void equiv_kind( - EquivalenceKind _equiv_kind) - { - m_equiv_kind = _equiv_kind; - } - - /*! - * @brief This function returns the value of member equiv_kind - * @return Value of member equiv_kind - */ - FASTDDS_EXPORTED_API inline EquivalenceKind equiv_kind() const - { - return m_equiv_kind; - } - - /*! - * @brief This function returns a reference to member equiv_kind - * @return Reference to member equiv_kind - */ - FASTDDS_EXPORTED_API inline EquivalenceKind& equiv_kind() - { - return m_equiv_kind; - } - - /*! - * @brief This function sets a value in member element_flags - * @param _element_flags New value for member element_flags - */ - FASTDDS_EXPORTED_API inline void element_flags( - CollectionElementFlag _element_flags) - { - m_element_flags = _element_flags; - } - - /*! - * @brief This function returns the value of member element_flags - * @return Value of member element_flags - */ - FASTDDS_EXPORTED_API inline CollectionElementFlag element_flags() const - { - return m_element_flags; - } - - /*! - * @brief This function returns a reference to member element_flags - * @return Reference to member element_flags - */ - FASTDDS_EXPORTED_API inline CollectionElementFlag& element_flags() - { - return m_element_flags; - } - - FASTDDS_EXPORTED_API bool consistent( - const PlainCollectionHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - EquivalenceKind m_equiv_kind; - CollectionElementFlag m_element_flags; -}; -/*! - * @brief This class represents the structure PlainSequenceSElemDefn defined by the user in the IDL file. - * @ingroup TYPES_MODULE - */ -class PlainSequenceSElemDefn final -{ -public: - - /*! - * @brief Default constructor. - */ - FASTDDS_EXPORTED_API PlainSequenceSElemDefn(); - - /*! - * @brief Default destructor. - */ - FASTDDS_EXPORTED_API ~PlainSequenceSElemDefn(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object PlainSequenceSElemDefn that will be copied. - */ - FASTDDS_EXPORTED_API PlainSequenceSElemDefn( - const PlainSequenceSElemDefn& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object PlainSequenceSElemDefn that will be copied. - */ - FASTDDS_EXPORTED_API PlainSequenceSElemDefn( - PlainSequenceSElemDefn&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object PlainSequenceSElemDefn that will be copied. - */ - FASTDDS_EXPORTED_API PlainSequenceSElemDefn& operator =( - const PlainSequenceSElemDefn& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object PlainSequenceSElemDefn that will be copied. - */ - FASTDDS_EXPORTED_API PlainSequenceSElemDefn& operator =( - PlainSequenceSElemDefn&& x); - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - FASTDDS_EXPORTED_API inline void header( - const PlainCollectionHeader& _header) - { - m_header = _header; - } - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - FASTDDS_EXPORTED_API inline void header( - PlainCollectionHeader&& _header) - { - m_header = std::move(_header); - } - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - FASTDDS_EXPORTED_API inline const PlainCollectionHeader& header() const - { - return m_header; - } - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - FASTDDS_EXPORTED_API inline PlainCollectionHeader& header() - { - return m_header; - } - - /*! - * @brief This function sets a value in member bound - * @param _bound New value for member bound - */ - FASTDDS_EXPORTED_API inline void bound( - SBound _bound) - { - m_bound = _bound; - } - - /*! - * @brief This function returns the value of member bound - * @return Value of member bound - */ - FASTDDS_EXPORTED_API inline SBound bound() const - { - return m_bound; - } - - /*! - * @brief This function returns a reference to member bound - * @return Reference to member bound - */ - FASTDDS_EXPORTED_API inline SBound& bound() - { - return m_bound; - } - - /*! - * @brief This function sets a value in member element_identifier - * @param _element_identifier New value for member element_identifier - */ - FASTDDS_EXPORTED_API void element_identifier( - const TypeIdentifier* _element_identifier); - - /*! - * @brief This function returns the value of member element_identifier - * @return Value of member element_identifier - */ - FASTDDS_EXPORTED_API inline const TypeIdentifier* element_identifier() const - { - return m_element_identifier; - } - - /*! - * @brief This function returns a reference to member element_identifier - * @return Reference to member element_identifier - */ - FASTDDS_EXPORTED_API inline TypeIdentifier* element_identifier() - { - return m_element_identifier; - } - - FASTDDS_EXPORTED_API bool consistent( - const PlainSequenceSElemDefn& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - PlainCollectionHeader m_header; - SBound m_bound; - TypeIdentifier* m_element_identifier; -}; -/*! - * @brief This class represents the structure PlainSequenceLElemDefn defined by the user in the IDL file. - * @ingroup TYPES_MODULE - */ -class PlainSequenceLElemDefn final -{ -public: - - /*! - * @brief Default constructor. - */ - FASTDDS_EXPORTED_API PlainSequenceLElemDefn(); - - /*! - * @brief Default destructor. - */ - FASTDDS_EXPORTED_API ~PlainSequenceLElemDefn(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object PlainSequenceLElemDefn that will be copied. - */ - FASTDDS_EXPORTED_API PlainSequenceLElemDefn( - const PlainSequenceLElemDefn& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object PlainSequenceLElemDefn that will be copied. - */ - FASTDDS_EXPORTED_API PlainSequenceLElemDefn( - PlainSequenceLElemDefn&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object PlainSequenceLElemDefn that will be copied. - */ - FASTDDS_EXPORTED_API PlainSequenceLElemDefn& operator =( - const PlainSequenceLElemDefn& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object PlainSequenceLElemDefn that will be copied. - */ - FASTDDS_EXPORTED_API PlainSequenceLElemDefn& operator =( - PlainSequenceLElemDefn&& x); - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - FASTDDS_EXPORTED_API inline void header( - const PlainCollectionHeader& _header) - { - m_header = _header; - } - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - FASTDDS_EXPORTED_API inline void header( - PlainCollectionHeader&& _header) - { - m_header = std::move(_header); - } - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - FASTDDS_EXPORTED_API inline const PlainCollectionHeader& header() const - { - return m_header; - } - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - FASTDDS_EXPORTED_API inline PlainCollectionHeader& header() - { - return m_header; - } - - /*! - * @brief This function sets a value in member bound - * @param _bound New value for member bound - */ - FASTDDS_EXPORTED_API inline void bound( - LBound _bound) - { - m_bound = _bound; - } - - /*! - * @brief This function returns the value of member bound - * @return Value of member bound - */ - FASTDDS_EXPORTED_API inline LBound bound() const - { - return m_bound; - } - - /*! - * @brief This function returns a reference to member bound - * @return Reference to member bound - */ - FASTDDS_EXPORTED_API inline LBound& bound() - { - return m_bound; - } - - /*! - * @brief This function sets a value in member element_identifier - * @param _element_identifier New value for member element_identifier - */ - FASTDDS_EXPORTED_API void element_identifier( - const TypeIdentifier* _element_identifier); - - /*! - * @brief This function returns the value of member element_identifier - * @return Value of member element_identifier - */ - FASTDDS_EXPORTED_API inline const TypeIdentifier* element_identifier() const - { - return m_element_identifier; - } - - /*! - * @brief This function returns a reference to member element_identifier - * @return Reference to member element_identifier - */ - FASTDDS_EXPORTED_API inline TypeIdentifier* element_identifier() - { - return m_element_identifier; - } - - FASTDDS_EXPORTED_API bool consistent( - const PlainSequenceLElemDefn& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - PlainCollectionHeader m_header; - LBound m_bound; - TypeIdentifier* m_element_identifier; -}; -/*! - * @brief This class represents the structure PlainArraySElemDefn defined by the user in the IDL file. - * @ingroup TYPES_MODULE - */ -class PlainArraySElemDefn final -{ -public: - - /*! - * @brief Default constructor. - */ - FASTDDS_EXPORTED_API PlainArraySElemDefn(); - - /*! - * @brief Default destructor. - */ - FASTDDS_EXPORTED_API ~PlainArraySElemDefn(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object PlainArraySElemDefn that will be copied. - */ - FASTDDS_EXPORTED_API PlainArraySElemDefn( - const PlainArraySElemDefn& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object PlainArraySElemDefn that will be copied. - */ - FASTDDS_EXPORTED_API PlainArraySElemDefn( - PlainArraySElemDefn&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object PlainArraySElemDefn that will be copied. - */ - FASTDDS_EXPORTED_API PlainArraySElemDefn& operator =( - const PlainArraySElemDefn& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object PlainArraySElemDefn that will be copied. - */ - FASTDDS_EXPORTED_API PlainArraySElemDefn& operator =( - PlainArraySElemDefn&& x); - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - FASTDDS_EXPORTED_API inline void header( - const PlainCollectionHeader& _header) - { - m_header = _header; - } - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - FASTDDS_EXPORTED_API inline void header( - PlainCollectionHeader&& _header) - { - m_header = std::move(_header); - } - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - FASTDDS_EXPORTED_API inline const PlainCollectionHeader& header() const - { - return m_header; - } - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - FASTDDS_EXPORTED_API inline PlainCollectionHeader& header() - { - return m_header; - } - - /*! - * @brief This function copies the value in member array_bound_seq - * @param _array_bound_seq New value to be copied in member array_bound_seq - */ - FASTDDS_EXPORTED_API inline void array_bound_seq( - const SBoundSeq& _array_bound_seq) - { - m_array_bound_seq = _array_bound_seq; - } - - /*! - * @brief This function moves the value in member array_bound_seq - * @param _array_bound_seq New value to be moved in member array_bound_seq - */ - FASTDDS_EXPORTED_API inline void array_bound_seq( - SBoundSeq&& _array_bound_seq) - { - m_array_bound_seq = std::move(_array_bound_seq); - } - - /*! - * @brief This function returns a constant reference to member array_bound_seq - * @return Constant reference to member array_bound_seq - */ - FASTDDS_EXPORTED_API inline const SBoundSeq& array_bound_seq() const - { - return m_array_bound_seq; - } - - /*! - * @brief This function returns a reference to member array_bound_seq - * @return Reference to member array_bound_seq - */ - FASTDDS_EXPORTED_API inline SBoundSeq& array_bound_seq() - { - return m_array_bound_seq; - } - - /*! - * @brief This function sets a value in member element_identifier - * @param _element_identifier New value for member element_identifier - */ - FASTDDS_EXPORTED_API void element_identifier( - const TypeIdentifier* _element_identifier); - - /*! - * @brief This function returns the value of member element_identifier - * @return Value of member element_identifier - */ - FASTDDS_EXPORTED_API inline const TypeIdentifier* element_identifier() const - { - return m_element_identifier; - } - - /*! - * @brief This function returns a reference to member element_identifier - * @return Reference to member element_identifier - */ - FASTDDS_EXPORTED_API inline TypeIdentifier* element_identifier() - { - return m_element_identifier; - } - - FASTDDS_EXPORTED_API bool consistent( - const PlainArraySElemDefn& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - PlainCollectionHeader m_header; - SBoundSeq m_array_bound_seq; - TypeIdentifier* m_element_identifier; -}; -/*! - * @brief This class represents the structure PlainArrayLElemDefn defined by the user in the IDL file. - * @ingroup TYPES_MODULE - */ -class PlainArrayLElemDefn final -{ -public: - - /*! - * @brief Default constructor. - */ - FASTDDS_EXPORTED_API PlainArrayLElemDefn(); - - /*! - * @brief Default destructor. - */ - FASTDDS_EXPORTED_API ~PlainArrayLElemDefn(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object PlainArrayLElemDefn that will be copied. - */ - FASTDDS_EXPORTED_API PlainArrayLElemDefn( - const PlainArrayLElemDefn& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object PlainArrayLElemDefn that will be copied. - */ - FASTDDS_EXPORTED_API PlainArrayLElemDefn( - PlainArrayLElemDefn&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object PlainArrayLElemDefn that will be copied. - */ - FASTDDS_EXPORTED_API PlainArrayLElemDefn& operator =( - const PlainArrayLElemDefn& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object PlainArrayLElemDefn that will be copied. - */ - FASTDDS_EXPORTED_API PlainArrayLElemDefn& operator =( - PlainArrayLElemDefn&& x); - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - FASTDDS_EXPORTED_API inline void header( - const PlainCollectionHeader& _header) - { - m_header = _header; - } - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - FASTDDS_EXPORTED_API inline void header( - PlainCollectionHeader&& _header) - { - m_header = std::move(_header); - } - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - FASTDDS_EXPORTED_API inline const PlainCollectionHeader& header() const - { - return m_header; - } - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - FASTDDS_EXPORTED_API inline PlainCollectionHeader& header() - { - return m_header; - } - - /*! - * @brief This function copies the value in member array_bound_seq - * @param _array_bound_seq New value to be copied in member array_bound_seq - */ - FASTDDS_EXPORTED_API inline void array_bound_seq( - const LBoundSeq& _array_bound_seq) - { - m_array_bound_seq = _array_bound_seq; - } - - /*! - * @brief This function moves the value in member array_bound_seq - * @param _array_bound_seq New value to be moved in member array_bound_seq - */ - FASTDDS_EXPORTED_API inline void array_bound_seq( - LBoundSeq&& _array_bound_seq) - { - m_array_bound_seq = std::move(_array_bound_seq); - } - - /*! - * @brief This function returns a constant reference to member array_bound_seq - * @return Constant reference to member array_bound_seq - */ - FASTDDS_EXPORTED_API inline const LBoundSeq& array_bound_seq() const - { - return m_array_bound_seq; - } - - /*! - * @brief This function returns a reference to member array_bound_seq - * @return Reference to member array_bound_seq - */ - FASTDDS_EXPORTED_API inline LBoundSeq& array_bound_seq() - { - return m_array_bound_seq; - } - - /*! - * @brief This function sets a value in member element_identifier - * @param _element_identifier New value for member element_identifier - */ - FASTDDS_EXPORTED_API void element_identifier( - const TypeIdentifier* _element_identifier); - - /*! - * @brief This function returns the value of member element_identifier - * @return Value of member element_identifier - */ - FASTDDS_EXPORTED_API inline const TypeIdentifier* element_identifier() const - { - return m_element_identifier; - } - - /*! - * @brief This function returns a reference to member element_identifier - * @return Reference to member element_identifier - */ - FASTDDS_EXPORTED_API inline TypeIdentifier* element_identifier() - { - return m_element_identifier; - } - - FASTDDS_EXPORTED_API bool consistent( - const PlainArrayLElemDefn& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - PlainCollectionHeader m_header; - LBoundSeq m_array_bound_seq; - TypeIdentifier* m_element_identifier; -}; -/*! - * @brief This class represents the structure PlainMapSTypeDefn defined by the user in the IDL file. - * @ingroup TYPES_MODULE - */ -class PlainMapSTypeDefn final -{ -public: - - /*! - * @brief Default constructor. - */ - FASTDDS_EXPORTED_API PlainMapSTypeDefn(); - - /*! - * @brief Default destructor. - */ - FASTDDS_EXPORTED_API ~PlainMapSTypeDefn(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object PlainMapSTypeDefn that will be copied. - */ - FASTDDS_EXPORTED_API PlainMapSTypeDefn( - const PlainMapSTypeDefn& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object PlainMapSTypeDefn that will be copied. - */ - FASTDDS_EXPORTED_API PlainMapSTypeDefn( - PlainMapSTypeDefn&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object PlainMapSTypeDefn that will be copied. - */ - FASTDDS_EXPORTED_API PlainMapSTypeDefn& operator =( - const PlainMapSTypeDefn& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object PlainMapSTypeDefn that will be copied. - */ - FASTDDS_EXPORTED_API PlainMapSTypeDefn& operator =( - PlainMapSTypeDefn&& x); - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - FASTDDS_EXPORTED_API inline void header( - const PlainCollectionHeader& _header) - { - m_header = _header; - } - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - FASTDDS_EXPORTED_API inline void header( - PlainCollectionHeader&& _header) - { - m_header = std::move(_header); - } - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - FASTDDS_EXPORTED_API inline const PlainCollectionHeader& header() const - { - return m_header; - } - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - FASTDDS_EXPORTED_API inline PlainCollectionHeader& header() - { - return m_header; - } - - /*! - * @brief This function sets a value in member bound - * @param _bound New value for member bound - */ - FASTDDS_EXPORTED_API inline void bound( - SBound _bound) - { - m_bound = _bound; - } - - /*! - * @brief This function returns the value of member bound - * @return Value of member bound - */ - FASTDDS_EXPORTED_API inline SBound bound() const - { - return m_bound; - } - - /*! - * @brief This function returns a reference to member bound - * @return Reference to member bound - */ - FASTDDS_EXPORTED_API inline SBound& bound() - { - return m_bound; - } - - /*! - * @brief This function sets a value in member element_identifier - * @param _element_identifier New value for member element_identifier - */ - FASTDDS_EXPORTED_API void element_identifier( - const TypeIdentifier* _element_identifier); - - /*! - * @brief This function returns the value of member element_identifier - * @return Value of member element_identifier - */ - FASTDDS_EXPORTED_API inline const TypeIdentifier* element_identifier() const - { - return m_element_identifier; - } - - /*! - * @brief This function returns a reference to member element_identifier - * @return Reference to member element_identifier - */ - FASTDDS_EXPORTED_API inline TypeIdentifier* element_identifier() - { - return m_element_identifier; - } - - /*! - * @brief This function sets a value in member key_flags - * @param _key_flags New value for member key_flags - */ - FASTDDS_EXPORTED_API inline void key_flags( - CollectionElementFlag _key_flags) - { - m_key_flags = _key_flags; - } - - /*! - * @brief This function returns the value of member key_flags - * @return Value of member key_flags - */ - FASTDDS_EXPORTED_API inline CollectionElementFlag key_flags() const - { - return m_key_flags; - } - - /*! - * @brief This function returns a reference to member key_flags - * @return Reference to member key_flags - */ - FASTDDS_EXPORTED_API inline CollectionElementFlag& key_flags() - { - return m_key_flags; - } - - /*! - * @brief This function sets a value in member key_identifier - * @param _key_identifier New value for member key_identifier - */ - FASTDDS_EXPORTED_API void key_identifier( - const TypeIdentifier* _key_identifier); - - /*! - * @brief This function returns the value of member key_identifier - * @return Value of member key_identifier - */ - FASTDDS_EXPORTED_API inline const TypeIdentifier* key_identifier() const - { - return m_key_identifier; - } - - /*! - * @brief This function returns a reference to member key_identifier - * @return Reference to member key_identifier - */ - FASTDDS_EXPORTED_API inline TypeIdentifier* key_identifier() - { - return m_key_identifier; - } - - FASTDDS_EXPORTED_API bool consistent( - const PlainMapSTypeDefn& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - PlainCollectionHeader m_header; - SBound m_bound; - TypeIdentifier* m_element_identifier; - CollectionElementFlag m_key_flags; - TypeIdentifier* m_key_identifier; -}; -/*! - * @brief This class represents the structure PlainMapLTypeDefn defined by the user in the IDL file. - * @ingroup TYPES_MODULE - */ -class PlainMapLTypeDefn final -{ -public: - - /*! - * @brief Default constructor. - */ - FASTDDS_EXPORTED_API PlainMapLTypeDefn(); - - /*! - * @brief Default destructor. - */ - FASTDDS_EXPORTED_API ~PlainMapLTypeDefn(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object PlainMapLTypeDefn that will be copied. - */ - FASTDDS_EXPORTED_API PlainMapLTypeDefn( - const PlainMapLTypeDefn& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object PlainMapLTypeDefn that will be copied. - */ - FASTDDS_EXPORTED_API PlainMapLTypeDefn( - PlainMapLTypeDefn&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object PlainMapLTypeDefn that will be copied. - */ - FASTDDS_EXPORTED_API PlainMapLTypeDefn& operator =( - const PlainMapLTypeDefn& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object PlainMapLTypeDefn that will be copied. - */ - FASTDDS_EXPORTED_API PlainMapLTypeDefn& operator =( - PlainMapLTypeDefn&& x); - - /*! - * @brief This function copies the value in member header - * @param _header New value to be copied in member header - */ - FASTDDS_EXPORTED_API inline void header( - const PlainCollectionHeader& _header) - { - m_header = _header; - } - - /*! - * @brief This function moves the value in member header - * @param _header New value to be moved in member header - */ - FASTDDS_EXPORTED_API inline void header( - PlainCollectionHeader&& _header) - { - m_header = std::move(_header); - } - - /*! - * @brief This function returns a constant reference to member header - * @return Constant reference to member header - */ - FASTDDS_EXPORTED_API inline const PlainCollectionHeader& header() const - { - return m_header; - } - - /*! - * @brief This function returns a reference to member header - * @return Reference to member header - */ - FASTDDS_EXPORTED_API inline PlainCollectionHeader& header() - { - return m_header; - } - - /*! - * @brief This function sets a value in member bound - * @param _bound New value for member bound - */ - FASTDDS_EXPORTED_API inline void bound( - LBound _bound) - { - m_bound = _bound; - } - - /*! - * @brief This function returns the value of member bound - * @return Value of member bound - */ - FASTDDS_EXPORTED_API inline LBound bound() const - { - return m_bound; - } - - /*! - * @brief This function returns a reference to member bound - * @return Reference to member bound - */ - FASTDDS_EXPORTED_API inline LBound& bound() - { - return m_bound; - } - - /*! - * @brief This function sets a value in member element_identifier - * @param _element_identifier New value for member element_identifier - */ - FASTDDS_EXPORTED_API void element_identifier( - const TypeIdentifier* _element_identifier); - - /*! - * @brief This function returns the value of member element_identifier - * @return Value of member element_identifier - */ - FASTDDS_EXPORTED_API inline const TypeIdentifier* element_identifier() const - { - return m_element_identifier; - } - - /*! - * @brief This function returns a reference to member element_identifier - * @return Reference to member element_identifier - */ - FASTDDS_EXPORTED_API inline TypeIdentifier* element_identifier() - { - return m_element_identifier; - } - - /*! - * @brief This function sets a value in member key_flags - * @param _key_flags New value for member key_flags - */ - FASTDDS_EXPORTED_API inline void key_flags( - CollectionElementFlag _key_flags) - { - m_key_flags = _key_flags; - } - - /*! - * @brief This function returns the value of member key_flags - * @return Value of member key_flags - */ - FASTDDS_EXPORTED_API inline CollectionElementFlag key_flags() const - { - return m_key_flags; - } - - /*! - * @brief This function returns a reference to member key_flags - * @return Reference to member key_flags - */ - FASTDDS_EXPORTED_API inline CollectionElementFlag& key_flags() - { - return m_key_flags; - } - - /*! - * @brief This function sets a value in member key_identifier - * @param _key_identifier New value for member key_identifier - */ - FASTDDS_EXPORTED_API void key_identifier( - const TypeIdentifier* _key_identifier); - - /*! - * @brief This function returns the value of member key_identifier - * @return Value of member key_identifier - */ - FASTDDS_EXPORTED_API inline const TypeIdentifier* key_identifier() const - { - return m_key_identifier; - } - - /*! - * @brief This function returns a reference to member key_identifier - * @return Reference to member key_identifier - */ - FASTDDS_EXPORTED_API inline TypeIdentifier* key_identifier() - { - return m_key_identifier; - } - - FASTDDS_EXPORTED_API bool consistent( - const PlainMapLTypeDefn& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - PlainCollectionHeader m_header; - LBound m_bound; - TypeIdentifier* m_element_identifier; - CollectionElementFlag m_key_flags; - TypeIdentifier* m_key_identifier; -}; -/*! - * @brief This class represents the structure StronglyConnectedComponentId defined by the user in the IDL file. - * @ingroup TYPES_MODULE - */ -class StronglyConnectedComponentId final -{ -public: - - /*! - * @brief Default constructor. - */ - FASTDDS_EXPORTED_API StronglyConnectedComponentId(); - - /*! - * @brief Default destructor. - */ - FASTDDS_EXPORTED_API ~StronglyConnectedComponentId(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object StronglyConnectedComponentId that will be copied. - */ - FASTDDS_EXPORTED_API StronglyConnectedComponentId( - const StronglyConnectedComponentId& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object StronglyConnectedComponentId that will be copied. - */ - FASTDDS_EXPORTED_API StronglyConnectedComponentId( - StronglyConnectedComponentId&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object StronglyConnectedComponentId that will be copied. - */ - FASTDDS_EXPORTED_API StronglyConnectedComponentId& operator =( - const StronglyConnectedComponentId& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object StronglyConnectedComponentId that will be copied. - */ - FASTDDS_EXPORTED_API StronglyConnectedComponentId& operator =( - StronglyConnectedComponentId&& x); - - /*! - * @brief This function copies the value in member sc_component_id - * @param _sc_component_id New value to be copied in member sc_component_id - */ - FASTDDS_EXPORTED_API inline void sc_component_id( - const TypeObjectHashId& _sc_component_id) - { - m_sc_component_id = _sc_component_id; - } - - /*! - * @brief This function moves the value in member sc_component_id - * @param _sc_component_id New value to be moved in member sc_component_id - */ - FASTDDS_EXPORTED_API inline void sc_component_id( - TypeObjectHashId&& _sc_component_id) - { - m_sc_component_id = std::move(_sc_component_id); - } - - /*! - * @brief This function returns a constant reference to member sc_component_id - * @return Constant reference to member sc_component_id - */ - FASTDDS_EXPORTED_API inline const TypeObjectHashId& sc_component_id() const - { - return m_sc_component_id; - } - - /*! - * @brief This function returns a reference to member sc_component_id - * @return Reference to member sc_component_id - */ - FASTDDS_EXPORTED_API inline TypeObjectHashId& sc_component_id() - { - return m_sc_component_id; - } - - /*! - * @brief This function sets a value in member scc_length - * @param _scc_length New value for member scc_length - */ - FASTDDS_EXPORTED_API inline void scc_length( - int32_t _scc_length) - { - m_scc_length = _scc_length; - } - - /*! - * @brief This function returns the value of member scc_length - * @return Value of member scc_length - */ - FASTDDS_EXPORTED_API inline int32_t scc_length() const - { - return m_scc_length; - } - - /*! - * @brief This function returns a reference to member scc_length - * @return Reference to member scc_length - */ - FASTDDS_EXPORTED_API inline int32_t& scc_length() - { - return m_scc_length; - } - - /*! - * @brief This function sets a value in member scc_index - * @param _scc_index New value for member scc_index - */ - FASTDDS_EXPORTED_API inline void scc_index( - int32_t _scc_index) - { - m_scc_index = _scc_index; - } - - /*! - * @brief This function returns the value of member scc_index - * @return Value of member scc_index - */ - FASTDDS_EXPORTED_API inline int32_t scc_index() const - { - return m_scc_index; - } - - /*! - * @brief This function returns a reference to member scc_index - * @return Reference to member scc_index - */ - FASTDDS_EXPORTED_API inline int32_t& scc_index() - { - return m_scc_index; - } - - FASTDDS_EXPORTED_API bool consistent( - const StronglyConnectedComponentId& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - TypeObjectHashId m_sc_component_id; - int32_t m_scc_length; - int32_t m_scc_index; -}; -/*! - * @brief This class represents the structure ExtendedTypeDefn defined by the user in the IDL file. - * @ingroup TYPES_MODULE - */ -class ExtendedTypeDefn final -{ -public: - - /*! - * @brief Default constructor. - */ - FASTDDS_EXPORTED_API ExtendedTypeDefn(); - - /*! - * @brief Default destructor. - */ - FASTDDS_EXPORTED_API virtual ~ExtendedTypeDefn(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ExtendedTypeDefn that will be copied. - */ - FASTDDS_EXPORTED_API ExtendedTypeDefn( - const ExtendedTypeDefn& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ExtendedTypeDefn that will be copied. - */ - FASTDDS_EXPORTED_API ExtendedTypeDefn( - ExtendedTypeDefn&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object ExtendedTypeDefn that will be copied. - */ - FASTDDS_EXPORTED_API virtual ExtendedTypeDefn& operator =( - const ExtendedTypeDefn& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ExtendedTypeDefn that will be copied. - */ - FASTDDS_EXPORTED_API virtual ExtendedTypeDefn& operator =( - ExtendedTypeDefn&& x); - - FASTDDS_EXPORTED_API bool consistent( - const ExtendedTypeDefn& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - - -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // _TYPEIDENTIFIERTYPES_H_ diff --git a/include/fastrtps/types/TypeNamesGenerator.h b/include/fastrtps/types/TypeNamesGenerator.h deleted file mode 100644 index c81f90c9176..00000000000 --- a/include/fastrtps/types/TypeNamesGenerator.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef _TYPE_NAMES_GENERATOR_ -#define _TYPE_NAMES_GENERATOR_ - -#include - -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -class TypeNamesGenerator -{ -public: - - FASTDDS_EXPORTED_API static std::string get_string_type_name( - uint32_t bound, - bool wide, - bool generate_identifier = true); - - FASTDDS_EXPORTED_API static std::string get_sequence_type_name( - const std::string& type_name, - uint32_t bound, - bool generate_identifier = true); - - FASTDDS_EXPORTED_API static std::string get_array_type_name( - const std::string& type_name, - const std::vector& bound, - bool generate_identifier = true); - - FASTDDS_EXPORTED_API static std::string get_array_type_name( - const std::string& type_name, - const std::vector& bound, - uint32_t& ret_size, - bool generate_identifier = true); - - FASTDDS_EXPORTED_API static std::string get_map_type_name( - const std::string& key_type_name, - const std::string& value_type_name, - uint32_t bound, - bool generate_identifier = true); -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif //_TYPE_NAMES_GENERATOR_ diff --git a/include/fastrtps/types/TypeObject.h b/include/fastrtps/types/TypeObject.h deleted file mode 100644 index 657324fa4f4..00000000000 --- a/include/fastrtps/types/TypeObject.h +++ /dev/null @@ -1,6730 +0,0 @@ -// Copyright 2018 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. - -#ifndef TYPES_TYPE_OBJECT_H -#define TYPES_TYPE_OBJECT_H - -#include -#include - -#include -#include -#include -#include - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - -// The types in this file shall be serialized with XCDR encoding version 2 -namespace eprosima { -namespace fastrtps { - -namespace types { - -/*struct CommonStructMember final { - MemberId member_id; - StructMemberFlag member_flags; - TypeIdentifier member_type_id; - };*/ -class CommonStructMember -{ -public: - - FASTDDS_EXPORTED_API CommonStructMember(); - FASTDDS_EXPORTED_API ~CommonStructMember(); - FASTDDS_EXPORTED_API CommonStructMember( - const CommonStructMember& x); - FASTDDS_EXPORTED_API CommonStructMember( - CommonStructMember&& x); - FASTDDS_EXPORTED_API CommonStructMember& operator =( - const CommonStructMember& x); - FASTDDS_EXPORTED_API CommonStructMember& operator =( - CommonStructMember&& x); - - FASTDDS_EXPORTED_API inline void member_id( - const MemberId& _member_id) - { - m_member_id = _member_id; - } - - FASTDDS_EXPORTED_API inline void member_id( - MemberId&& _member_id) - { - m_member_id = std::move(_member_id); - } - - FASTDDS_EXPORTED_API inline const MemberId& member_id() const - { - return m_member_id; - } - - FASTDDS_EXPORTED_API inline MemberId& member_id() - { - return m_member_id; - } - - FASTDDS_EXPORTED_API inline void member_flags( - const StructMemberFlag& _member_flags) - { - m_member_flags = _member_flags; - } - - FASTDDS_EXPORTED_API inline void member_flags( - StructMemberFlag&& _member_flags) - { - m_member_flags = std::move(_member_flags); - } - - FASTDDS_EXPORTED_API inline const StructMemberFlag& member_flags() const - { - return m_member_flags; - } - - FASTDDS_EXPORTED_API inline StructMemberFlag& member_flags() - { - return m_member_flags; - } - - FASTDDS_EXPORTED_API inline void member_type_id( - const TypeIdentifier& _member_type_id) - { - m_member_type_id = _member_type_id; - } - - FASTDDS_EXPORTED_API inline void member_type_id( - TypeIdentifier&& _member_type_id) - { - m_member_type_id = std::move(_member_type_id); - } - - FASTDDS_EXPORTED_API inline const TypeIdentifier& member_type_id() const - { - return m_member_type_id; - } - - FASTDDS_EXPORTED_API inline TypeIdentifier& member_type_id() - { - return m_member_type_id; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CommonStructMember& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CommonStructMember& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - MemberId m_member_id; - StructMemberFlag m_member_flags; - TypeIdentifier m_member_type_id; -}; - -// COMPLETE Details for a member of an aggregate type -/*struct CompleteMemberDetail final{ - MemberName name; - AppliedBuiltinMemberAnnotations ann_builtin; // Optional - AppliedAnnotationSeq ann_custom; // Optional - };*/ -class CompleteMemberDetail -{ -public: - - FASTDDS_EXPORTED_API CompleteMemberDetail(); - FASTDDS_EXPORTED_API ~CompleteMemberDetail(); - FASTDDS_EXPORTED_API CompleteMemberDetail( - const CompleteMemberDetail& x); - FASTDDS_EXPORTED_API CompleteMemberDetail( - CompleteMemberDetail&& x); - FASTDDS_EXPORTED_API CompleteMemberDetail& operator =( - const CompleteMemberDetail& x); - FASTDDS_EXPORTED_API CompleteMemberDetail& operator =( - CompleteMemberDetail&& x); - - FASTDDS_EXPORTED_API inline void name( - const MemberName& _name) - { - m_name = _name; - } - - FASTDDS_EXPORTED_API inline void name( - MemberName&& _name) - { - m_name = std::move(_name); - } - - FASTDDS_EXPORTED_API inline const MemberName& name() const - { - return m_name; - } - - FASTDDS_EXPORTED_API inline MemberName& name() - { - return m_name; - } - - FASTDDS_EXPORTED_API inline void ann_builtin( - const AppliedBuiltinMemberAnnotations& _ann_builtin) - { - m_ann_builtin = _ann_builtin; - } - - FASTDDS_EXPORTED_API inline void ann_builtin( - AppliedBuiltinMemberAnnotations&& _ann_builtin) - { - m_ann_builtin = std::move(_ann_builtin); - } - - FASTDDS_EXPORTED_API inline const AppliedBuiltinMemberAnnotations& ann_builtin() const - { - return m_ann_builtin; - } - - FASTDDS_EXPORTED_API inline AppliedBuiltinMemberAnnotations& ann_builtin() - { - return m_ann_builtin; - } - - FASTDDS_EXPORTED_API inline void ann_custom( - const AppliedAnnotationSeq& _ann_custom) - { - m_ann_custom = _ann_custom; - } - - FASTDDS_EXPORTED_API inline void ann_custom( - AppliedAnnotationSeq&& _ann_custom) - { - m_ann_custom = std::move(_ann_custom); - } - - FASTDDS_EXPORTED_API inline const AppliedAnnotationSeq& ann_custom() const - { - return m_ann_custom; - } - - FASTDDS_EXPORTED_API inline AppliedAnnotationSeq& ann_custom() - { - return m_ann_custom; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteMemberDetail& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CompleteMemberDetail& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - MemberName m_name; - AppliedBuiltinMemberAnnotations m_ann_builtin; - AppliedAnnotationSeq m_ann_custom; -}; - -// MINIMAL Details for a member of an aggregate type -/*struct MinimalMemberDetail final{ - NameHash name_hash; - };*/ - -class MinimalMemberDetail final -{ -public: - - FASTDDS_EXPORTED_API MinimalMemberDetail(); - FASTDDS_EXPORTED_API ~MinimalMemberDetail(); - FASTDDS_EXPORTED_API MinimalMemberDetail( - const MinimalMemberDetail& x); - FASTDDS_EXPORTED_API MinimalMemberDetail( - MinimalMemberDetail&& x); - FASTDDS_EXPORTED_API MinimalMemberDetail& operator =( - const MinimalMemberDetail& x); - FASTDDS_EXPORTED_API MinimalMemberDetail& operator =( - MinimalMemberDetail&& x); - - FASTDDS_EXPORTED_API inline void name_hash( - const NameHash& _name_hash) - { - m_name_hash = _name_hash; - } - - FASTDDS_EXPORTED_API inline void name_hash( - NameHash&& _name_hash) - { - m_name_hash = std::move(_name_hash); - } - - FASTDDS_EXPORTED_API inline const NameHash& name_hash() const - { - return m_name_hash; - } - - FASTDDS_EXPORTED_API inline NameHash& name_hash() - { - return m_name_hash; - } - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalMemberDetail& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const MinimalMemberDetail& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - NameHash m_name_hash; -}; - -// Member of an aggregate type -/*struct CompleteStructMember { - CommonStructMember common; - CompleteMemberDetail detail; - };*/ -class CompleteStructMember -{ -public: - - FASTDDS_EXPORTED_API CompleteStructMember(); - FASTDDS_EXPORTED_API ~CompleteStructMember(); - FASTDDS_EXPORTED_API CompleteStructMember( - const CompleteStructMember& x); - FASTDDS_EXPORTED_API CompleteStructMember( - CompleteStructMember&& x); - FASTDDS_EXPORTED_API CompleteStructMember& operator =( - const CompleteStructMember& x); - FASTDDS_EXPORTED_API CompleteStructMember& operator =( - CompleteStructMember&& x); - - FASTDDS_EXPORTED_API inline void common( - const CommonStructMember& _common) - { - m_common = _common; - } - - FASTDDS_EXPORTED_API inline void common( - CommonStructMember&& _common) - { - m_common = std::move(_common); - } - - FASTDDS_EXPORTED_API inline const CommonStructMember& common() const - { - return m_common; - } - - FASTDDS_EXPORTED_API inline CommonStructMember& common() - { - return m_common; - } - - FASTDDS_EXPORTED_API inline void detail( - const CompleteMemberDetail& _detail) - { - m_detail = _detail; - } - - FASTDDS_EXPORTED_API inline void detail( - CompleteMemberDetail&& _detail) - { - m_detail = std::move(_detail); - } - - FASTDDS_EXPORTED_API inline const CompleteMemberDetail& detail() const - { - return m_detail; - } - - FASTDDS_EXPORTED_API inline CompleteMemberDetail& detail() - { - return m_detail; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteStructMember& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CompleteStructMember& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonStructMember m_common; - CompleteMemberDetail m_detail; -}; - -// Ordered by the member_index -typedef std::vector CompleteStructMemberSeq; - -// Member of an aggregate type -/*struct MinimalStructMember { - CommonStructMember common; - MinimalMemberDetail detail; - };*/ -class MinimalStructMember -{ -public: - - FASTDDS_EXPORTED_API MinimalStructMember(); - FASTDDS_EXPORTED_API ~MinimalStructMember(); - FASTDDS_EXPORTED_API MinimalStructMember( - const MinimalStructMember& x); - FASTDDS_EXPORTED_API MinimalStructMember( - MinimalStructMember&& x); - FASTDDS_EXPORTED_API MinimalStructMember& operator =( - const MinimalStructMember& x); - FASTDDS_EXPORTED_API MinimalStructMember& operator =( - MinimalStructMember&& x); - - FASTDDS_EXPORTED_API inline void common( - const CommonStructMember& _common) - { - m_common = _common; - } - - FASTDDS_EXPORTED_API inline void common( - CommonStructMember&& _common) - { - m_common = std::move(_common); - } - - FASTDDS_EXPORTED_API inline const CommonStructMember& common() const - { - return m_common; - } - - FASTDDS_EXPORTED_API inline CommonStructMember& common() - { - return m_common; - } - - FASTDDS_EXPORTED_API inline void detail( - const MinimalMemberDetail& _detail) - { - m_detail = _detail; - } - - FASTDDS_EXPORTED_API inline void detail( - MinimalMemberDetail&& _detail) - { - m_detail = std::move(_detail); - } - - FASTDDS_EXPORTED_API inline const MinimalMemberDetail& detail() const - { - return m_detail; - } - - FASTDDS_EXPORTED_API inline MinimalMemberDetail& detail() - { - return m_detail; - } - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalStructMember& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const MinimalStructMember& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonStructMember m_common; - MinimalMemberDetail m_detail; -}; - -// Ordered by common.member_id -typedef std::vector MinimalStructMemberSeq; - -/*struct AppliedBuiltinTypeAnnotations { - AppliedVerbatimAnnotation verbatim; // verbatim(...) // optional - };*/ -class AppliedBuiltinTypeAnnotations -{ -public: - - FASTDDS_EXPORTED_API AppliedBuiltinTypeAnnotations(); - FASTDDS_EXPORTED_API ~AppliedBuiltinTypeAnnotations(); - FASTDDS_EXPORTED_API AppliedBuiltinTypeAnnotations( - const AppliedBuiltinTypeAnnotations& x); - FASTDDS_EXPORTED_API AppliedBuiltinTypeAnnotations( - AppliedBuiltinTypeAnnotations&& x); - FASTDDS_EXPORTED_API AppliedBuiltinTypeAnnotations& operator =( - const AppliedBuiltinTypeAnnotations& x); - FASTDDS_EXPORTED_API AppliedBuiltinTypeAnnotations& operator =( - AppliedBuiltinTypeAnnotations&& x); - - FASTDDS_EXPORTED_API inline void verbatim( - const AppliedVerbatimAnnotation& _verbatim) - { - m_verbatim = _verbatim; - } - - FASTDDS_EXPORTED_API inline void verbatim( - AppliedVerbatimAnnotation&& _verbatim) - { - m_verbatim = std::move(_verbatim); - } - - FASTDDS_EXPORTED_API inline const AppliedVerbatimAnnotation& verbatim() const - { - return m_verbatim; - } - - FASTDDS_EXPORTED_API inline AppliedVerbatimAnnotation& verbatim() - { - return m_verbatim; - } - - FASTDDS_EXPORTED_API bool operator ==( - const AppliedBuiltinTypeAnnotations& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const AppliedBuiltinTypeAnnotations& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - AppliedVerbatimAnnotation m_verbatim; -}; - -/*struct MinimalTypeDetail final{ - // Empty. Available for future extension - };*/ -class MinimalTypeDetail -{ -public: - - FASTDDS_EXPORTED_API MinimalTypeDetail(); - FASTDDS_EXPORTED_API ~MinimalTypeDetail(); - FASTDDS_EXPORTED_API MinimalTypeDetail( - const MinimalTypeDetail& x); - FASTDDS_EXPORTED_API MinimalTypeDetail( - MinimalTypeDetail&& x); - FASTDDS_EXPORTED_API MinimalTypeDetail& operator =( - const MinimalTypeDetail& x); - FASTDDS_EXPORTED_API MinimalTypeDetail& operator =( - MinimalTypeDetail&& x); - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalTypeDetail&) const - { - return true; - } - - FASTDDS_EXPORTED_API bool consistent( - const MinimalTypeDetail& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - -}; - -/*struct CompleteTypeDetail final{ - AppliedBuiltinTypeAnnotations ann_builtin; // optional - AppliedAnnotationSeq ann_custom; // optional - QualifiedTypeName type_name; - };*/ -class CompleteTypeDetail -{ -public: - - FASTDDS_EXPORTED_API CompleteTypeDetail(); - FASTDDS_EXPORTED_API ~CompleteTypeDetail(); - FASTDDS_EXPORTED_API CompleteTypeDetail( - const CompleteTypeDetail& x); - FASTDDS_EXPORTED_API CompleteTypeDetail( - CompleteTypeDetail&& x); - FASTDDS_EXPORTED_API CompleteTypeDetail& operator =( - const CompleteTypeDetail& x); - FASTDDS_EXPORTED_API CompleteTypeDetail& operator =( - CompleteTypeDetail&& x); - - FASTDDS_EXPORTED_API inline void ann_builtin( - const AppliedBuiltinTypeAnnotations& _ann_builtin) - { - m_ann_builtin = _ann_builtin; - } - - FASTDDS_EXPORTED_API inline void ann_builtin( - AppliedBuiltinTypeAnnotations&& _ann_builtin) - { - m_ann_builtin = std::move(_ann_builtin); - } - - FASTDDS_EXPORTED_API inline const AppliedBuiltinTypeAnnotations& ann_builtin() const - { - return m_ann_builtin; - } - - FASTDDS_EXPORTED_API inline AppliedBuiltinTypeAnnotations& ann_builtin() - { - return m_ann_builtin; - } - - FASTDDS_EXPORTED_API inline void ann_custom( - const AppliedAnnotationSeq& _ann_custom) - { - m_ann_custom = _ann_custom; - } - - FASTDDS_EXPORTED_API inline void ann_custom( - AppliedAnnotationSeq&& _ann_custom) - { - m_ann_custom = std::move(_ann_custom); - } - - FASTDDS_EXPORTED_API inline const AppliedAnnotationSeq& ann_custom() const - { - return m_ann_custom; - } - - FASTDDS_EXPORTED_API inline AppliedAnnotationSeq& ann_custom() - { - return m_ann_custom; - } - - FASTDDS_EXPORTED_API inline void type_name( - const QualifiedTypeName& _type_name) - { - m_type_name = _type_name; - } - - FASTDDS_EXPORTED_API inline void type_name( - QualifiedTypeName&& _type_name) - { - m_type_name = std::move(_type_name); - } - - FASTDDS_EXPORTED_API inline const QualifiedTypeName& type_name() const - { - return m_type_name; - } - - FASTDDS_EXPORTED_API inline QualifiedTypeName& type_name() - { - return m_type_name; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteTypeDetail& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CompleteTypeDetail& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - AppliedBuiltinTypeAnnotations m_ann_builtin; - AppliedAnnotationSeq m_ann_custom; - QualifiedTypeName m_type_name; -}; -/*struct CompleteStructHeader { - TypeIdentifier base_type; - CompleteTypeDetail detail; - };*/ -class CompleteStructHeader -{ -public: - - FASTDDS_EXPORTED_API CompleteStructHeader(); - FASTDDS_EXPORTED_API ~CompleteStructHeader(); - FASTDDS_EXPORTED_API CompleteStructHeader( - const CompleteStructHeader& x); - FASTDDS_EXPORTED_API CompleteStructHeader( - CompleteStructHeader&& x); - FASTDDS_EXPORTED_API CompleteStructHeader& operator =( - const CompleteStructHeader& x); - FASTDDS_EXPORTED_API CompleteStructHeader& operator =( - CompleteStructHeader&& x); - - FASTDDS_EXPORTED_API inline void base_type( - const TypeIdentifier& _base_type) - { - m_base_type = _base_type; - } - - FASTDDS_EXPORTED_API inline void base_type( - TypeIdentifier&& _base_type) - { - m_base_type = std::move(_base_type); - } - - FASTDDS_EXPORTED_API inline const TypeIdentifier& base_type() const - { - return m_base_type; - } - - FASTDDS_EXPORTED_API inline TypeIdentifier& base_type() - { - return m_base_type; - } - - FASTDDS_EXPORTED_API inline void detail( - const CompleteTypeDetail& _detail) - { - m_detail = _detail; - } - - FASTDDS_EXPORTED_API inline void detail( - CompleteTypeDetail&& _detail) - { - m_detail = std::move(_detail); - } - - FASTDDS_EXPORTED_API inline const CompleteTypeDetail& detail() const - { - return m_detail; - } - - FASTDDS_EXPORTED_API inline CompleteTypeDetail& detail() - { - return m_detail; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteStructHeader& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CompleteStructHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - TypeIdentifier m_base_type; - CompleteTypeDetail m_detail; -}; -/*struct MinimalStructHeader { - TypeIdentifier base_type; - MinimalTypeDetail detail; - };*/ -class MinimalStructHeader -{ -public: - - FASTDDS_EXPORTED_API MinimalStructHeader(); - FASTDDS_EXPORTED_API ~MinimalStructHeader(); - FASTDDS_EXPORTED_API MinimalStructHeader( - const MinimalStructHeader& x); - FASTDDS_EXPORTED_API MinimalStructHeader( - MinimalStructHeader&& x); - FASTDDS_EXPORTED_API MinimalStructHeader& operator =( - const MinimalStructHeader& x); - FASTDDS_EXPORTED_API MinimalStructHeader& operator =( - MinimalStructHeader&& x); - - FASTDDS_EXPORTED_API inline void base_type( - const TypeIdentifier& _base_type) - { - m_base_type = _base_type; - } - - FASTDDS_EXPORTED_API inline void base_type( - TypeIdentifier&& _base_type) - { - m_base_type = std::move(_base_type); - } - - FASTDDS_EXPORTED_API inline const TypeIdentifier& base_type() const - { - return m_base_type; - } - - FASTDDS_EXPORTED_API inline TypeIdentifier& base_type() - { - return m_base_type; - } - - FASTDDS_EXPORTED_API inline void detail( - const MinimalTypeDetail& _detail) - { - m_detail = _detail; - } - - FASTDDS_EXPORTED_API inline void detail( - MinimalTypeDetail&& _detail) - { - m_detail = std::move(_detail); - } - - FASTDDS_EXPORTED_API inline const MinimalTypeDetail& detail() const - { - return m_detail; - } - - FASTDDS_EXPORTED_API inline MinimalTypeDetail& detail() - { - return m_detail; - } - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalStructHeader& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const MinimalStructHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - TypeIdentifier m_base_type; - MinimalTypeDetail m_detail; -}; - -/*struct CompleteStructType final{ - StructTypeFlag struct_flags; - CompleteStructHeader header; - CompleteStructMemberSeq member_seq; - };*/ -class CompleteStructType -{ -public: - - FASTDDS_EXPORTED_API CompleteStructType(); - FASTDDS_EXPORTED_API ~CompleteStructType(); - FASTDDS_EXPORTED_API CompleteStructType( - const CompleteStructType& x); - FASTDDS_EXPORTED_API CompleteStructType( - CompleteStructType&& x); - FASTDDS_EXPORTED_API CompleteStructType& operator =( - const CompleteStructType& x); - FASTDDS_EXPORTED_API CompleteStructType& operator =( - CompleteStructType&& x); - - FASTDDS_EXPORTED_API inline void struct_flags( - const StructTypeFlag& _struct_flags) - { - m_struct_flags = _struct_flags; - } - - FASTDDS_EXPORTED_API inline void struct_flags( - StructTypeFlag&& _struct_flags) - { - m_struct_flags = std::move(_struct_flags); - } - - FASTDDS_EXPORTED_API inline const StructTypeFlag& struct_flags() const - { - return m_struct_flags; - } - - FASTDDS_EXPORTED_API inline StructTypeFlag& struct_flags() - { - return m_struct_flags; - } - - FASTDDS_EXPORTED_API inline void header( - const CompleteStructHeader& _header) - { - m_header = _header; - } - - FASTDDS_EXPORTED_API inline void header( - CompleteStructHeader&& _header) - { - m_header = std::move(_header); - } - - FASTDDS_EXPORTED_API inline const CompleteStructHeader& header() const - { - return m_header; - } - - FASTDDS_EXPORTED_API inline CompleteStructHeader& header() - { - return m_header; - } - - FASTDDS_EXPORTED_API inline void member_seq( - const CompleteStructMemberSeq& _member_seq) - { - m_member_seq = _member_seq; - } - - FASTDDS_EXPORTED_API inline void member_seq( - CompleteStructMemberSeq&& _member_seq) - { - m_member_seq = std::move(_member_seq); - } - - FASTDDS_EXPORTED_API inline const CompleteStructMemberSeq& member_seq() const - { - return m_member_seq; - } - - FASTDDS_EXPORTED_API inline CompleteStructMemberSeq& member_seq() - { - return m_member_seq; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteStructType& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CompleteStructType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - StructTypeFlag m_struct_flags; - CompleteStructHeader m_header; - CompleteStructMemberSeq m_member_seq; -}; - -/*struct MinimalStructType final{ - StructTypeFlag struct_flags; - MinimalStructHeader header; - MinimalStructMemberSeq member_seq; - };*/ -class MinimalStructType -{ -public: - - FASTDDS_EXPORTED_API MinimalStructType(); - FASTDDS_EXPORTED_API ~MinimalStructType(); - FASTDDS_EXPORTED_API MinimalStructType( - const MinimalStructType& x); - FASTDDS_EXPORTED_API MinimalStructType( - MinimalStructType&& x); - FASTDDS_EXPORTED_API MinimalStructType& operator =( - const MinimalStructType& x); - FASTDDS_EXPORTED_API MinimalStructType& operator =( - MinimalStructType&& x); - - FASTDDS_EXPORTED_API inline void struct_flags( - const StructTypeFlag& _struct_flags) - { - m_struct_flags = _struct_flags; - } - - FASTDDS_EXPORTED_API inline void struct_flags( - StructTypeFlag&& _struct_flags) - { - m_struct_flags = std::move(_struct_flags); - } - - FASTDDS_EXPORTED_API inline const StructTypeFlag& struct_flags() const - { - return m_struct_flags; - } - - FASTDDS_EXPORTED_API inline StructTypeFlag& struct_flags() - { - return m_struct_flags; - } - - FASTDDS_EXPORTED_API inline void header( - const MinimalStructHeader& _header) - { - m_header = _header; - } - - FASTDDS_EXPORTED_API inline void header( - MinimalStructHeader&& _header) - { - m_header = std::move(_header); - } - - FASTDDS_EXPORTED_API inline const MinimalStructHeader& header() const - { - return m_header; - } - - FASTDDS_EXPORTED_API inline MinimalStructHeader& header() - { - return m_header; - } - - FASTDDS_EXPORTED_API inline void member_seq( - const MinimalStructMemberSeq& _member_seq) - { - m_member_seq = _member_seq; - } - - FASTDDS_EXPORTED_API inline void member_seq( - MinimalStructMemberSeq&& _member_seq) - { - m_member_seq = std::move(_member_seq); - } - - FASTDDS_EXPORTED_API inline const MinimalStructMemberSeq& member_seq() const - { - return m_member_seq; - } - - FASTDDS_EXPORTED_API inline MinimalStructMemberSeq& member_seq() - { - return m_member_seq; - } - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalStructType& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const MinimalStructType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - StructTypeFlag m_struct_flags; - MinimalStructHeader m_header; - MinimalStructMemberSeq m_member_seq; -}; - -// --- Union: --------------------------------------------------------- - -// Case labels that apply to a member of a union type -// Ordered by their values -typedef std::vector UnionCaseLabelSeq; - -/*struct CommonUnionMember final{ - MemberId member_id; - UnionMemberFlag member_flags; - TypeIdentifier type_id; - UnionCaseLabelSeq label_seq; - };*/ -class CommonUnionMember -{ -public: - - FASTDDS_EXPORTED_API CommonUnionMember(); - FASTDDS_EXPORTED_API ~CommonUnionMember(); - FASTDDS_EXPORTED_API CommonUnionMember( - const CommonUnionMember& x); - FASTDDS_EXPORTED_API CommonUnionMember( - CommonUnionMember&& x); - FASTDDS_EXPORTED_API CommonUnionMember& operator =( - const CommonUnionMember& x); - FASTDDS_EXPORTED_API CommonUnionMember& operator =( - CommonUnionMember&& x); - - FASTDDS_EXPORTED_API inline void member_id( - const MemberId& _member_id) - { - m_member_id = _member_id; - } - - FASTDDS_EXPORTED_API inline void member_id( - MemberId&& _member_id) - { - m_member_id = std::move(_member_id); - } - - FASTDDS_EXPORTED_API inline const MemberId& member_id() const - { - return m_member_id; - } - - FASTDDS_EXPORTED_API inline MemberId& member_id() - { - return m_member_id; - } - - FASTDDS_EXPORTED_API inline void member_flags( - const UnionMemberFlag& _member_flags) - { - m_member_flags = _member_flags; - } - - FASTDDS_EXPORTED_API inline void member_flags( - UnionMemberFlag&& _member_flags) - { - m_member_flags = std::move(_member_flags); - } - - FASTDDS_EXPORTED_API inline const UnionMemberFlag& member_flags() const - { - return m_member_flags; - } - - FASTDDS_EXPORTED_API inline UnionMemberFlag& member_flags() - { - return m_member_flags; - } - - FASTDDS_EXPORTED_API inline void type_id( - const TypeIdentifier& _type_id) - { - m_type_id = _type_id; - } - - FASTDDS_EXPORTED_API inline void type_id( - TypeIdentifier&& _type_id) - { - m_type_id = std::move(_type_id); - } - - FASTDDS_EXPORTED_API inline const TypeIdentifier& type_id() const - { - return m_type_id; - } - - FASTDDS_EXPORTED_API inline TypeIdentifier& type_id() - { - return m_type_id; - } - - FASTDDS_EXPORTED_API inline void label_seq( - const UnionCaseLabelSeq& _label_seq) - { - m_label_seq = _label_seq; - } - - FASTDDS_EXPORTED_API inline void label_seq( - UnionCaseLabelSeq&& _label_seq) - { - m_label_seq = std::move(_label_seq); - } - - FASTDDS_EXPORTED_API inline const UnionCaseLabelSeq& label_seq() const - { - return m_label_seq; - } - - FASTDDS_EXPORTED_API inline UnionCaseLabelSeq& label_seq() - { - return m_label_seq; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CommonUnionMember& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CommonUnionMember& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - MemberId m_member_id; - UnionMemberFlag m_member_flags; - TypeIdentifier m_type_id; - UnionCaseLabelSeq m_label_seq; -}; - -// Member of a union type -/*struct CompleteUnionMember { - CommonUnionMember common; - CompleteMemberDetail detail; - };*/ -class CompleteUnionMember -{ -public: - - FASTDDS_EXPORTED_API CompleteUnionMember(); - FASTDDS_EXPORTED_API ~CompleteUnionMember(); - FASTDDS_EXPORTED_API CompleteUnionMember( - const CompleteUnionMember& x); - FASTDDS_EXPORTED_API CompleteUnionMember( - CompleteUnionMember&& x); - FASTDDS_EXPORTED_API CompleteUnionMember& operator =( - const CompleteUnionMember& x); - FASTDDS_EXPORTED_API CompleteUnionMember& operator =( - CompleteUnionMember&& x); - - FASTDDS_EXPORTED_API inline void common( - const CommonUnionMember& _common) - { - m_common = _common; - } - - FASTDDS_EXPORTED_API inline void common( - CommonUnionMember&& _common) - { - m_common = std::move(_common); - } - - FASTDDS_EXPORTED_API inline const CommonUnionMember& common() const - { - return m_common; - } - - FASTDDS_EXPORTED_API inline CommonUnionMember& common() - { - return m_common; - } - - FASTDDS_EXPORTED_API inline void detail( - const CompleteMemberDetail& _detail) - { - m_detail = _detail; - } - - FASTDDS_EXPORTED_API inline void detail( - CompleteMemberDetail&& _detail) - { - m_detail = std::move(_detail); - } - - FASTDDS_EXPORTED_API inline const CompleteMemberDetail& detail() const - { - return m_detail; - } - - FASTDDS_EXPORTED_API inline CompleteMemberDetail& detail() - { - return m_detail; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteUnionMember& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CompleteUnionMember& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonUnionMember m_common; - CompleteMemberDetail m_detail; -}; - -// Ordered by member_index -typedef std::vector CompleteUnionMemberSeq; - -// Member of a union type -/*struct MinimalUnionMember { - CommonUnionMember common; - MinimalMemberDetail detail; - };*/ -class MinimalUnionMember -{ -public: - - FASTDDS_EXPORTED_API MinimalUnionMember(); - FASTDDS_EXPORTED_API ~MinimalUnionMember(); - FASTDDS_EXPORTED_API MinimalUnionMember( - const MinimalUnionMember& x); - FASTDDS_EXPORTED_API MinimalUnionMember( - MinimalUnionMember&& x); - FASTDDS_EXPORTED_API MinimalUnionMember& operator =( - const MinimalUnionMember& x); - FASTDDS_EXPORTED_API MinimalUnionMember& operator =( - MinimalUnionMember&& x); - - FASTDDS_EXPORTED_API inline void common( - const CommonUnionMember& _common) - { - m_common = _common; - } - - FASTDDS_EXPORTED_API inline void common( - CommonUnionMember&& _common) - { - m_common = std::move(_common); - } - - FASTDDS_EXPORTED_API inline const CommonUnionMember& common() const - { - return m_common; - } - - FASTDDS_EXPORTED_API inline CommonUnionMember& common() - { - return m_common; - } - - FASTDDS_EXPORTED_API inline void detail( - const MinimalMemberDetail& _detail) - { - m_detail = _detail; - } - - FASTDDS_EXPORTED_API inline void detail( - MinimalMemberDetail&& _detail) - { - m_detail = std::move(_detail); - } - - FASTDDS_EXPORTED_API inline const MinimalMemberDetail& detail() const - { - return m_detail; - } - - FASTDDS_EXPORTED_API inline MinimalMemberDetail& detail() - { - return m_detail; - } - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalUnionMember& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const MinimalUnionMember& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonUnionMember m_common; - MinimalMemberDetail m_detail; -}; - -// Ordered by MinimalUnionMember.common.member_id -typedef std::vector MinimalUnionMemberSeq; - -/*struct CommonDiscriminatorMember final{ - UnionDiscriminatorFlag member_flags; - TypeIdentifier type_id; - };*/ -class CommonDiscriminatorMember -{ -public: - - FASTDDS_EXPORTED_API CommonDiscriminatorMember(); - FASTDDS_EXPORTED_API ~CommonDiscriminatorMember(); - FASTDDS_EXPORTED_API CommonDiscriminatorMember( - const CommonDiscriminatorMember& x); - FASTDDS_EXPORTED_API CommonDiscriminatorMember( - CommonDiscriminatorMember&& x); - FASTDDS_EXPORTED_API CommonDiscriminatorMember& operator =( - const CommonDiscriminatorMember& x); - FASTDDS_EXPORTED_API CommonDiscriminatorMember& operator =( - CommonDiscriminatorMember&& x); - - FASTDDS_EXPORTED_API inline void member_flags( - const UnionDiscriminatorFlag& _member_flags) - { - m_member_flags = _member_flags; - } - - FASTDDS_EXPORTED_API inline void member_flags( - UnionDiscriminatorFlag&& _member_flags) - { - m_member_flags = std::move(_member_flags); - } - - FASTDDS_EXPORTED_API inline const UnionDiscriminatorFlag& member_flags() const - { - return m_member_flags; - } - - FASTDDS_EXPORTED_API inline UnionDiscriminatorFlag& member_flags() - { - return m_member_flags; - } - - FASTDDS_EXPORTED_API inline void type_id( - const TypeIdentifier& _type_id) - { - m_type_id = _type_id; - } - - FASTDDS_EXPORTED_API inline void type_id( - TypeIdentifier&& _type_id) - { - m_type_id = std::move(_type_id); - } - - FASTDDS_EXPORTED_API inline const TypeIdentifier& type_id() const - { - return m_type_id; - } - - FASTDDS_EXPORTED_API inline TypeIdentifier& type_id() - { - return m_type_id; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CommonDiscriminatorMember& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CommonDiscriminatorMember& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - UnionDiscriminatorFlag m_member_flags; - TypeIdentifier m_type_id; -}; - -// Member of a union type -/*struct CompleteDiscriminatorMember { - CommonDiscriminatorMember common; - AppliedBuiltinTypeAnnotations ann_builtin; // Optional - AppliedAnnotationSeq ann_custom; // Optional - };*/ -class CompleteDiscriminatorMember -{ -public: - - FASTDDS_EXPORTED_API CompleteDiscriminatorMember(); - FASTDDS_EXPORTED_API ~CompleteDiscriminatorMember(); - FASTDDS_EXPORTED_API CompleteDiscriminatorMember( - const CompleteDiscriminatorMember& x); - FASTDDS_EXPORTED_API CompleteDiscriminatorMember( - CompleteDiscriminatorMember&& x); - FASTDDS_EXPORTED_API CompleteDiscriminatorMember& operator =( - const CompleteDiscriminatorMember& x); - FASTDDS_EXPORTED_API CompleteDiscriminatorMember& operator =( - CompleteDiscriminatorMember&& x); - - FASTDDS_EXPORTED_API inline void common( - const CommonDiscriminatorMember& _common) - { - m_common = _common; - } - - FASTDDS_EXPORTED_API inline void common( - CommonDiscriminatorMember&& _common) - { - m_common = std::move(_common); - } - - FASTDDS_EXPORTED_API inline const CommonDiscriminatorMember& common() const - { - return m_common; - } - - FASTDDS_EXPORTED_API inline CommonDiscriminatorMember& common() - { - return m_common; - } - - FASTDDS_EXPORTED_API inline void ann_builtin( - const AppliedBuiltinTypeAnnotations& _ann_builtin) - { - m_ann_builtin = _ann_builtin; - } - - FASTDDS_EXPORTED_API inline void ann_builtin( - AppliedBuiltinTypeAnnotations&& _ann_builtin) - { - m_ann_builtin = std::move(_ann_builtin); - } - - FASTDDS_EXPORTED_API inline const AppliedBuiltinTypeAnnotations& ann_builtin() const - { - return m_ann_builtin; - } - - FASTDDS_EXPORTED_API inline AppliedBuiltinTypeAnnotations& ann_builtin() - { - return m_ann_builtin; - } - - FASTDDS_EXPORTED_API inline void ann_custom( - const AppliedAnnotationSeq& _ann_custom) - { - m_ann_custom = _ann_custom; - } - - FASTDDS_EXPORTED_API inline void ann_custom( - AppliedAnnotationSeq&& _ann_custom) - { - m_ann_custom = std::move(_ann_custom); - } - - FASTDDS_EXPORTED_API inline const AppliedAnnotationSeq& ann_custom() const - { - return m_ann_custom; - } - - FASTDDS_EXPORTED_API inline AppliedAnnotationSeq& ann_custom() - { - return m_ann_custom; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteDiscriminatorMember& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CompleteDiscriminatorMember& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonDiscriminatorMember m_common; - AppliedBuiltinTypeAnnotations m_ann_builtin; - AppliedAnnotationSeq m_ann_custom; -}; - -// Member of a union type -/*struct MinimalDiscriminatorMember { - CommonDiscriminatorMember common; - };*/ -class MinimalDiscriminatorMember -{ -public: - - FASTDDS_EXPORTED_API MinimalDiscriminatorMember(); - FASTDDS_EXPORTED_API ~MinimalDiscriminatorMember(); - FASTDDS_EXPORTED_API MinimalDiscriminatorMember( - const MinimalDiscriminatorMember& x); - FASTDDS_EXPORTED_API MinimalDiscriminatorMember( - MinimalDiscriminatorMember&& x); - FASTDDS_EXPORTED_API MinimalDiscriminatorMember& operator =( - const MinimalDiscriminatorMember& x); - FASTDDS_EXPORTED_API MinimalDiscriminatorMember& operator =( - MinimalDiscriminatorMember&& x); - - FASTDDS_EXPORTED_API inline void common( - const CommonDiscriminatorMember& _common) - { - m_common = _common; - } - - FASTDDS_EXPORTED_API inline void common( - CommonDiscriminatorMember&& _common) - { - m_common = std::move(_common); - } - - FASTDDS_EXPORTED_API inline const CommonDiscriminatorMember& common() const - { - return m_common; - } - - FASTDDS_EXPORTED_API inline CommonDiscriminatorMember& common() - { - return m_common; - } - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalDiscriminatorMember& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const MinimalDiscriminatorMember& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonDiscriminatorMember m_common; -}; - -/*struct CompleteUnionHeader { - CompleteTypeDetail detail; - };*/ -class CompleteUnionHeader -{ -public: - - FASTDDS_EXPORTED_API CompleteUnionHeader(); - FASTDDS_EXPORTED_API ~CompleteUnionHeader(); - FASTDDS_EXPORTED_API CompleteUnionHeader( - const CompleteUnionHeader& x); - FASTDDS_EXPORTED_API CompleteUnionHeader( - CompleteUnionHeader&& x); - FASTDDS_EXPORTED_API CompleteUnionHeader& operator =( - const CompleteUnionHeader& x); - FASTDDS_EXPORTED_API CompleteUnionHeader& operator =( - CompleteUnionHeader&& x); - - FASTDDS_EXPORTED_API inline void detail( - const CompleteTypeDetail& _detail) - { - m_detail = _detail; - } - - FASTDDS_EXPORTED_API inline void detail( - CompleteTypeDetail&& _detail) - { - m_detail = std::move(_detail); - } - - FASTDDS_EXPORTED_API inline const CompleteTypeDetail& detail() const - { - return m_detail; - } - - FASTDDS_EXPORTED_API inline CompleteTypeDetail& detail() - { - return m_detail; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteUnionHeader& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CompleteUnionHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CompleteTypeDetail m_detail; -}; - -/*struct MinimalUnionHeader { - MinimalTypeDetail detail; - };*/ -class MinimalUnionHeader -{ -public: - - FASTDDS_EXPORTED_API MinimalUnionHeader(); - FASTDDS_EXPORTED_API ~MinimalUnionHeader(); - FASTDDS_EXPORTED_API MinimalUnionHeader( - const MinimalUnionHeader& x); - FASTDDS_EXPORTED_API MinimalUnionHeader( - MinimalUnionHeader&& x); - FASTDDS_EXPORTED_API MinimalUnionHeader& operator =( - const MinimalUnionHeader& x); - FASTDDS_EXPORTED_API MinimalUnionHeader& operator =( - MinimalUnionHeader&& x); - - FASTDDS_EXPORTED_API inline void detail( - const MinimalTypeDetail& _detail) - { - m_detail = _detail; - } - - FASTDDS_EXPORTED_API inline void detail( - MinimalTypeDetail&& _detail) - { - m_detail = std::move(_detail); - } - - FASTDDS_EXPORTED_API inline const MinimalTypeDetail& detail() const - { - return m_detail; - } - - FASTDDS_EXPORTED_API inline MinimalTypeDetail& detail() - { - return m_detail; - } - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalUnionHeader& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const MinimalUnionHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - MinimalTypeDetail m_detail; -}; - -/*struct CompleteUnionType final{ - UnionTypeFlag union_flags; - CompleteUnionHeader header; - CompleteDiscriminatorMember discriminator; - CompleteUnionMemberSeq member_seq; - };*/ -class CompleteUnionType -{ -public: - - FASTDDS_EXPORTED_API CompleteUnionType(); - FASTDDS_EXPORTED_API ~CompleteUnionType(); - FASTDDS_EXPORTED_API CompleteUnionType( - const CompleteUnionType& x); - FASTDDS_EXPORTED_API CompleteUnionType( - CompleteUnionType&& x); - FASTDDS_EXPORTED_API CompleteUnionType& operator =( - const CompleteUnionType& x); - FASTDDS_EXPORTED_API CompleteUnionType& operator =( - CompleteUnionType&& x); - - FASTDDS_EXPORTED_API inline void union_flags( - const UnionTypeFlag& _union_flags) - { - m_union_flags = _union_flags; - } - - FASTDDS_EXPORTED_API inline void union_flags( - UnionTypeFlag&& _union_flags) - { - m_union_flags = std::move(_union_flags); - } - - FASTDDS_EXPORTED_API inline const UnionTypeFlag& union_flags() const - { - return m_union_flags; - } - - FASTDDS_EXPORTED_API inline UnionTypeFlag& union_flags() - { - return m_union_flags; - } - - FASTDDS_EXPORTED_API inline void header( - const CompleteUnionHeader& _header) - { - m_header = _header; - } - - FASTDDS_EXPORTED_API inline void header( - CompleteUnionHeader&& _header) - { - m_header = std::move(_header); - } - - FASTDDS_EXPORTED_API inline const CompleteUnionHeader& header() const - { - return m_header; - } - - FASTDDS_EXPORTED_API inline CompleteUnionHeader& header() - { - return m_header; - } - - FASTDDS_EXPORTED_API inline void discriminator( - const CompleteDiscriminatorMember& _discriminator) - { - m_discriminator = _discriminator; - } - - FASTDDS_EXPORTED_API inline void discriminator( - CompleteDiscriminatorMember&& _discriminator) - { - m_discriminator = std::move(_discriminator); - } - - FASTDDS_EXPORTED_API inline const CompleteDiscriminatorMember& discriminator() const - { - return m_discriminator; - } - - FASTDDS_EXPORTED_API inline CompleteDiscriminatorMember& discriminator() - { - return m_discriminator; - } - - FASTDDS_EXPORTED_API inline void member_seq( - const CompleteUnionMemberSeq& _member_seq) - { - m_member_seq = _member_seq; - } - - FASTDDS_EXPORTED_API inline void member_seq( - CompleteUnionMemberSeq&& _member_seq) - { - m_member_seq = std::move(_member_seq); - } - - FASTDDS_EXPORTED_API inline const CompleteUnionMemberSeq& member_seq() const - { - return m_member_seq; - } - - FASTDDS_EXPORTED_API inline CompleteUnionMemberSeq& member_seq() - { - return m_member_seq; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteUnionType& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CompleteUnionType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - UnionTypeFlag m_union_flags; - CompleteUnionHeader m_header; - CompleteDiscriminatorMember m_discriminator; - CompleteUnionMemberSeq m_member_seq; -}; - -/*struct MinimalUnionType final{ - UnionTypeFlag union_flags; - MinimalUnionHeader header; - MinimalDiscriminatorMember discriminator; - MinimalUnionMemberSeq member_seq; - };*/ -class MinimalUnionType -{ -public: - - FASTDDS_EXPORTED_API MinimalUnionType(); - FASTDDS_EXPORTED_API ~MinimalUnionType(); - FASTDDS_EXPORTED_API MinimalUnionType( - const MinimalUnionType& x); - FASTDDS_EXPORTED_API MinimalUnionType( - MinimalUnionType&& x); - FASTDDS_EXPORTED_API MinimalUnionType& operator =( - const MinimalUnionType& x); - FASTDDS_EXPORTED_API MinimalUnionType& operator =( - MinimalUnionType&& x); - - FASTDDS_EXPORTED_API inline void union_flags( - const UnionTypeFlag& _union_flags) - { - m_union_flags = _union_flags; - } - - FASTDDS_EXPORTED_API inline void union_flags( - UnionTypeFlag&& _union_flags) - { - m_union_flags = std::move(_union_flags); - } - - FASTDDS_EXPORTED_API inline const UnionTypeFlag& union_flags() const - { - return m_union_flags; - } - - FASTDDS_EXPORTED_API inline UnionTypeFlag& union_flags() - { - return m_union_flags; - } - - FASTDDS_EXPORTED_API inline void header( - const MinimalUnionHeader& _header) - { - m_header = _header; - } - - FASTDDS_EXPORTED_API inline void header( - MinimalUnionHeader&& _header) - { - m_header = std::move(_header); - } - - FASTDDS_EXPORTED_API inline const MinimalUnionHeader& header() const - { - return m_header; - } - - FASTDDS_EXPORTED_API inline MinimalUnionHeader& header() - { - return m_header; - } - - FASTDDS_EXPORTED_API inline void discriminator( - const MinimalDiscriminatorMember& _discriminator) - { - m_discriminator = _discriminator; - } - - FASTDDS_EXPORTED_API inline void discriminator( - MinimalDiscriminatorMember&& _discriminator) - { - m_discriminator = std::move(_discriminator); - } - - FASTDDS_EXPORTED_API inline const MinimalDiscriminatorMember& discriminator() const - { - return m_discriminator; - } - - FASTDDS_EXPORTED_API inline MinimalDiscriminatorMember& discriminator() - { - return m_discriminator; - } - - FASTDDS_EXPORTED_API inline void member_seq( - const MinimalUnionMemberSeq& _member_seq) - { - m_member_seq = _member_seq; - } - - FASTDDS_EXPORTED_API inline void member_seq( - MinimalUnionMemberSeq&& _member_seq) - { - m_member_seq = std::move(_member_seq); - } - - FASTDDS_EXPORTED_API inline const MinimalUnionMemberSeq& member_seq() const - { - return m_member_seq; - } - - FASTDDS_EXPORTED_API inline MinimalUnionMemberSeq& member_seq() - { - return m_member_seq; - } - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalUnionType& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const MinimalUnionType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - UnionTypeFlag m_union_flags; - MinimalUnionHeader m_header; - MinimalDiscriminatorMember m_discriminator; - MinimalUnionMemberSeq m_member_seq; -}; - -// --- Annotation: --------------------------------------------------- -/*struct CommonAnnotationParameter final{ - AnnotationParameterFlag member_flags; - TypeIdentifier member_type_id; - };*/ -class CommonAnnotationParameter -{ -public: - - FASTDDS_EXPORTED_API CommonAnnotationParameter(); - FASTDDS_EXPORTED_API ~CommonAnnotationParameter(); - FASTDDS_EXPORTED_API CommonAnnotationParameter( - const CommonAnnotationParameter& x); - FASTDDS_EXPORTED_API CommonAnnotationParameter( - CommonAnnotationParameter&& x); - FASTDDS_EXPORTED_API CommonAnnotationParameter& operator =( - const CommonAnnotationParameter& x); - FASTDDS_EXPORTED_API CommonAnnotationParameter& operator =( - CommonAnnotationParameter&& x); - - FASTDDS_EXPORTED_API inline void member_flags( - const AnnotationParameterFlag& _member_flags) - { - m_member_flags = _member_flags; - } - - FASTDDS_EXPORTED_API inline void member_flags( - AnnotationParameterFlag&& _member_flags) - { - m_member_flags = std::move(_member_flags); - } - - FASTDDS_EXPORTED_API inline const AnnotationParameterFlag& member_flags() const - { - return m_member_flags; - } - - FASTDDS_EXPORTED_API inline AnnotationParameterFlag& member_flags() - { - return m_member_flags; - } - - FASTDDS_EXPORTED_API inline void member_type_id( - const TypeIdentifier& _member_type_id) - { - m_member_type_id = _member_type_id; - } - - FASTDDS_EXPORTED_API inline void member_type_id( - TypeIdentifier&& _member_type_id) - { - m_member_type_id = std::move(_member_type_id); - } - - FASTDDS_EXPORTED_API inline const TypeIdentifier& member_type_id() const - { - return m_member_type_id; - } - - FASTDDS_EXPORTED_API inline TypeIdentifier& member_type_id() - { - return m_member_type_id; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CommonAnnotationParameter& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CommonAnnotationParameter& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - AnnotationParameterFlag m_member_flags; - TypeIdentifier m_member_type_id; -}; - -// Member of an annotation type - -/*struct CompleteAnnotationParameter { - CommonAnnotationParameter common; - MemberName name; - AnnotationParameterValue default_value; - };*/ -class CompleteAnnotationParameter -{ -public: - - FASTDDS_EXPORTED_API CompleteAnnotationParameter(); - FASTDDS_EXPORTED_API ~CompleteAnnotationParameter(); - FASTDDS_EXPORTED_API CompleteAnnotationParameter( - const CompleteAnnotationParameter& x); - FASTDDS_EXPORTED_API CompleteAnnotationParameter( - CompleteAnnotationParameter&& x); - FASTDDS_EXPORTED_API CompleteAnnotationParameter& operator =( - const CompleteAnnotationParameter& x); - FASTDDS_EXPORTED_API CompleteAnnotationParameter& operator =( - CompleteAnnotationParameter&& x); - - FASTDDS_EXPORTED_API inline void common( - const CommonAnnotationParameter& _common) - { - m_common = _common; - } - - FASTDDS_EXPORTED_API inline void common( - CommonAnnotationParameter&& _common) - { - m_common = std::move(_common); - } - - FASTDDS_EXPORTED_API inline const CommonAnnotationParameter& common() const - { - return m_common; - } - - FASTDDS_EXPORTED_API inline CommonAnnotationParameter& common() - { - return m_common; - } - - FASTDDS_EXPORTED_API inline void name( - const MemberName& _name) - { - m_name = _name; - } - - FASTDDS_EXPORTED_API inline void name( - MemberName&& _name) - { - m_name = std::move(_name); - } - - FASTDDS_EXPORTED_API inline const MemberName& name() const - { - return m_name; - } - - FASTDDS_EXPORTED_API inline MemberName& name() - { - return m_name; - } - - FASTDDS_EXPORTED_API inline void default_value( - const AnnotationParameterValue& _default_value) - { - m_default_value = _default_value; - } - - FASTDDS_EXPORTED_API inline void default_value( - AnnotationParameterValue&& _default_value) - { - m_default_value = std::move(_default_value); - } - - FASTDDS_EXPORTED_API inline const AnnotationParameterValue& default_value() const - { - return m_default_value; - } - - FASTDDS_EXPORTED_API inline AnnotationParameterValue& default_value() - { - return m_default_value; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteAnnotationParameter& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CompleteAnnotationParameter& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonAnnotationParameter m_common; - MemberName m_name; - AnnotationParameterValue m_default_value; -}; -// Ordered by CompleteAnnotationParameter.name -typedef std::vector CompleteAnnotationParameterSeq; -/*struct MinimalAnnotationParameter { - CommonAnnotationParameter common; - NameHash name_hash; - AnnotationParameterValue default_value; - };*/ -class MinimalAnnotationParameter -{ -public: - - FASTDDS_EXPORTED_API MinimalAnnotationParameter(); - FASTDDS_EXPORTED_API ~MinimalAnnotationParameter(); - FASTDDS_EXPORTED_API MinimalAnnotationParameter( - const MinimalAnnotationParameter& x); - FASTDDS_EXPORTED_API MinimalAnnotationParameter( - MinimalAnnotationParameter&& x); - FASTDDS_EXPORTED_API MinimalAnnotationParameter& operator =( - const MinimalAnnotationParameter& x); - FASTDDS_EXPORTED_API MinimalAnnotationParameter& operator =( - MinimalAnnotationParameter&& x); - - FASTDDS_EXPORTED_API inline void common( - const CommonAnnotationParameter& _common) - { - m_common = _common; - } - - FASTDDS_EXPORTED_API inline void common( - CommonAnnotationParameter&& _common) - { - m_common = std::move(_common); - } - - FASTDDS_EXPORTED_API inline const CommonAnnotationParameter& common() const - { - return m_common; - } - - FASTDDS_EXPORTED_API inline CommonAnnotationParameter& common() - { - return m_common; - } - - FASTDDS_EXPORTED_API inline void name( - const MemberName& _name) - { - m_name = _name; - } - - FASTDDS_EXPORTED_API inline void name( - MemberName&& _name) - { - m_name = std::move(_name); - } - - FASTDDS_EXPORTED_API inline const MemberName& name() const - { - return m_name; - } - - FASTDDS_EXPORTED_API inline MemberName& name() - { - return m_name; - } - - FASTDDS_EXPORTED_API inline void default_value( - const AnnotationParameterValue& _default_value) - { - m_default_value = _default_value; - } - - FASTDDS_EXPORTED_API inline void default_value( - AnnotationParameterValue&& _default_value) - { - m_default_value = std::move(_default_value); - } - - FASTDDS_EXPORTED_API inline const AnnotationParameterValue& default_value() const - { - return m_default_value; - } - - FASTDDS_EXPORTED_API inline AnnotationParameterValue& default_value() - { - return m_default_value; - } - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalAnnotationParameter& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const MinimalAnnotationParameter& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonAnnotationParameter m_common; - MemberName m_name; - AnnotationParameterValue m_default_value; -}; - -// Ordered by MinimalAnnotationParameter.name_hash -typedef std::vector MinimalAnnotationParameterSeq; -/*struct CompleteAnnotationHeader { - QualifiedTypeName annotation_name; - };*/ -class CompleteAnnotationHeader -{ -public: - - FASTDDS_EXPORTED_API CompleteAnnotationHeader(); - FASTDDS_EXPORTED_API ~CompleteAnnotationHeader(); - FASTDDS_EXPORTED_API CompleteAnnotationHeader( - const CompleteAnnotationHeader& x); - FASTDDS_EXPORTED_API CompleteAnnotationHeader( - CompleteAnnotationHeader&& x); - FASTDDS_EXPORTED_API CompleteAnnotationHeader& operator =( - const CompleteAnnotationHeader& x); - FASTDDS_EXPORTED_API CompleteAnnotationHeader& operator =( - CompleteAnnotationHeader&& x); - - FASTDDS_EXPORTED_API inline void annotation_name( - const QualifiedTypeName& _annotation_name) - { - m_annotation_name = _annotation_name; - } - - FASTDDS_EXPORTED_API inline void annotation_name( - QualifiedTypeName&& _annotation_name) - { - m_annotation_name = std::move(_annotation_name); - } - - FASTDDS_EXPORTED_API inline const QualifiedTypeName& annotation_name() const - { - return m_annotation_name; - } - - FASTDDS_EXPORTED_API inline QualifiedTypeName& annotation_name() - { - return m_annotation_name; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteAnnotationHeader& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CompleteAnnotationHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - QualifiedTypeName m_annotation_name; -}; - -/*struct MinimalAnnotationHeader { - // Empty. Available for future extension - };*/ -class MinimalAnnotationHeader -{ -public: - - FASTDDS_EXPORTED_API MinimalAnnotationHeader(); - FASTDDS_EXPORTED_API ~MinimalAnnotationHeader(); - FASTDDS_EXPORTED_API MinimalAnnotationHeader( - const MinimalAnnotationHeader& x); - FASTDDS_EXPORTED_API MinimalAnnotationHeader( - MinimalAnnotationHeader&& x); - FASTDDS_EXPORTED_API MinimalAnnotationHeader& operator =( - const MinimalAnnotationHeader& x); - FASTDDS_EXPORTED_API MinimalAnnotationHeader& operator =( - MinimalAnnotationHeader&& x); - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalAnnotationHeader&) const - { - return true; - } - - FASTDDS_EXPORTED_API bool consistent( - const MinimalAnnotationHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - -}; - -/*struct CompleteAnnotationType final{ - AnnotationTypeFlag annotation_flag; - CompleteAnnotationHeader header; - CompleteAnnotationParameterSeq member_seq; - };*/ -class CompleteAnnotationType final -{ -public: - - FASTDDS_EXPORTED_API CompleteAnnotationType(); - FASTDDS_EXPORTED_API ~CompleteAnnotationType(); - FASTDDS_EXPORTED_API CompleteAnnotationType( - const CompleteAnnotationType& x); - FASTDDS_EXPORTED_API CompleteAnnotationType( - CompleteAnnotationType&& x); - FASTDDS_EXPORTED_API CompleteAnnotationType& operator =( - const CompleteAnnotationType& x); - FASTDDS_EXPORTED_API CompleteAnnotationType& operator =( - CompleteAnnotationType&& x); - - FASTDDS_EXPORTED_API inline void annotation_flag( - const AnnotationTypeFlag& _annotation_flag) - { - m_annotation_flag = _annotation_flag; - } - - FASTDDS_EXPORTED_API inline void annotation_flag( - AnnotationTypeFlag&& _annotation_flag) - { - m_annotation_flag = std::move(_annotation_flag); - } - - FASTDDS_EXPORTED_API inline const AnnotationTypeFlag& annotation_flag() const - { - return m_annotation_flag; - } - - FASTDDS_EXPORTED_API inline AnnotationTypeFlag& annotation_flag() - { - return m_annotation_flag; - } - - FASTDDS_EXPORTED_API inline void header( - const CompleteAnnotationHeader& _header) - { - m_header = _header; - } - - FASTDDS_EXPORTED_API inline void header( - CompleteAnnotationHeader&& _header) - { - m_header = std::move(_header); - } - - FASTDDS_EXPORTED_API inline const CompleteAnnotationHeader& header() const - { - return m_header; - } - - FASTDDS_EXPORTED_API inline CompleteAnnotationHeader& header() - { - return m_header; - } - - FASTDDS_EXPORTED_API inline void member_seq( - const CompleteAnnotationParameterSeq& _member_seq) - { - m_member_seq = _member_seq; - } - - FASTDDS_EXPORTED_API inline void member_seq( - CompleteAnnotationParameterSeq&& _member_seq) - { - m_member_seq = std::move(_member_seq); - } - - FASTDDS_EXPORTED_API inline const CompleteAnnotationParameterSeq& member_seq() const - { - return m_member_seq; - } - - FASTDDS_EXPORTED_API inline CompleteAnnotationParameterSeq& member_seq() - { - return m_member_seq; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteAnnotationType& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CompleteAnnotationType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - AnnotationTypeFlag m_annotation_flag; - CompleteAnnotationHeader m_header; - CompleteAnnotationParameterSeq m_member_seq; -}; -/*struct MinimalAnnotationType final{ - AnnotationTypeFlag annotation_flag; - MinimalAnnotationHeader header; - MinimalAnnotationParameterSeq member_seq; - };*/ -class MinimalAnnotationType final -{ -public: - - FASTDDS_EXPORTED_API MinimalAnnotationType(); - FASTDDS_EXPORTED_API ~MinimalAnnotationType(); - FASTDDS_EXPORTED_API MinimalAnnotationType( - const MinimalAnnotationType& x); - FASTDDS_EXPORTED_API MinimalAnnotationType( - MinimalAnnotationType&& x); - FASTDDS_EXPORTED_API MinimalAnnotationType& operator =( - const MinimalAnnotationType& x); - FASTDDS_EXPORTED_API MinimalAnnotationType& operator =( - MinimalAnnotationType&& x); - - FASTDDS_EXPORTED_API inline void annotation_flag( - const AnnotationTypeFlag& _annotation_flag) - { - m_annotation_flag = _annotation_flag; - } - - FASTDDS_EXPORTED_API inline void annotation_flag( - AnnotationTypeFlag&& _annotation_flag) - { - m_annotation_flag = std::move(_annotation_flag); - } - - FASTDDS_EXPORTED_API inline const AnnotationTypeFlag& annotation_flag() const - { - return m_annotation_flag; - } - - FASTDDS_EXPORTED_API inline AnnotationTypeFlag& annotation_flag() - { - return m_annotation_flag; - } - - FASTDDS_EXPORTED_API inline void header( - const MinimalAnnotationHeader& _header) - { - m_header = _header; - } - - FASTDDS_EXPORTED_API inline void header( - MinimalAnnotationHeader&& _header) - { - m_header = std::move(_header); - } - - FASTDDS_EXPORTED_API inline const MinimalAnnotationHeader& header() const - { - return m_header; - } - - FASTDDS_EXPORTED_API inline MinimalAnnotationHeader& header() - { - return m_header; - } - - FASTDDS_EXPORTED_API inline void member_seq( - const MinimalAnnotationParameterSeq& _member_seq) - { - m_member_seq = _member_seq; - } - - FASTDDS_EXPORTED_API inline void member_seq( - MinimalAnnotationParameterSeq&& _member_seq) - { - m_member_seq = std::move(_member_seq); - } - - FASTDDS_EXPORTED_API inline const MinimalAnnotationParameterSeq& member_seq() const - { - return m_member_seq; - } - - FASTDDS_EXPORTED_API inline MinimalAnnotationParameterSeq& member_seq() - { - return m_member_seq; - } - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalAnnotationType& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const MinimalAnnotationType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - AnnotationTypeFlag m_annotation_flag; - MinimalAnnotationHeader m_header; - MinimalAnnotationParameterSeq m_member_seq; -}; - -// --- Alias: --------------------------------------------------------- -/*struct CommonAliasBody final{ - AliasMemberFlag related_flags; - TypeIdentifier related_type; - };*/ -class CommonAliasBody -{ -public: - - FASTDDS_EXPORTED_API CommonAliasBody(); - FASTDDS_EXPORTED_API ~CommonAliasBody(); - FASTDDS_EXPORTED_API CommonAliasBody( - const CommonAliasBody& x); - FASTDDS_EXPORTED_API CommonAliasBody( - CommonAliasBody&& x); - FASTDDS_EXPORTED_API CommonAliasBody& operator =( - const CommonAliasBody& x); - FASTDDS_EXPORTED_API CommonAliasBody& operator =( - CommonAliasBody&& x); - - FASTDDS_EXPORTED_API inline void related_flags( - const AliasMemberFlag& _related_flags) - { - m_related_flags = _related_flags; - } - - FASTDDS_EXPORTED_API inline void related_flags( - AliasMemberFlag&& _related_flags) - { - m_related_flags = std::move(_related_flags); - } - - FASTDDS_EXPORTED_API inline const AliasMemberFlag& related_flags() const - { - return m_related_flags; - } - - FASTDDS_EXPORTED_API inline AliasMemberFlag& related_flags() - { - return m_related_flags; - } - - FASTDDS_EXPORTED_API inline void related_type( - const TypeIdentifier& _related_type) - { - m_related_type = _related_type; - } - - FASTDDS_EXPORTED_API inline void related_type( - TypeIdentifier&& _related_type) - { - m_related_type = std::move(_related_type); - } - - FASTDDS_EXPORTED_API inline const TypeIdentifier& related_type() const - { - return m_related_type; - } - - FASTDDS_EXPORTED_API inline TypeIdentifier& related_type() - { - return m_related_type; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CommonAliasBody& other) const; - - // FASTDDS_EXPORTED_API bool consistent(const CommonAliasBody &x, - // const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - AliasMemberFlag m_related_flags; - TypeIdentifier m_related_type; -}; - -/*struct CompleteAliasBody { - CommonAliasBody common; - AppliedBuiltinMemberAnnotations ann_builtin; // Optional - AppliedAnnotationSeq ann_custom; // Optional - };*/ -class CompleteAliasBody -{ -public: - - FASTDDS_EXPORTED_API CompleteAliasBody(); - FASTDDS_EXPORTED_API ~CompleteAliasBody(); - FASTDDS_EXPORTED_API CompleteAliasBody( - const CompleteAliasBody& x); - FASTDDS_EXPORTED_API CompleteAliasBody( - CompleteAliasBody&& x); - FASTDDS_EXPORTED_API CompleteAliasBody& operator =( - const CompleteAliasBody& x); - FASTDDS_EXPORTED_API CompleteAliasBody& operator =( - CompleteAliasBody&& x); - - FASTDDS_EXPORTED_API inline void common( - const CommonAliasBody& _common) - { - m_common = _common; - } - - FASTDDS_EXPORTED_API inline void common( - CommonAliasBody&& _common) - { - m_common = std::move(_common); - } - - FASTDDS_EXPORTED_API inline const CommonAliasBody& common() const - { - return m_common; - } - - FASTDDS_EXPORTED_API inline CommonAliasBody& common() - { - return m_common; - } - - FASTDDS_EXPORTED_API inline void ann_builtin( - const AppliedBuiltinMemberAnnotations& _ann_builtin) - { - m_ann_builtin = _ann_builtin; - } - - FASTDDS_EXPORTED_API inline void ann_builtin( - AppliedBuiltinMemberAnnotations&& _ann_builtin) - { - m_ann_builtin = std::move(_ann_builtin); - } - - FASTDDS_EXPORTED_API inline const AppliedBuiltinMemberAnnotations& ann_builtin() const - { - return m_ann_builtin; - } - - FASTDDS_EXPORTED_API inline AppliedBuiltinMemberAnnotations& ann_builtin() - { - return m_ann_builtin; - } - - FASTDDS_EXPORTED_API inline void ann_custom( - const AppliedAnnotationSeq& _ann_custom) - { - m_ann_custom = _ann_custom; - } - - FASTDDS_EXPORTED_API inline void ann_custom( - AppliedAnnotationSeq&& _ann_custom) - { - m_ann_custom = std::move(_ann_custom); - } - - FASTDDS_EXPORTED_API inline const AppliedAnnotationSeq& ann_custom() const - { - return m_ann_custom; - } - - FASTDDS_EXPORTED_API inline AppliedAnnotationSeq& ann_custom() - { - return m_ann_custom; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteAliasBody& other) const; - - // FASTDDS_EXPORTED_API bool consistent(const CompleteAliasBody &x, - // const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonAliasBody m_common; - AppliedBuiltinMemberAnnotations m_ann_builtin; - AppliedAnnotationSeq m_ann_custom; -}; - -/*struct MinimalAliasBody { - CommonAliasBody common; - };*/ -class MinimalAliasBody -{ -public: - - FASTDDS_EXPORTED_API MinimalAliasBody(); - FASTDDS_EXPORTED_API ~MinimalAliasBody(); - FASTDDS_EXPORTED_API MinimalAliasBody( - const MinimalAliasBody& x); - FASTDDS_EXPORTED_API MinimalAliasBody( - MinimalAliasBody&& x); - FASTDDS_EXPORTED_API MinimalAliasBody& operator =( - const MinimalAliasBody& x); - FASTDDS_EXPORTED_API MinimalAliasBody& operator =( - MinimalAliasBody&& x); - - FASTDDS_EXPORTED_API inline void common( - const CommonAliasBody& _common) - { - m_common = _common; - } - - FASTDDS_EXPORTED_API inline void common( - CommonAliasBody&& _common) - { - m_common = std::move(_common); - } - - FASTDDS_EXPORTED_API inline const CommonAliasBody& common() const - { - return m_common; - } - - FASTDDS_EXPORTED_API inline CommonAliasBody& common() - { - return m_common; - } - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalAliasBody& other) const; - - // FASTDDS_EXPORTED_API bool consistent(const MinimalAliasBody &x, - // const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonAliasBody m_common; -}; - -/*struct CompleteAliasHeader { - CompleteTypeDetail detail; - };*/ -class CompleteAliasHeader -{ -public: - - FASTDDS_EXPORTED_API CompleteAliasHeader(); - FASTDDS_EXPORTED_API ~CompleteAliasHeader(); - FASTDDS_EXPORTED_API CompleteAliasHeader( - const CompleteAliasHeader& x); - FASTDDS_EXPORTED_API CompleteAliasHeader( - CompleteAliasHeader&& x); - FASTDDS_EXPORTED_API CompleteAliasHeader& operator =( - const CompleteAliasHeader& x); - FASTDDS_EXPORTED_API CompleteAliasHeader& operator =( - CompleteAliasHeader&& x); - - FASTDDS_EXPORTED_API inline void detail( - const CompleteTypeDetail& _detail) - { - m_detail = _detail; - } - - FASTDDS_EXPORTED_API inline void detail( - CompleteTypeDetail&& _detail) - { - m_detail = std::move(_detail); - } - - FASTDDS_EXPORTED_API inline const CompleteTypeDetail& detail() const - { - return m_detail; - } - - FASTDDS_EXPORTED_API inline CompleteTypeDetail& detail() - { - return m_detail; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteAliasHeader& other) const; - - // FASTDDS_EXPORTED_API bool consistent(const CompleteAliasHeader &x, - // const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CompleteTypeDetail m_detail; -}; - -/*struct MinimalAliasHeader { - // Empty. Available for future extension - };*/ -class MinimalAliasHeader -{ -public: - - FASTDDS_EXPORTED_API MinimalAliasHeader(); - FASTDDS_EXPORTED_API ~MinimalAliasHeader(); - FASTDDS_EXPORTED_API MinimalAliasHeader( - const MinimalAliasHeader& x); - FASTDDS_EXPORTED_API MinimalAliasHeader( - MinimalAliasHeader&& x); - FASTDDS_EXPORTED_API MinimalAliasHeader& operator =( - const MinimalAliasHeader& x); - FASTDDS_EXPORTED_API MinimalAliasHeader& operator =( - MinimalAliasHeader&& x); - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalAliasHeader&) const - { - return true; - } - - // FASTDDS_EXPORTED_API bool consistent(const MinimalAliasHeader &x, - // const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - -}; - -/*struct CompleteAliasType final{ - AliasTypeFlag alias_flags; - CompleteAliasHeader header; - CompleteAliasBody body; - };*/ -class CompleteAliasType -{ -public: - - FASTDDS_EXPORTED_API CompleteAliasType(); - FASTDDS_EXPORTED_API ~CompleteAliasType(); - FASTDDS_EXPORTED_API CompleteAliasType( - const CompleteAliasType& x); - FASTDDS_EXPORTED_API CompleteAliasType( - CompleteAliasType&& x); - FASTDDS_EXPORTED_API CompleteAliasType& operator =( - const CompleteAliasType& x); - FASTDDS_EXPORTED_API CompleteAliasType& operator =( - CompleteAliasType&& x); - - FASTDDS_EXPORTED_API inline void alias_flags( - const AliasTypeFlag& _alias_flags) - { - m_alias_flags = _alias_flags; - } - - FASTDDS_EXPORTED_API inline void alias_flags( - AliasTypeFlag&& _alias_flags) - { - m_alias_flags = std::move(_alias_flags); - } - - FASTDDS_EXPORTED_API inline const AliasTypeFlag& alias_flags() const - { - return m_alias_flags; - } - - FASTDDS_EXPORTED_API inline AliasTypeFlag& alias_flags() - { - return m_alias_flags; - } - - FASTDDS_EXPORTED_API inline void header( - const CompleteAliasHeader& _header) - { - m_header = _header; - } - - FASTDDS_EXPORTED_API inline void header( - CompleteAliasHeader&& _header) - { - m_header = std::move(_header); - } - - FASTDDS_EXPORTED_API inline const CompleteAliasHeader& header() const - { - return m_header; - } - - FASTDDS_EXPORTED_API inline CompleteAliasHeader& header() - { - return m_header; - } - - FASTDDS_EXPORTED_API inline void body( - const CompleteAliasBody& _body) - { - m_body = _body; - } - - FASTDDS_EXPORTED_API inline void body( - CompleteAliasBody&& _body) - { - m_body = std::move(_body); - } - - FASTDDS_EXPORTED_API inline const CompleteAliasBody& body() const - { - return m_body; - } - - FASTDDS_EXPORTED_API inline CompleteAliasBody& body() - { - return m_body; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteAliasType& other) const; - - // FASTDDS_EXPORTED_API bool consistent(const CompleteAliasType &x, - // const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - AliasTypeFlag m_alias_flags; - CompleteAliasHeader m_header; - CompleteAliasBody m_body; -}; -/*struct MinimalAliasType final{ - AliasTypeFlag alias_flags; - MinimalAliasHeader header; - MinimalAliasBody body; - };*/ -class MinimalAliasType -{ -public: - - FASTDDS_EXPORTED_API MinimalAliasType(); - FASTDDS_EXPORTED_API ~MinimalAliasType(); - FASTDDS_EXPORTED_API MinimalAliasType( - const MinimalAliasType& x); - FASTDDS_EXPORTED_API MinimalAliasType( - MinimalAliasType&& x); - FASTDDS_EXPORTED_API MinimalAliasType& operator =( - const MinimalAliasType& x); - FASTDDS_EXPORTED_API MinimalAliasType& operator =( - MinimalAliasType&& x); - - FASTDDS_EXPORTED_API inline void alias_flags( - const AliasTypeFlag& _alias_flags) - { - m_alias_flags = _alias_flags; - } - - FASTDDS_EXPORTED_API inline void alias_flags( - AliasTypeFlag&& _alias_flags) - { - m_alias_flags = std::move(_alias_flags); - } - - FASTDDS_EXPORTED_API inline const AliasTypeFlag& alias_flags() const - { - return m_alias_flags; - } - - FASTDDS_EXPORTED_API inline AliasTypeFlag& alias_flags() - { - return m_alias_flags; - } - - FASTDDS_EXPORTED_API inline void header( - const MinimalAliasHeader& _header) - { - m_header = _header; - } - - FASTDDS_EXPORTED_API inline void header( - MinimalAliasHeader&& _header) - { - m_header = std::move(_header); - } - - FASTDDS_EXPORTED_API inline const MinimalAliasHeader& header() const - { - return m_header; - } - - FASTDDS_EXPORTED_API inline MinimalAliasHeader& header() - { - return m_header; - } - - FASTDDS_EXPORTED_API inline void body( - const MinimalAliasBody& _body) - { - m_body = _body; - } - - FASTDDS_EXPORTED_API inline void body( - MinimalAliasBody&& _body) - { - m_body = std::move(_body); - } - - FASTDDS_EXPORTED_API inline const MinimalAliasBody& body() const - { - return m_body; - } - - FASTDDS_EXPORTED_API inline MinimalAliasBody& body() - { - return m_body; - } - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalAliasType& other) const; - - // FASTDDS_EXPORTED_API bool consistent(const MinimalAliasType &x, - // const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - AliasTypeFlag m_alias_flags; - MinimalAliasHeader m_header; - MinimalAliasBody m_body; -}; - -// --- Collections: --------------------------------------------------- -/*struct CompleteElementDetail final{ - AppliedBuiltinMemberAnnotations ann_builtin; // Optional - AppliedAnnotationSeq ann_custom; // Optional - };*/ -class CompleteElementDetail -{ -public: - - FASTDDS_EXPORTED_API CompleteElementDetail(); - FASTDDS_EXPORTED_API ~CompleteElementDetail(); - FASTDDS_EXPORTED_API CompleteElementDetail( - const CompleteElementDetail& x); - FASTDDS_EXPORTED_API CompleteElementDetail( - CompleteElementDetail&& x); - FASTDDS_EXPORTED_API CompleteElementDetail& operator =( - const CompleteElementDetail& x); - FASTDDS_EXPORTED_API CompleteElementDetail& operator =( - CompleteElementDetail&& x); - - FASTDDS_EXPORTED_API inline void ann_builtin( - const AppliedBuiltinMemberAnnotations& _ann_builtin) - { - m_ann_builtin = _ann_builtin; - } - - FASTDDS_EXPORTED_API inline void ann_builtin( - AppliedBuiltinMemberAnnotations&& _ann_builtin) - { - m_ann_builtin = std::move(_ann_builtin); - } - - FASTDDS_EXPORTED_API inline const AppliedBuiltinMemberAnnotations& ann_builtin() const - { - return m_ann_builtin; - } - - FASTDDS_EXPORTED_API inline AppliedBuiltinMemberAnnotations& ann_builtin() - { - return m_ann_builtin; - } - - FASTDDS_EXPORTED_API inline void ann_custom( - const AppliedAnnotationSeq& _ann_custom) - { - m_ann_custom = _ann_custom; - } - - FASTDDS_EXPORTED_API inline void ann_custom( - AppliedAnnotationSeq&& _ann_custom) - { - m_ann_custom = std::move(_ann_custom); - } - - FASTDDS_EXPORTED_API inline const AppliedAnnotationSeq& ann_custom() const - { - return m_ann_custom; - } - - FASTDDS_EXPORTED_API inline AppliedAnnotationSeq& ann_custom() - { - return m_ann_custom; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteElementDetail& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CompleteElementDetail& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - AppliedBuiltinMemberAnnotations m_ann_builtin; - AppliedAnnotationSeq m_ann_custom; -}; -/*struct CommonCollectionElement final{ - CollectionElementFlag element_flags; - TypeIdentifier type; - };*/ -class CommonCollectionElement final -{ -public: - - FASTDDS_EXPORTED_API CommonCollectionElement(); - FASTDDS_EXPORTED_API ~CommonCollectionElement(); - FASTDDS_EXPORTED_API CommonCollectionElement( - const CommonCollectionElement& x); - FASTDDS_EXPORTED_API CommonCollectionElement( - CommonCollectionElement&& x); - FASTDDS_EXPORTED_API CommonCollectionElement& operator =( - const CommonCollectionElement& x); - FASTDDS_EXPORTED_API CommonCollectionElement& operator =( - CommonCollectionElement&& x); - - FASTDDS_EXPORTED_API inline void element_flags( - const CollectionElementFlag& _element_flags) - { - m_element_flags = _element_flags; - } - - FASTDDS_EXPORTED_API inline void element_flags( - CollectionElementFlag&& _element_flags) - { - m_element_flags = std::move(_element_flags); - } - - FASTDDS_EXPORTED_API inline const CollectionElementFlag& element_flags() const - { - return m_element_flags; - } - - FASTDDS_EXPORTED_API inline CollectionElementFlag& element_flags() - { - return m_element_flags; - } - - FASTDDS_EXPORTED_API inline void type( - const TypeIdentifier& _type) - { - m_type = _type; - } - - FASTDDS_EXPORTED_API inline void type( - TypeIdentifier&& _type) - { - m_type = std::move(_type); - } - - FASTDDS_EXPORTED_API inline const TypeIdentifier& type() const - { - return m_type; - } - - FASTDDS_EXPORTED_API inline TypeIdentifier& type() - { - return m_type; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CommonCollectionElement& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CommonCollectionElement& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CollectionElementFlag m_element_flags; - TypeIdentifier m_type; -}; - -/*struct CompleteCollectionElement { - CommonCollectionElement common; - CompleteElementDetail detail; - };*/ -class CompleteCollectionElement -{ -public: - - FASTDDS_EXPORTED_API CompleteCollectionElement(); - FASTDDS_EXPORTED_API ~CompleteCollectionElement(); - FASTDDS_EXPORTED_API CompleteCollectionElement( - const CompleteCollectionElement& x); - FASTDDS_EXPORTED_API CompleteCollectionElement( - CompleteCollectionElement&& x); - FASTDDS_EXPORTED_API CompleteCollectionElement& operator =( - const CompleteCollectionElement& x); - FASTDDS_EXPORTED_API CompleteCollectionElement& operator =( - CompleteCollectionElement&& x); - - FASTDDS_EXPORTED_API inline void common( - const CommonCollectionElement& _common) - { - m_common = _common; - } - - FASTDDS_EXPORTED_API inline void common( - CommonCollectionElement&& _common) - { - m_common = std::move(_common); - } - - FASTDDS_EXPORTED_API inline const CommonCollectionElement& common() const - { - return m_common; - } - - FASTDDS_EXPORTED_API inline CommonCollectionElement& common() - { - return m_common; - } - - FASTDDS_EXPORTED_API inline void detail( - const CompleteElementDetail& _detail) - { - m_detail = _detail; - } - - FASTDDS_EXPORTED_API inline void detail( - CompleteElementDetail&& _detail) - { - m_detail = std::move(_detail); - } - - FASTDDS_EXPORTED_API inline const CompleteElementDetail& detail() const - { - return m_detail; - } - - FASTDDS_EXPORTED_API inline CompleteElementDetail& detail() - { - return m_detail; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteCollectionElement& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CompleteCollectionElement& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonCollectionElement m_common; - CompleteElementDetail m_detail; -}; - -/*struct MinimalCollectionElement { - CommonCollectionElement common; - };*/ -class MinimalCollectionElement -{ -public: - - FASTDDS_EXPORTED_API MinimalCollectionElement(); - FASTDDS_EXPORTED_API ~MinimalCollectionElement(); - FASTDDS_EXPORTED_API MinimalCollectionElement( - const MinimalCollectionElement& x); - FASTDDS_EXPORTED_API MinimalCollectionElement( - MinimalCollectionElement&& x); - FASTDDS_EXPORTED_API MinimalCollectionElement& operator =( - const MinimalCollectionElement& x); - FASTDDS_EXPORTED_API MinimalCollectionElement& operator =( - MinimalCollectionElement&& x); - - FASTDDS_EXPORTED_API inline void common( - const CommonCollectionElement& _common) - { - m_common = _common; - } - - FASTDDS_EXPORTED_API inline void common( - CommonCollectionElement&& _common) - { - m_common = std::move(_common); - } - - FASTDDS_EXPORTED_API inline const CommonCollectionElement& common() const - { - return m_common; - } - - FASTDDS_EXPORTED_API inline CommonCollectionElement& common() - { - return m_common; - } - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalCollectionElement& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const MinimalCollectionElement& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonCollectionElement m_common; -}; - -/*struct CommonCollectionHeader final{ - LBound bound; - };*/ -class CommonCollectionHeader -{ -public: - - FASTDDS_EXPORTED_API CommonCollectionHeader(); - FASTDDS_EXPORTED_API ~CommonCollectionHeader(); - FASTDDS_EXPORTED_API CommonCollectionHeader( - const CommonCollectionHeader& x); - FASTDDS_EXPORTED_API CommonCollectionHeader( - CommonCollectionHeader&& x); - FASTDDS_EXPORTED_API CommonCollectionHeader& operator =( - const CommonCollectionHeader& x); - FASTDDS_EXPORTED_API CommonCollectionHeader& operator =( - CommonCollectionHeader&& x); - - FASTDDS_EXPORTED_API inline void bound( - const LBound& _bound) - { - m_bound = _bound; - } - - FASTDDS_EXPORTED_API inline void bound( - LBound&& _bound) - { - m_bound = std::move(_bound); - } - - FASTDDS_EXPORTED_API inline const LBound& bound() const - { - return m_bound; - } - - FASTDDS_EXPORTED_API inline LBound& bound() - { - return m_bound; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CommonCollectionHeader& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CommonCollectionHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - LBound m_bound; -}; - -/*struct CompleteCollectionHeader { - CommonCollectionHeader common; - CompleteTypeDetail detail; // Optional // not present for anonymous - };*/ -class CompleteCollectionHeader -{ -public: - - FASTDDS_EXPORTED_API CompleteCollectionHeader(); - FASTDDS_EXPORTED_API ~CompleteCollectionHeader(); - FASTDDS_EXPORTED_API CompleteCollectionHeader( - const CompleteCollectionHeader& x); - FASTDDS_EXPORTED_API CompleteCollectionHeader( - CompleteCollectionHeader&& x); - FASTDDS_EXPORTED_API CompleteCollectionHeader& operator =( - const CompleteCollectionHeader& x); - FASTDDS_EXPORTED_API CompleteCollectionHeader& operator =( - CompleteCollectionHeader&& x); - - FASTDDS_EXPORTED_API inline void common( - const CommonCollectionHeader& _common) - { - m_common = _common; - } - - FASTDDS_EXPORTED_API inline void common( - CommonCollectionHeader&& _common) - { - m_common = std::move(_common); - } - - FASTDDS_EXPORTED_API inline const CommonCollectionHeader& common() const - { - return m_common; - } - - FASTDDS_EXPORTED_API inline CommonCollectionHeader& common() - { - return m_common; - } - - FASTDDS_EXPORTED_API inline void detail( - const CompleteTypeDetail& _detail) - { - m_detail = _detail; - } - - FASTDDS_EXPORTED_API inline void detail( - CompleteTypeDetail&& _detail) - { - m_detail = std::move(_detail); - } - - FASTDDS_EXPORTED_API inline const CompleteTypeDetail& detail() const - { - return m_detail; - } - - FASTDDS_EXPORTED_API inline CompleteTypeDetail& detail() - { - return m_detail; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteCollectionHeader& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CompleteCollectionHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonCollectionHeader m_common; - CompleteTypeDetail m_detail; -}; - -/*struct MinimalCollectionHeader { - CommonCollectionHeader common; - };*/ -class MinimalCollectionHeader -{ -public: - - FASTDDS_EXPORTED_API MinimalCollectionHeader(); - FASTDDS_EXPORTED_API ~MinimalCollectionHeader(); - FASTDDS_EXPORTED_API MinimalCollectionHeader( - const MinimalCollectionHeader& x); - FASTDDS_EXPORTED_API MinimalCollectionHeader( - MinimalCollectionHeader&& x); - FASTDDS_EXPORTED_API MinimalCollectionHeader& operator =( - const MinimalCollectionHeader& x); - FASTDDS_EXPORTED_API MinimalCollectionHeader& operator =( - MinimalCollectionHeader&& x); - - FASTDDS_EXPORTED_API inline void common( - const CommonCollectionHeader& _common) - { - m_common = _common; - } - - FASTDDS_EXPORTED_API inline void common( - CommonCollectionHeader&& _common) - { - m_common = std::move(_common); - } - - FASTDDS_EXPORTED_API inline const CommonCollectionHeader& common() const - { - return m_common; - } - - FASTDDS_EXPORTED_API inline CommonCollectionHeader& common() - { - return m_common; - } - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalCollectionHeader& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const MinimalCollectionHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonCollectionHeader m_common; -}; - -// --- Sequence: ----------------------------------------------------- -/*struct CompleteSequenceType final{ - CollectionTypeFlag collection_flag; - CompleteCollectionHeader header; - CompleteCollectionElement element; - };*/ -class CompleteSequenceType -{ -public: - - FASTDDS_EXPORTED_API CompleteSequenceType(); - FASTDDS_EXPORTED_API ~CompleteSequenceType(); - FASTDDS_EXPORTED_API CompleteSequenceType( - const CompleteSequenceType& x); - FASTDDS_EXPORTED_API CompleteSequenceType( - CompleteSequenceType&& x); - FASTDDS_EXPORTED_API CompleteSequenceType& operator =( - const CompleteSequenceType& x); - FASTDDS_EXPORTED_API CompleteSequenceType& operator =( - CompleteSequenceType&& x); - - FASTDDS_EXPORTED_API inline void collection_flag( - const CollectionTypeFlag& _collection_flag) - { - m_collection_flag = _collection_flag; - } - - FASTDDS_EXPORTED_API inline void collection_flag( - CollectionTypeFlag&& _collection_flag) - { - m_collection_flag = std::move(_collection_flag); - } - - FASTDDS_EXPORTED_API inline const CollectionTypeFlag& collection_flag() const - { - return m_collection_flag; - } - - FASTDDS_EXPORTED_API inline CollectionTypeFlag& collection_flag() - { - return m_collection_flag; - } - - FASTDDS_EXPORTED_API inline void header( - const CompleteCollectionHeader& _header) - { - m_header = _header; - } - - FASTDDS_EXPORTED_API inline void header( - CompleteCollectionHeader&& _header) - { - m_header = std::move(_header); - } - - FASTDDS_EXPORTED_API inline const CompleteCollectionHeader& header() const - { - return m_header; - } - - FASTDDS_EXPORTED_API inline CompleteCollectionHeader& header() - { - return m_header; - } - - FASTDDS_EXPORTED_API inline void element( - const CompleteCollectionElement& _element) - { - m_element = _element; - } - - FASTDDS_EXPORTED_API inline void element( - CompleteCollectionElement&& _element) - { - m_element = std::move(_element); - } - - FASTDDS_EXPORTED_API inline const CompleteCollectionElement& element() const - { - return m_element; - } - - FASTDDS_EXPORTED_API inline CompleteCollectionElement& element() - { - return m_element; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteSequenceType& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CompleteSequenceType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CollectionTypeFlag m_collection_flag; - CompleteCollectionHeader m_header; - CompleteCollectionElement m_element; -}; - -/*struct MinimalSequenceType final{ - CollectionTypeFlag collection_flag; - MinimalCollectionHeader header; - MinimalCollectionElement element; - };*/ -class MinimalSequenceType -{ -public: - - FASTDDS_EXPORTED_API MinimalSequenceType(); - FASTDDS_EXPORTED_API ~MinimalSequenceType(); - FASTDDS_EXPORTED_API MinimalSequenceType( - const MinimalSequenceType& x); - FASTDDS_EXPORTED_API MinimalSequenceType( - MinimalSequenceType&& x); - FASTDDS_EXPORTED_API MinimalSequenceType& operator =( - const MinimalSequenceType& x); - FASTDDS_EXPORTED_API MinimalSequenceType& operator =( - MinimalSequenceType&& x); - - FASTDDS_EXPORTED_API inline void collection_flag( - const CollectionTypeFlag& _collection_flag) - { - m_collection_flag = _collection_flag; - } - - FASTDDS_EXPORTED_API inline void collection_flag( - CollectionTypeFlag&& _collection_flag) - { - m_collection_flag = std::move(_collection_flag); - } - - FASTDDS_EXPORTED_API inline const CollectionTypeFlag& collection_flag() const - { - return m_collection_flag; - } - - FASTDDS_EXPORTED_API inline CollectionTypeFlag& collection_flag() - { - return m_collection_flag; - } - - FASTDDS_EXPORTED_API inline void header( - const MinimalCollectionHeader& _header) - { - m_header = _header; - } - - FASTDDS_EXPORTED_API inline void header( - MinimalCollectionHeader&& _header) - { - m_header = std::move(_header); - } - - FASTDDS_EXPORTED_API inline const MinimalCollectionHeader& header() const - { - return m_header; - } - - FASTDDS_EXPORTED_API inline MinimalCollectionHeader& header() - { - return m_header; - } - - FASTDDS_EXPORTED_API inline void element( - const MinimalCollectionElement& _element) - { - m_element = _element; - } - - FASTDDS_EXPORTED_API inline void element( - MinimalCollectionElement&& _element) - { - m_element = std::move(_element); - } - - FASTDDS_EXPORTED_API inline const MinimalCollectionElement& element() const - { - return m_element; - } - - FASTDDS_EXPORTED_API inline MinimalCollectionElement& element() - { - return m_element; - } - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalSequenceType& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const MinimalSequenceType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CollectionTypeFlag m_collection_flag; - MinimalCollectionHeader m_header; - MinimalCollectionElement m_element; -}; - -// --- Array: ----------------------------------------------------- -/*struct CommonArrayHeader final{ - LBoundSeq bound_seq; - };*/ -class CommonArrayHeader -{ -public: - - FASTDDS_EXPORTED_API CommonArrayHeader(); - FASTDDS_EXPORTED_API ~CommonArrayHeader(); - FASTDDS_EXPORTED_API CommonArrayHeader( - const CommonArrayHeader& x); - FASTDDS_EXPORTED_API CommonArrayHeader( - CommonArrayHeader&& x); - FASTDDS_EXPORTED_API CommonArrayHeader& operator =( - const CommonArrayHeader& x); - FASTDDS_EXPORTED_API CommonArrayHeader& operator =( - CommonArrayHeader&& x); - - FASTDDS_EXPORTED_API inline void bound_seq( - const LBoundSeq& _bound_seq) - { - m_bound_seq = _bound_seq; - } - - FASTDDS_EXPORTED_API inline void bound_seq( - LBoundSeq&& _bound_seq) - { - m_bound_seq = std::move(_bound_seq); - } - - FASTDDS_EXPORTED_API inline const LBoundSeq& bound_seq() const - { - return m_bound_seq; - } - - FASTDDS_EXPORTED_API inline LBoundSeq& bound_seq() - { - return m_bound_seq; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CommonArrayHeader& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CommonArrayHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - LBoundSeq m_bound_seq; -}; - -/*struct CompleteArrayHeader { - CommonArrayHeader common; - CompleteTypeDetail detail; - };*/ -class CompleteArrayHeader -{ -public: - - FASTDDS_EXPORTED_API CompleteArrayHeader(); - FASTDDS_EXPORTED_API ~CompleteArrayHeader(); - FASTDDS_EXPORTED_API CompleteArrayHeader( - const CompleteArrayHeader& x); - FASTDDS_EXPORTED_API CompleteArrayHeader( - CompleteArrayHeader&& x); - FASTDDS_EXPORTED_API CompleteArrayHeader& operator =( - const CompleteArrayHeader& x); - FASTDDS_EXPORTED_API CompleteArrayHeader& operator =( - CompleteArrayHeader&& x); - - FASTDDS_EXPORTED_API inline void common( - const CommonArrayHeader& _common) - { - m_common = _common; - } - - FASTDDS_EXPORTED_API inline void common( - CommonArrayHeader&& _common) - { - m_common = std::move(_common); - } - - FASTDDS_EXPORTED_API inline const CommonArrayHeader& common() const - { - return m_common; - } - - FASTDDS_EXPORTED_API inline CommonArrayHeader& common() - { - return m_common; - } - - FASTDDS_EXPORTED_API inline void detail( - const CompleteTypeDetail& _detail) - { - m_detail = _detail; - } - - FASTDDS_EXPORTED_API inline void detail( - CompleteTypeDetail&& _detail) - { - m_detail = std::move(_detail); - } - - FASTDDS_EXPORTED_API inline const CompleteTypeDetail& detail() const - { - return m_detail; - } - - FASTDDS_EXPORTED_API inline CompleteTypeDetail& detail() - { - return m_detail; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteArrayHeader& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CompleteArrayHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonArrayHeader m_common; - CompleteTypeDetail m_detail; -}; - -/*struct MinimalArrayHeader { - CommonArrayHeader common; - };*/ -class MinimalArrayHeader -{ -public: - - FASTDDS_EXPORTED_API MinimalArrayHeader(); - FASTDDS_EXPORTED_API ~MinimalArrayHeader(); - FASTDDS_EXPORTED_API MinimalArrayHeader( - const MinimalArrayHeader& x); - FASTDDS_EXPORTED_API MinimalArrayHeader( - MinimalArrayHeader&& x); - FASTDDS_EXPORTED_API MinimalArrayHeader& operator =( - const MinimalArrayHeader& x); - FASTDDS_EXPORTED_API MinimalArrayHeader& operator =( - MinimalArrayHeader&& x); - - FASTDDS_EXPORTED_API inline void common( - const CommonArrayHeader& _common) - { - m_common = _common; - } - - FASTDDS_EXPORTED_API inline void common( - CommonArrayHeader&& _common) - { - m_common = std::move(_common); - } - - FASTDDS_EXPORTED_API inline const CommonArrayHeader& common() const - { - return m_common; - } - - FASTDDS_EXPORTED_API inline CommonArrayHeader& common() - { - return m_common; - } - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalArrayHeader& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const MinimalArrayHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonArrayHeader m_common; -}; - -/*struct CompleteArrayType { - CollectionTypeFlag collection_flag; - CompleteArrayHeader header; - CompleteCollectionElement element; - };*/ -class CompleteArrayType -{ -public: - - FASTDDS_EXPORTED_API CompleteArrayType(); - FASTDDS_EXPORTED_API ~CompleteArrayType(); - FASTDDS_EXPORTED_API CompleteArrayType( - const CompleteArrayType& x); - FASTDDS_EXPORTED_API CompleteArrayType( - CompleteArrayType&& x); - FASTDDS_EXPORTED_API CompleteArrayType& operator =( - const CompleteArrayType& x); - FASTDDS_EXPORTED_API CompleteArrayType& operator =( - CompleteArrayType&& x); - - FASTDDS_EXPORTED_API inline void collection_flag( - const CollectionTypeFlag& _collection_flag) - { - m_collection_flag = _collection_flag; - } - - FASTDDS_EXPORTED_API inline void collection_flag( - CollectionTypeFlag&& _collection_flag) - { - m_collection_flag = std::move(_collection_flag); - } - - FASTDDS_EXPORTED_API inline const CollectionTypeFlag& collection_flag() const - { - return m_collection_flag; - } - - FASTDDS_EXPORTED_API inline CollectionTypeFlag& collection_flag() - { - return m_collection_flag; - } - - FASTDDS_EXPORTED_API inline void header( - const CompleteArrayHeader& _header) - { - m_header = _header; - } - - FASTDDS_EXPORTED_API inline void header( - CompleteArrayHeader&& _header) - { - m_header = std::move(_header); - } - - FASTDDS_EXPORTED_API inline const CompleteArrayHeader& header() const - { - return m_header; - } - - FASTDDS_EXPORTED_API inline CompleteArrayHeader& header() - { - return m_header; - } - - FASTDDS_EXPORTED_API inline void element( - const CompleteCollectionElement& _element) - { - m_element = _element; - } - - FASTDDS_EXPORTED_API inline void element( - CompleteCollectionElement&& _element) - { - m_element = std::move(_element); - } - - FASTDDS_EXPORTED_API inline const CompleteCollectionElement& element() const - { - return m_element; - } - - FASTDDS_EXPORTED_API inline CompleteCollectionElement& element() - { - return m_element; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteArrayType& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CompleteArrayType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CollectionTypeFlag m_collection_flag; - CompleteArrayHeader m_header; - CompleteCollectionElement m_element; -}; - -/*struct MinimalArrayType final{ - CollectionTypeFlag collection_flag; - MinimalArrayHeader header; - MinimalCollectionElement element; - };*/ -class MinimalArrayType -{ -public: - - FASTDDS_EXPORTED_API MinimalArrayType(); - FASTDDS_EXPORTED_API ~MinimalArrayType(); - FASTDDS_EXPORTED_API MinimalArrayType( - const MinimalArrayType& x); - FASTDDS_EXPORTED_API MinimalArrayType( - MinimalArrayType&& x); - FASTDDS_EXPORTED_API MinimalArrayType& operator =( - const MinimalArrayType& x); - FASTDDS_EXPORTED_API MinimalArrayType& operator =( - MinimalArrayType&& x); - - FASTDDS_EXPORTED_API inline void collection_flag( - const CollectionTypeFlag& _collection_flag) - { - m_collection_flag = _collection_flag; - } - - FASTDDS_EXPORTED_API inline void collection_flag( - CollectionTypeFlag&& _collection_flag) - { - m_collection_flag = std::move(_collection_flag); - } - - FASTDDS_EXPORTED_API inline const CollectionTypeFlag& collection_flag() const - { - return m_collection_flag; - } - - FASTDDS_EXPORTED_API inline CollectionTypeFlag& collection_flag() - { - return m_collection_flag; - } - - FASTDDS_EXPORTED_API inline void header( - const MinimalArrayHeader& _header) - { - m_header = _header; - } - - FASTDDS_EXPORTED_API inline void header( - MinimalArrayHeader&& _header) - { - m_header = std::move(_header); - } - - FASTDDS_EXPORTED_API inline const MinimalArrayHeader& header() const - { - return m_header; - } - - FASTDDS_EXPORTED_API inline MinimalArrayHeader& header() - { - return m_header; - } - - FASTDDS_EXPORTED_API inline void element( - const MinimalCollectionElement& _element) - { - m_element = _element; - } - - FASTDDS_EXPORTED_API inline void element( - MinimalCollectionElement&& _element) - { - m_element = std::move(_element); - } - - FASTDDS_EXPORTED_API inline const MinimalCollectionElement& element() const - { - return m_element; - } - - FASTDDS_EXPORTED_API inline MinimalCollectionElement& element() - { - return m_element; - } - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalArrayType& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const MinimalArrayType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CollectionTypeFlag m_collection_flag; - MinimalArrayHeader m_header; - MinimalCollectionElement m_element; -}; - -// --- Map: ----------------------------------------------------- -/*struct CompleteMapType final{ - CollectionTypeFlag collection_flag; - CompleteCollectionHeader header; - CompleteCollectionElement key; - CompleteCollectionElement element; - };*/ -class CompleteMapType final -{ -public: - - FASTDDS_EXPORTED_API CompleteMapType(); - FASTDDS_EXPORTED_API ~CompleteMapType(); - FASTDDS_EXPORTED_API CompleteMapType( - const CompleteMapType& x); - FASTDDS_EXPORTED_API CompleteMapType( - CompleteMapType&& x); - FASTDDS_EXPORTED_API CompleteMapType& operator =( - const CompleteMapType& x); - FASTDDS_EXPORTED_API CompleteMapType& operator =( - CompleteMapType&& x); - - FASTDDS_EXPORTED_API inline void collection_flag( - const CollectionTypeFlag& _collection_flag) - { - m_collection_flag = _collection_flag; - } - - FASTDDS_EXPORTED_API inline void collection_flag( - CollectionTypeFlag&& _collection_flag) - { - m_collection_flag = std::move(_collection_flag); - } - - FASTDDS_EXPORTED_API inline const CollectionTypeFlag& collection_flag() const - { - return m_collection_flag; - } - - FASTDDS_EXPORTED_API inline CollectionTypeFlag& collection_flag() - { - return m_collection_flag; - } - - FASTDDS_EXPORTED_API inline void header( - const CompleteCollectionHeader& _header) - { - m_header = _header; - } - - FASTDDS_EXPORTED_API inline void header( - CompleteCollectionHeader&& _header) - { - m_header = std::move(_header); - } - - FASTDDS_EXPORTED_API inline const CompleteCollectionHeader& header() const - { - return m_header; - } - - FASTDDS_EXPORTED_API inline CompleteCollectionHeader& header() - { - return m_header; - } - - FASTDDS_EXPORTED_API inline void key( - const CompleteCollectionElement& _key) - { - m_key = _key; - } - - FASTDDS_EXPORTED_API inline void key( - CompleteCollectionElement&& _key) - { - m_key = std::move(_key); - } - - FASTDDS_EXPORTED_API inline const CompleteCollectionElement& key() const - { - return m_key; - } - - FASTDDS_EXPORTED_API inline CompleteCollectionElement& key() - { - return m_key; - } - - FASTDDS_EXPORTED_API inline void element( - const CompleteCollectionElement& _element) - { - m_element = _element; - } - - FASTDDS_EXPORTED_API inline void element( - CompleteCollectionElement&& _element) - { - m_element = std::move(_element); - } - - FASTDDS_EXPORTED_API inline const CompleteCollectionElement& element() const - { - return m_element; - } - - FASTDDS_EXPORTED_API inline CompleteCollectionElement& element() - { - return m_element; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteMapType& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CompleteMapType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CollectionTypeFlag m_collection_flag; - CompleteCollectionHeader m_header; - CompleteCollectionElement m_key; - CompleteCollectionElement m_element; -}; -/*struct MinimalMapType final{ - CollectionTypeFlag collection_flag; - MinimalCollectionHeader header; - MinimalCollectionElement key; - MinimalCollectionElement element; - };*/ -class MinimalMapType final -{ -public: - - FASTDDS_EXPORTED_API MinimalMapType(); - FASTDDS_EXPORTED_API ~MinimalMapType(); - FASTDDS_EXPORTED_API MinimalMapType( - const MinimalMapType& x); - FASTDDS_EXPORTED_API MinimalMapType( - MinimalMapType&& x); - FASTDDS_EXPORTED_API MinimalMapType& operator =( - const MinimalMapType& x); - FASTDDS_EXPORTED_API MinimalMapType& operator =( - MinimalMapType&& x); - - FASTDDS_EXPORTED_API inline void collection_flag( - const CollectionTypeFlag& _collection_flag) - { - m_collection_flag = _collection_flag; - } - - FASTDDS_EXPORTED_API inline void collection_flag( - CollectionTypeFlag&& _collection_flag) - { - m_collection_flag = std::move(_collection_flag); - } - - FASTDDS_EXPORTED_API inline const CollectionTypeFlag& collection_flag() const - { - return m_collection_flag; - } - - FASTDDS_EXPORTED_API inline CollectionTypeFlag& collection_flag() - { - return m_collection_flag; - } - - FASTDDS_EXPORTED_API inline void header( - const MinimalCollectionHeader& _header) - { - m_header = _header; - } - - FASTDDS_EXPORTED_API inline void header( - MinimalCollectionHeader&& _header) - { - m_header = std::move(_header); - } - - FASTDDS_EXPORTED_API inline const MinimalCollectionHeader& header() const - { - return m_header; - } - - FASTDDS_EXPORTED_API inline MinimalCollectionHeader& header() - { - return m_header; - } - - FASTDDS_EXPORTED_API inline void key( - const MinimalCollectionElement& _key) - { - m_key = _key; - } - - FASTDDS_EXPORTED_API inline void key( - MinimalCollectionElement&& _key) - { - m_key = std::move(_key); - } - - FASTDDS_EXPORTED_API inline const MinimalCollectionElement& key() const - { - return m_key; - } - - FASTDDS_EXPORTED_API inline MinimalCollectionElement& key() - { - return m_key; - } - - FASTDDS_EXPORTED_API inline void element( - const MinimalCollectionElement& _element) - { - m_element = _element; - } - - FASTDDS_EXPORTED_API inline void element( - MinimalCollectionElement&& _element) - { - m_element = std::move(_element); - } - - FASTDDS_EXPORTED_API inline const MinimalCollectionElement& element() const - { - return m_element; - } - - FASTDDS_EXPORTED_API inline MinimalCollectionElement& element() - { - return m_element; - } - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalMapType& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const MinimalMapType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CollectionTypeFlag m_collection_flag; - MinimalCollectionHeader m_header; - MinimalCollectionElement m_key; - MinimalCollectionElement m_element; -}; - -// --- Enumeration: --------------------------------------------------- -typedef uint16_t BitBound; - -// Constant in an enumerated type - -/*struct CommonEnumeratedLiteral { - int32_t value; - EnumeratedLiteralFlag flags; - };*/ -class CommonEnumeratedLiteral -{ -public: - - FASTDDS_EXPORTED_API CommonEnumeratedLiteral(); - FASTDDS_EXPORTED_API ~CommonEnumeratedLiteral(); - FASTDDS_EXPORTED_API CommonEnumeratedLiteral( - const CommonEnumeratedLiteral& x); - FASTDDS_EXPORTED_API CommonEnumeratedLiteral( - CommonEnumeratedLiteral&& x); - FASTDDS_EXPORTED_API CommonEnumeratedLiteral& operator =( - const CommonEnumeratedLiteral& x); - FASTDDS_EXPORTED_API CommonEnumeratedLiteral& operator =( - CommonEnumeratedLiteral&& x); - - FASTDDS_EXPORTED_API inline void value( - const int32_t& _value) - { - m_value = _value; - } - - FASTDDS_EXPORTED_API inline void value( - int32_t&& _value) - { - m_value = std::move(_value); - } - - FASTDDS_EXPORTED_API inline const int32_t& value() const - { - return m_value; - } - - FASTDDS_EXPORTED_API inline int32_t& value() - { - return m_value; - } - - FASTDDS_EXPORTED_API inline void flags( - const EnumeratedLiteralFlag& _flags) - { - m_flags = _flags; - } - - FASTDDS_EXPORTED_API inline void flags( - EnumeratedLiteralFlag&& _flags) - { - m_flags = std::move(_flags); - } - - FASTDDS_EXPORTED_API inline const EnumeratedLiteralFlag& flags() const - { - return m_flags; - } - - FASTDDS_EXPORTED_API inline EnumeratedLiteralFlag& flags() - { - return m_flags; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CommonEnumeratedLiteral& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CommonEnumeratedLiteral& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - int32_t m_value; - EnumeratedLiteralFlag m_flags; -}; - -// Constant in an enumerated type - -/*struct CompleteEnumeratedLiteral { - CommonEnumeratedLiteral common; - CompleteMemberDetail detail; - };*/ -class CompleteEnumeratedLiteral -{ -public: - - FASTDDS_EXPORTED_API CompleteEnumeratedLiteral(); - FASTDDS_EXPORTED_API ~CompleteEnumeratedLiteral(); - FASTDDS_EXPORTED_API CompleteEnumeratedLiteral( - const CompleteEnumeratedLiteral& x); - FASTDDS_EXPORTED_API CompleteEnumeratedLiteral( - CompleteEnumeratedLiteral&& x); - FASTDDS_EXPORTED_API CompleteEnumeratedLiteral& operator =( - const CompleteEnumeratedLiteral& x); - FASTDDS_EXPORTED_API CompleteEnumeratedLiteral& operator =( - CompleteEnumeratedLiteral&& x); - - FASTDDS_EXPORTED_API inline void common( - const CommonEnumeratedLiteral& _common) - { - m_common = _common; - } - - FASTDDS_EXPORTED_API inline void common( - CommonEnumeratedLiteral&& _common) - { - m_common = std::move(_common); - } - - FASTDDS_EXPORTED_API inline const CommonEnumeratedLiteral& common() const - { - return m_common; - } - - FASTDDS_EXPORTED_API inline CommonEnumeratedLiteral& common() - { - return m_common; - } - - FASTDDS_EXPORTED_API inline void detail( - const CompleteMemberDetail& _detail) - { - m_detail = _detail; - } - - FASTDDS_EXPORTED_API inline void detail( - CompleteMemberDetail&& _detail) - { - m_detail = std::move(_detail); - } - - FASTDDS_EXPORTED_API inline const CompleteMemberDetail& detail() const - { - return m_detail; - } - - FASTDDS_EXPORTED_API inline CompleteMemberDetail& detail() - { - return m_detail; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteEnumeratedLiteral& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CompleteEnumeratedLiteral& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonEnumeratedLiteral m_common; - CompleteMemberDetail m_detail; -}; -// Ordered by EnumeratedLiteral.common.value -typedef std::vector CompleteEnumeratedLiteralSeq; - -// Constant in an enumerated type - -/*struct MinimalEnumeratedLiteral { - CommonEnumeratedLiteral common; - MinimalMemberDetail detail; - };*/ -class MinimalEnumeratedLiteral -{ -public: - - FASTDDS_EXPORTED_API MinimalEnumeratedLiteral(); - FASTDDS_EXPORTED_API ~MinimalEnumeratedLiteral(); - FASTDDS_EXPORTED_API MinimalEnumeratedLiteral( - const MinimalEnumeratedLiteral& x); - FASTDDS_EXPORTED_API MinimalEnumeratedLiteral( - MinimalEnumeratedLiteral&& x); - FASTDDS_EXPORTED_API MinimalEnumeratedLiteral& operator =( - const MinimalEnumeratedLiteral& x); - FASTDDS_EXPORTED_API MinimalEnumeratedLiteral& operator =( - MinimalEnumeratedLiteral&& x); - - FASTDDS_EXPORTED_API inline void common( - const CommonEnumeratedLiteral& _common) - { - m_common = _common; - } - - FASTDDS_EXPORTED_API inline void common( - CommonEnumeratedLiteral&& _common) - { - m_common = std::move(_common); - } - - FASTDDS_EXPORTED_API inline const CommonEnumeratedLiteral& common() const - { - return m_common; - } - - FASTDDS_EXPORTED_API inline CommonEnumeratedLiteral& common() - { - return m_common; - } - - FASTDDS_EXPORTED_API inline void detail( - const MinimalMemberDetail& _detail) - { - m_detail = _detail; - } - - FASTDDS_EXPORTED_API inline void detail( - MinimalMemberDetail&& _detail) - { - m_detail = std::move(_detail); - } - - FASTDDS_EXPORTED_API inline const MinimalMemberDetail& detail() const - { - return m_detail; - } - - FASTDDS_EXPORTED_API inline MinimalMemberDetail& detail() - { - return m_detail; - } - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalEnumeratedLiteral& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const MinimalEnumeratedLiteral& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonEnumeratedLiteral m_common; - MinimalMemberDetail m_detail; -}; - -// Ordered by EnumeratedLiteral.common.value -typedef std::vector MinimalEnumeratedLiteralSeq; - -/*struct CommonEnumeratedHeader final{ - BitBound bit_bound; - };*/ -class CommonEnumeratedHeader final -{ -public: - - FASTDDS_EXPORTED_API CommonEnumeratedHeader(); - FASTDDS_EXPORTED_API ~CommonEnumeratedHeader(); - FASTDDS_EXPORTED_API CommonEnumeratedHeader( - const CommonEnumeratedHeader& x); - FASTDDS_EXPORTED_API CommonEnumeratedHeader( - CommonEnumeratedHeader&& x); - FASTDDS_EXPORTED_API CommonEnumeratedHeader& operator =( - const CommonEnumeratedHeader& x); - FASTDDS_EXPORTED_API CommonEnumeratedHeader& operator =( - CommonEnumeratedHeader&& x); - - FASTDDS_EXPORTED_API inline void bit_bound( - const BitBound& _bit_bound) - { - m_bit_bound = _bit_bound; - } - - FASTDDS_EXPORTED_API inline void bit_bound( - BitBound&& _bit_bound) - { - m_bit_bound = std::move(_bit_bound); - } - - FASTDDS_EXPORTED_API inline const BitBound& bit_bound() const - { - return m_bit_bound; - } - - FASTDDS_EXPORTED_API inline BitBound& bit_bound() - { - return m_bit_bound; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CommonEnumeratedHeader& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CommonEnumeratedHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - BitBound m_bit_bound; -}; - -/*struct CompleteEnumeratedHeader { - CommonEnumeratedHeader common; - CompleteTypeDetail detail; - };*/ -class CompleteEnumeratedHeader -{ -public: - - FASTDDS_EXPORTED_API CompleteEnumeratedHeader(); - FASTDDS_EXPORTED_API ~CompleteEnumeratedHeader(); - FASTDDS_EXPORTED_API CompleteEnumeratedHeader( - const CompleteEnumeratedHeader& x); - FASTDDS_EXPORTED_API CompleteEnumeratedHeader( - CompleteEnumeratedHeader&& x); - FASTDDS_EXPORTED_API CompleteEnumeratedHeader& operator =( - const CompleteEnumeratedHeader& x); - FASTDDS_EXPORTED_API CompleteEnumeratedHeader& operator =( - CompleteEnumeratedHeader&& x); - - FASTDDS_EXPORTED_API inline void common( - const CommonEnumeratedHeader& _common) - { - m_common = _common; - } - - FASTDDS_EXPORTED_API inline void common( - CommonEnumeratedHeader&& _common) - { - m_common = std::move(_common); - } - - FASTDDS_EXPORTED_API inline const CommonEnumeratedHeader& common() const - { - return m_common; - } - - FASTDDS_EXPORTED_API inline CommonEnumeratedHeader& common() - { - return m_common; - } - - FASTDDS_EXPORTED_API inline void detail( - const CompleteTypeDetail& _detail) - { - m_detail = _detail; - } - - FASTDDS_EXPORTED_API inline void detail( - CompleteTypeDetail&& _detail) - { - m_detail = std::move(_detail); - } - - FASTDDS_EXPORTED_API inline const CompleteTypeDetail& detail() const - { - return m_detail; - } - - FASTDDS_EXPORTED_API inline CompleteTypeDetail& detail() - { - return m_detail; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteEnumeratedHeader& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CompleteEnumeratedHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonEnumeratedHeader m_common; - CompleteTypeDetail m_detail; -}; - -/*struct MinimalEnumeratedHeader { - CommonEnumeratedHeader common; - };*/ -class MinimalEnumeratedHeader -{ -public: - - FASTDDS_EXPORTED_API MinimalEnumeratedHeader(); - FASTDDS_EXPORTED_API ~MinimalEnumeratedHeader(); - FASTDDS_EXPORTED_API MinimalEnumeratedHeader( - const MinimalEnumeratedHeader& x); - FASTDDS_EXPORTED_API MinimalEnumeratedHeader( - MinimalEnumeratedHeader&& x); - FASTDDS_EXPORTED_API MinimalEnumeratedHeader& operator =( - const MinimalEnumeratedHeader& x); - FASTDDS_EXPORTED_API MinimalEnumeratedHeader& operator =( - MinimalEnumeratedHeader&& x); - - FASTDDS_EXPORTED_API inline void common( - const CommonEnumeratedHeader& _common) - { - m_common = _common; - } - - FASTDDS_EXPORTED_API inline void common( - CommonEnumeratedHeader&& _common) - { - m_common = std::move(_common); - } - - FASTDDS_EXPORTED_API inline const CommonEnumeratedHeader& common() const - { - return m_common; - } - - FASTDDS_EXPORTED_API inline CommonEnumeratedHeader& common() - { - return m_common; - } - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalEnumeratedHeader& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const MinimalEnumeratedHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonEnumeratedHeader m_common; -}; - -// Enumerated type -/*struct CompleteEnumeratedType final{ - EnumTypeFlag enum_flags; // unused - CompleteEnumeratedHeader header; - CompleteEnumeratedLiteralSeq literal_seq; - };*/ -class CompleteEnumeratedType -{ -public: - - FASTDDS_EXPORTED_API CompleteEnumeratedType(); - FASTDDS_EXPORTED_API ~CompleteEnumeratedType(); - FASTDDS_EXPORTED_API CompleteEnumeratedType( - const CompleteEnumeratedType& x); - FASTDDS_EXPORTED_API CompleteEnumeratedType( - CompleteEnumeratedType&& x); - FASTDDS_EXPORTED_API CompleteEnumeratedType& operator =( - const CompleteEnumeratedType& x); - FASTDDS_EXPORTED_API CompleteEnumeratedType& operator =( - CompleteEnumeratedType&& x); - - FASTDDS_EXPORTED_API inline void enum_flags( - const EnumTypeFlag& _enum_flags) - { - m_enum_flags = _enum_flags; - } - - FASTDDS_EXPORTED_API inline void enum_flags( - EnumTypeFlag&& _enum_flags) - { - m_enum_flags = std::move(_enum_flags); - } - - FASTDDS_EXPORTED_API inline const EnumTypeFlag& enum_flags() const - { - return m_enum_flags; - } - - FASTDDS_EXPORTED_API inline EnumTypeFlag& enum_flags() - { - return m_enum_flags; - } - - FASTDDS_EXPORTED_API inline void header( - const CompleteEnumeratedHeader& _header) - { - m_header = _header; - } - - FASTDDS_EXPORTED_API inline void header( - CompleteEnumeratedHeader&& _header) - { - m_header = std::move(_header); - } - - FASTDDS_EXPORTED_API inline const CompleteEnumeratedHeader& header() const - { - return m_header; - } - - FASTDDS_EXPORTED_API inline CompleteEnumeratedHeader& header() - { - return m_header; - } - - FASTDDS_EXPORTED_API inline void literal_seq( - const CompleteEnumeratedLiteralSeq& _literal_seq) - { - m_literal_seq = _literal_seq; - } - - FASTDDS_EXPORTED_API inline void literal_seq( - CompleteEnumeratedLiteralSeq&& _literal_seq) - { - m_literal_seq = std::move(_literal_seq); - } - - FASTDDS_EXPORTED_API inline const CompleteEnumeratedLiteralSeq& literal_seq() const - { - return m_literal_seq; - } - - FASTDDS_EXPORTED_API inline CompleteEnumeratedLiteralSeq& literal_seq() - { - return m_literal_seq; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteEnumeratedType& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CompleteEnumeratedType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - EnumTypeFlag m_enum_flags; - CompleteEnumeratedHeader m_header; - CompleteEnumeratedLiteralSeq m_literal_seq; -}; -// Enumerated type -/*struct MinimalEnumeratedType final{ - EnumTypeFlag enum_flags; // unused - MinimalEnumeratedHeader header; - MinimalEnumeratedLiteralSeq literal_seq; - };*/ -class MinimalEnumeratedType -{ -public: - - FASTDDS_EXPORTED_API MinimalEnumeratedType(); - FASTDDS_EXPORTED_API ~MinimalEnumeratedType(); - FASTDDS_EXPORTED_API MinimalEnumeratedType( - const MinimalEnumeratedType& x); - FASTDDS_EXPORTED_API MinimalEnumeratedType( - MinimalEnumeratedType&& x); - FASTDDS_EXPORTED_API MinimalEnumeratedType& operator =( - const MinimalEnumeratedType& x); - FASTDDS_EXPORTED_API MinimalEnumeratedType& operator =( - MinimalEnumeratedType&& x); - - FASTDDS_EXPORTED_API inline void enum_flags( - const EnumTypeFlag& _enum_flags) - { - m_enum_flags = _enum_flags; - } - - FASTDDS_EXPORTED_API inline void enum_flags( - EnumTypeFlag&& _enum_flags) - { - m_enum_flags = std::move(_enum_flags); - } - - FASTDDS_EXPORTED_API inline const EnumTypeFlag& enum_flags() const - { - return m_enum_flags; - } - - FASTDDS_EXPORTED_API inline EnumTypeFlag& enum_flags() - { - return m_enum_flags; - } - - FASTDDS_EXPORTED_API inline void header( - const MinimalEnumeratedHeader& _header) - { - m_header = _header; - } - - FASTDDS_EXPORTED_API inline void header( - MinimalEnumeratedHeader&& _header) - { - m_header = std::move(_header); - } - - FASTDDS_EXPORTED_API inline const MinimalEnumeratedHeader& header() const - { - return m_header; - } - - FASTDDS_EXPORTED_API inline MinimalEnumeratedHeader& header() - { - return m_header; - } - - FASTDDS_EXPORTED_API inline void literal_seq( - const MinimalEnumeratedLiteralSeq& _literal_seq) - { - m_literal_seq = _literal_seq; - } - - FASTDDS_EXPORTED_API inline void literal_seq( - MinimalEnumeratedLiteralSeq&& _literal_seq) - { - m_literal_seq = std::move(_literal_seq); - } - - FASTDDS_EXPORTED_API inline const MinimalEnumeratedLiteralSeq& literal_seq() const - { - return m_literal_seq; - } - - FASTDDS_EXPORTED_API inline MinimalEnumeratedLiteralSeq& literal_seq() - { - return m_literal_seq; - } - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalEnumeratedType& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const MinimalEnumeratedType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - EnumTypeFlag m_enum_flags; - MinimalEnumeratedHeader m_header; - MinimalEnumeratedLiteralSeq m_literal_seq; -}; - -// --- Bitmask: ------------------------------------------------------- -// Bit in a bit mask -/*struct CommonBitflag final{ - uint16_t position; - BitflagFlag flags; - };*/ -class CommonBitflag final -{ -public: - - FASTDDS_EXPORTED_API CommonBitflag(); - FASTDDS_EXPORTED_API ~CommonBitflag(); - FASTDDS_EXPORTED_API CommonBitflag( - const CommonBitflag& x); - FASTDDS_EXPORTED_API CommonBitflag( - CommonBitflag&& x); - FASTDDS_EXPORTED_API CommonBitflag& operator =( - const CommonBitflag& x); - FASTDDS_EXPORTED_API CommonBitflag& operator =( - CommonBitflag&& x); - - FASTDDS_EXPORTED_API inline void position( - const uint16_t& _position) - { - m_position = _position; - } - - FASTDDS_EXPORTED_API inline void position( - uint16_t&& _position) - { - m_position = std::move(_position); - } - - FASTDDS_EXPORTED_API inline const uint16_t& position() const - { - return m_position; - } - - FASTDDS_EXPORTED_API inline uint16_t& position() - { - return m_position; - } - - FASTDDS_EXPORTED_API inline void flags( - const BitflagFlag& _flags) - { - m_flags = _flags; - } - - FASTDDS_EXPORTED_API inline void flags( - BitflagFlag&& _flags) - { - m_flags = std::move(_flags); - } - - FASTDDS_EXPORTED_API inline const BitflagFlag& flags() const - { - return m_flags; - } - - FASTDDS_EXPORTED_API inline BitflagFlag& flags() - { - return m_flags; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CommonBitflag& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CommonBitflag& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - uint16_t m_position; - BitflagFlag m_flags; -}; - -/*struct CompleteBitflag { - CommonBitflag common; - CompleteMemberDetail detail; - };*/ -class CompleteBitflag -{ -public: - - FASTDDS_EXPORTED_API CompleteBitflag(); - FASTDDS_EXPORTED_API ~CompleteBitflag(); - FASTDDS_EXPORTED_API CompleteBitflag( - const CompleteBitflag& x); - FASTDDS_EXPORTED_API CompleteBitflag( - CompleteBitflag&& x); - FASTDDS_EXPORTED_API CompleteBitflag& operator =( - const CompleteBitflag& x); - FASTDDS_EXPORTED_API CompleteBitflag& operator =( - CompleteBitflag&& x); - - FASTDDS_EXPORTED_API inline void common( - const CommonBitflag& _common) - { - m_common = _common; - } - - FASTDDS_EXPORTED_API inline void common( - CommonBitflag&& _common) - { - m_common = std::move(_common); - } - - FASTDDS_EXPORTED_API inline const CommonBitflag& common() const - { - return m_common; - } - - FASTDDS_EXPORTED_API inline CommonBitflag& common() - { - return m_common; - } - - FASTDDS_EXPORTED_API inline void detail( - const CompleteMemberDetail& _detail) - { - m_detail = _detail; - } - - FASTDDS_EXPORTED_API inline void detail( - CompleteMemberDetail&& _detail) - { - m_detail = std::move(_detail); - } - - FASTDDS_EXPORTED_API inline const CompleteMemberDetail& detail() const - { - return m_detail; - } - - FASTDDS_EXPORTED_API inline CompleteMemberDetail& detail() - { - return m_detail; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteBitflag& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CompleteBitflag& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonBitflag m_common; - CompleteMemberDetail m_detail; -}; -// Ordered by Bitflag.position -typedef std::vector CompleteBitflagSeq; -/*struct MinimalBitflag { - CommonBitflag common; - MinimalMemberDetail detail; - };*/ -class MinimalBitflag -{ -public: - - FASTDDS_EXPORTED_API MinimalBitflag(); - FASTDDS_EXPORTED_API ~MinimalBitflag(); - FASTDDS_EXPORTED_API MinimalBitflag( - const MinimalBitflag& x); - FASTDDS_EXPORTED_API MinimalBitflag( - MinimalBitflag&& x); - FASTDDS_EXPORTED_API MinimalBitflag& operator =( - const MinimalBitflag& x); - FASTDDS_EXPORTED_API MinimalBitflag& operator =( - MinimalBitflag&& x); - - FASTDDS_EXPORTED_API inline void common( - const CommonBitflag& _common) - { - m_common = _common; - } - - FASTDDS_EXPORTED_API inline void common( - CommonBitflag&& _common) - { - m_common = std::move(_common); - } - - FASTDDS_EXPORTED_API inline const CommonBitflag& common() const - { - return m_common; - } - - FASTDDS_EXPORTED_API inline CommonBitflag& common() - { - return m_common; - } - - FASTDDS_EXPORTED_API inline void detail( - const MinimalMemberDetail& _detail) - { - m_detail = _detail; - } - - FASTDDS_EXPORTED_API inline void detail( - MinimalMemberDetail&& _detail) - { - m_detail = std::move(_detail); - } - - FASTDDS_EXPORTED_API inline const MinimalMemberDetail& detail() const - { - return m_detail; - } - - FASTDDS_EXPORTED_API inline MinimalMemberDetail& detail() - { - return m_detail; - } - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalBitflag& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const MinimalBitflag& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonBitflag m_common; - MinimalMemberDetail m_detail; -}; - -// Ordered by Bitflag.position -typedef std::vector MinimalBitflagSeq; - -/*struct CommonBitmaskHeader final{ - BitBound bit_bound; - };*/ -class CommonBitmaskHeader final -{ -public: - - FASTDDS_EXPORTED_API CommonBitmaskHeader(); - FASTDDS_EXPORTED_API ~CommonBitmaskHeader(); - FASTDDS_EXPORTED_API CommonBitmaskHeader( - const CommonBitmaskHeader& x); - FASTDDS_EXPORTED_API CommonBitmaskHeader( - CommonBitmaskHeader&& x); - FASTDDS_EXPORTED_API CommonBitmaskHeader& operator =( - const CommonBitmaskHeader& x); - FASTDDS_EXPORTED_API CommonBitmaskHeader& operator =( - CommonBitmaskHeader&& x); - - FASTDDS_EXPORTED_API inline void bit_bound( - const BitBound& _bit_bound) - { - m_bit_bound = _bit_bound; - } - - FASTDDS_EXPORTED_API inline void bit_bound( - BitBound&& _bit_bound) - { - m_bit_bound = std::move(_bit_bound); - } - - FASTDDS_EXPORTED_API inline const BitBound& bit_bound() const - { - return m_bit_bound; - } - - FASTDDS_EXPORTED_API inline BitBound& bit_bound() - { - return m_bit_bound; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CommonBitmaskHeader& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CommonBitmaskHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - BitBound m_bit_bound; -}; -typedef CompleteEnumeratedHeader CompleteBitmaskHeader; - -typedef MinimalEnumeratedHeader MinimalBitmaskHeader; -/*struct CompleteBitmaskType { - BitmaskTypeFlag bitmask_flags; // unused - CompleteBitmaskHeader header; - CompleteBitflagSeq flag_seq; - };*/ -class CompleteBitmaskType -{ -public: - - FASTDDS_EXPORTED_API CompleteBitmaskType(); - FASTDDS_EXPORTED_API ~CompleteBitmaskType(); - FASTDDS_EXPORTED_API CompleteBitmaskType( - const CompleteBitmaskType& x); - FASTDDS_EXPORTED_API CompleteBitmaskType( - CompleteBitmaskType&& x); - FASTDDS_EXPORTED_API CompleteBitmaskType& operator =( - const CompleteBitmaskType& x); - FASTDDS_EXPORTED_API CompleteBitmaskType& operator =( - CompleteBitmaskType&& x); - - FASTDDS_EXPORTED_API inline void bitmask_flags( - const BitmaskTypeFlag& _bitmask_flags) - { - m_bitmask_flags = _bitmask_flags; - } - - FASTDDS_EXPORTED_API inline void bitmask_flags( - BitmaskTypeFlag&& _bitmask_flags) - { - m_bitmask_flags = std::move(_bitmask_flags); - } - - FASTDDS_EXPORTED_API inline const BitmaskTypeFlag& bitmask_flags() const - { - return m_bitmask_flags; - } - - FASTDDS_EXPORTED_API inline BitmaskTypeFlag& bitmask_flags() - { - return m_bitmask_flags; - } - - FASTDDS_EXPORTED_API inline void header( - const CompleteBitmaskHeader& _header) - { - m_header = _header; - } - - FASTDDS_EXPORTED_API inline void header( - CompleteBitmaskHeader&& _header) - { - m_header = std::move(_header); - } - - FASTDDS_EXPORTED_API inline const CompleteBitmaskHeader& header() const - { - return m_header; - } - - FASTDDS_EXPORTED_API inline CompleteBitmaskHeader& header() - { - return m_header; - } - - FASTDDS_EXPORTED_API inline void flag_seq( - const CompleteBitflagSeq& _flag_seq) - { - m_flag_seq = _flag_seq; - } - - FASTDDS_EXPORTED_API inline void flag_seq( - CompleteBitflagSeq&& _flag_seq) - { - m_flag_seq = std::move(_flag_seq); - } - - FASTDDS_EXPORTED_API inline const CompleteBitflagSeq& flag_seq() const - { - return m_flag_seq; - } - - FASTDDS_EXPORTED_API inline CompleteBitflagSeq& flag_seq() - { - return m_flag_seq; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteBitmaskType& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CompleteBitmaskType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - BitmaskTypeFlag m_bitmask_flags; - CompleteBitmaskHeader m_header; - CompleteBitflagSeq m_flag_seq; -}; - -/*struct MinimalBitmaskType { - BitmaskTypeFlag bitmask_flags; // unused - MinimalBitmaskHeader header; - MinimalBitflagSeq flag_seq; - };*/ -class MinimalBitmaskType -{ -public: - - FASTDDS_EXPORTED_API MinimalBitmaskType(); - FASTDDS_EXPORTED_API ~MinimalBitmaskType(); - FASTDDS_EXPORTED_API MinimalBitmaskType( - const MinimalBitmaskType& x); - FASTDDS_EXPORTED_API MinimalBitmaskType( - MinimalBitmaskType&& x); - FASTDDS_EXPORTED_API MinimalBitmaskType& operator =( - const MinimalBitmaskType& x); - FASTDDS_EXPORTED_API MinimalBitmaskType& operator =( - MinimalBitmaskType&& x); - - FASTDDS_EXPORTED_API inline void bitmask_flags( - const BitmaskTypeFlag& _bitmask_flags) - { - m_bitmask_flags = _bitmask_flags; - } - - FASTDDS_EXPORTED_API inline void bitmask_flags( - BitmaskTypeFlag&& _bitmask_flags) - { - m_bitmask_flags = std::move(_bitmask_flags); - } - - FASTDDS_EXPORTED_API inline const BitmaskTypeFlag& bitmask_flags() const - { - return m_bitmask_flags; - } - - FASTDDS_EXPORTED_API inline BitmaskTypeFlag& bitmask_flags() - { - return m_bitmask_flags; - } - - FASTDDS_EXPORTED_API inline void header( - const MinimalBitmaskHeader& _header) - { - m_header = _header; - } - - FASTDDS_EXPORTED_API inline void header( - MinimalBitmaskHeader&& _header) - { - m_header = std::move(_header); - } - - FASTDDS_EXPORTED_API inline const MinimalBitmaskHeader& header() const - { - return m_header; - } - - FASTDDS_EXPORTED_API inline MinimalBitmaskHeader& header() - { - return m_header; - } - - FASTDDS_EXPORTED_API inline void flag_seq( - const MinimalBitflagSeq& _flag_seq) - { - m_flag_seq = _flag_seq; - } - - FASTDDS_EXPORTED_API inline void flag_seq( - MinimalBitflagSeq&& _flag_seq) - { - m_flag_seq = std::move(_flag_seq); - } - - FASTDDS_EXPORTED_API inline const MinimalBitflagSeq& flag_seq() const - { - return m_flag_seq; - } - - FASTDDS_EXPORTED_API inline MinimalBitflagSeq& flag_seq() - { - return m_flag_seq; - } - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalBitmaskType& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const MinimalBitmaskType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - BitmaskTypeFlag m_bitmask_flags; - MinimalBitmaskHeader m_header; - MinimalBitflagSeq m_flag_seq; -}; - -// --- Bitset: --------------------------------------------------------- -/*struct CommonBitfield final{ - uint16_t position; - BitsetMemberFlag flags; - octet bitcount; - TypeKind holder_type; // Must be primitive integer type - };*/ -class CommonBitfield final -{ -public: - - FASTDDS_EXPORTED_API CommonBitfield(); - FASTDDS_EXPORTED_API ~CommonBitfield(); - FASTDDS_EXPORTED_API CommonBitfield( - const CommonBitfield& x); - FASTDDS_EXPORTED_API CommonBitfield( - CommonBitfield&& x); - FASTDDS_EXPORTED_API CommonBitfield& operator =( - const CommonBitfield& x); - FASTDDS_EXPORTED_API CommonBitfield& operator =( - CommonBitfield&& x); - - FASTDDS_EXPORTED_API inline void position( - const uint16_t& _position) - { - m_position = _position; - } - - FASTDDS_EXPORTED_API inline void position( - uint16_t&& _position) - { - m_position = std::move(_position); - } - - FASTDDS_EXPORTED_API inline const uint16_t& position() const - { - return m_position; - } - - FASTDDS_EXPORTED_API inline uint16_t& position() - { - return m_position; - } - - FASTDDS_EXPORTED_API inline void flags( - const BitsetMemberFlag& _flags) - { - m_flags = _flags; - } - - FASTDDS_EXPORTED_API inline void flags( - BitsetMemberFlag&& _flags) - { - m_flags = std::move(_flags); - } - - FASTDDS_EXPORTED_API inline const BitsetMemberFlag& flags() const - { - return m_flags; - } - - FASTDDS_EXPORTED_API inline BitsetMemberFlag& flags() - { - return m_flags; - } - - FASTDDS_EXPORTED_API inline void bitcount( - const octet& _bitcount) - { - m_bitcount = _bitcount; - } - - FASTDDS_EXPORTED_API inline void bitcount( - octet&& _bitcount) - { - m_bitcount = std::move(_bitcount); - } - - FASTDDS_EXPORTED_API inline const octet& bitcount() const - { - return m_bitcount; - } - - FASTDDS_EXPORTED_API inline octet& bitcount() - { - return m_bitcount; - } - - FASTDDS_EXPORTED_API inline void holder_type( - const TypeKind& _holder_type) - { - m_holder_type = _holder_type; - } - - FASTDDS_EXPORTED_API inline void holder_type( - TypeKind&& _holder_type) - { - m_holder_type = std::move(_holder_type); - } - - FASTDDS_EXPORTED_API inline const TypeKind& holder_type() const - { - return m_holder_type; - } - - FASTDDS_EXPORTED_API inline TypeKind& holder_type() - { - return m_holder_type; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CommonBitfield& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CommonBitfield& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - uint16_t m_position; - BitsetMemberFlag m_flags; - octet m_bitcount; - TypeKind m_holder_type; -}; - -/*struct CompleteBitfield { - CommonBitfield common; - CompleteMemberDetail detail; - };*/ -class CompleteBitfield -{ -public: - - FASTDDS_EXPORTED_API CompleteBitfield(); - FASTDDS_EXPORTED_API ~CompleteBitfield(); - FASTDDS_EXPORTED_API CompleteBitfield( - const CompleteBitfield& x); - FASTDDS_EXPORTED_API CompleteBitfield( - CompleteBitfield&& x); - FASTDDS_EXPORTED_API CompleteBitfield& operator =( - const CompleteBitfield& x); - FASTDDS_EXPORTED_API CompleteBitfield& operator =( - CompleteBitfield&& x); - - FASTDDS_EXPORTED_API inline void common( - const CommonBitfield& _common) - { - m_common = _common; - } - - FASTDDS_EXPORTED_API inline void common( - CommonBitfield&& _common) - { - m_common = std::move(_common); - } - - FASTDDS_EXPORTED_API inline const CommonBitfield& common() const - { - return m_common; - } - - FASTDDS_EXPORTED_API inline CommonBitfield& common() - { - return m_common; - } - - FASTDDS_EXPORTED_API inline void detail( - const CompleteMemberDetail& _detail) - { - m_detail = _detail; - } - - FASTDDS_EXPORTED_API inline void detail( - CompleteMemberDetail&& _detail) - { - m_detail = std::move(_detail); - } - - FASTDDS_EXPORTED_API inline const CompleteMemberDetail& detail() const - { - return m_detail; - } - - FASTDDS_EXPORTED_API inline CompleteMemberDetail& detail() - { - return m_detail; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteBitfield& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CompleteBitfield& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonBitfield m_common; - CompleteMemberDetail m_detail; -}; -// Ordered by Bitfield.position -typedef std::vector CompleteBitfieldSeq; -/*struct MinimalBitfield { - CommonBitfield common; - NameHash name_hash; - };*/ -class MinimalBitfield -{ -public: - - FASTDDS_EXPORTED_API MinimalBitfield(); - FASTDDS_EXPORTED_API ~MinimalBitfield(); - FASTDDS_EXPORTED_API MinimalBitfield( - const MinimalBitfield& x); - FASTDDS_EXPORTED_API MinimalBitfield( - MinimalBitfield&& x); - FASTDDS_EXPORTED_API MinimalBitfield& operator =( - const MinimalBitfield& x); - FASTDDS_EXPORTED_API MinimalBitfield& operator =( - MinimalBitfield&& x); - - FASTDDS_EXPORTED_API inline void name_hash( - const NameHash& _name_hash) - { - m_name_hash = _name_hash; - } - - FASTDDS_EXPORTED_API inline void name_hash( - NameHash&& _name_hash) - { - m_name_hash = std::move(_name_hash); - } - - FASTDDS_EXPORTED_API inline const NameHash& name_hash() const - { - return m_name_hash; - } - - FASTDDS_EXPORTED_API inline NameHash& name_hash() - { - return m_name_hash; - } - - FASTDDS_EXPORTED_API inline void common( - const CommonBitfield& _common) - { - m_common = _common; - } - - FASTDDS_EXPORTED_API inline void common( - CommonBitfield&& _common) - { - m_common = std::move(_common); - } - - FASTDDS_EXPORTED_API inline const CommonBitfield& common() const - { - return m_common; - } - - FASTDDS_EXPORTED_API inline CommonBitfield& common() - { - return m_common; - } - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalBitfield& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const MinimalBitfield& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - CommonBitfield m_common; - NameHash m_name_hash; -}; -// Ordered by Bitfield.position -typedef std::vector MinimalBitfieldSeq; -/*struct CompleteBitsetHeader { - CompleteTypeDetail detail; - };*/ -class CompleteBitsetHeader -{ -public: - - FASTDDS_EXPORTED_API CompleteBitsetHeader(); - FASTDDS_EXPORTED_API ~CompleteBitsetHeader(); - FASTDDS_EXPORTED_API CompleteBitsetHeader( - const CompleteBitsetHeader& x); - FASTDDS_EXPORTED_API CompleteBitsetHeader( - CompleteBitsetHeader&& x); - FASTDDS_EXPORTED_API CompleteBitsetHeader& operator =( - const CompleteBitsetHeader& x); - FASTDDS_EXPORTED_API CompleteBitsetHeader& operator =( - CompleteBitsetHeader&& x); - - FASTDDS_EXPORTED_API inline void base_type( - const TypeIdentifier& _base_type) - { - m_base_type = _base_type; - } - - FASTDDS_EXPORTED_API inline void base_type( - TypeIdentifier&& _base_type) - { - m_base_type = std::move(_base_type); - } - - FASTDDS_EXPORTED_API inline const TypeIdentifier& base_type() const - { - return m_base_type; - } - - FASTDDS_EXPORTED_API inline TypeIdentifier& base_type() - { - return m_base_type; - } - - FASTDDS_EXPORTED_API inline void detail( - const CompleteTypeDetail& _detail) - { - m_detail = _detail; - } - - FASTDDS_EXPORTED_API inline void detail( - CompleteTypeDetail&& _detail) - { - m_detail = std::move(_detail); - } - - FASTDDS_EXPORTED_API inline const CompleteTypeDetail& detail() const - { - return m_detail; - } - - FASTDDS_EXPORTED_API inline CompleteTypeDetail& detail() - { - return m_detail; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteBitsetHeader& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CompleteBitsetHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - TypeIdentifier m_base_type; - CompleteTypeDetail m_detail; -}; - -/*struct MinimalBitsetHeader { - // Empty. Available for future extension - };*/ -class MinimalBitsetHeader -{ -public: - - FASTDDS_EXPORTED_API MinimalBitsetHeader(); - FASTDDS_EXPORTED_API ~MinimalBitsetHeader(); - FASTDDS_EXPORTED_API MinimalBitsetHeader( - const MinimalBitsetHeader& x); - FASTDDS_EXPORTED_API MinimalBitsetHeader( - MinimalBitsetHeader&& x); - FASTDDS_EXPORTED_API MinimalBitsetHeader& operator =( - const MinimalBitsetHeader& x); - FASTDDS_EXPORTED_API MinimalBitsetHeader& operator =( - MinimalBitsetHeader&& x); - - FASTDDS_EXPORTED_API inline void base_type( - const TypeIdentifier& _base_type) - { - m_base_type = _base_type; - } - - FASTDDS_EXPORTED_API inline void base_type( - TypeIdentifier&& _base_type) - { - m_base_type = std::move(_base_type); - } - - FASTDDS_EXPORTED_API inline const TypeIdentifier& base_type() const - { - return m_base_type; - } - - FASTDDS_EXPORTED_API inline TypeIdentifier& base_type() - { - return m_base_type; - } - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalBitsetHeader& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const MinimalBitsetHeader& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - TypeIdentifier m_base_type; -}; -/*struct CompleteBitsetType { - BitsetTypeFlag bitset_flags; // unused - CompleteBitsetHeader header; - CompleteBitfieldSeq field_seq; - };*/ -class CompleteBitsetType -{ -public: - - FASTDDS_EXPORTED_API CompleteBitsetType(); - FASTDDS_EXPORTED_API ~CompleteBitsetType(); - FASTDDS_EXPORTED_API CompleteBitsetType( - const CompleteBitsetType& x); - FASTDDS_EXPORTED_API CompleteBitsetType( - CompleteBitsetType&& x); - FASTDDS_EXPORTED_API CompleteBitsetType& operator =( - const CompleteBitsetType& x); - FASTDDS_EXPORTED_API CompleteBitsetType& operator =( - CompleteBitsetType&& x); - - FASTDDS_EXPORTED_API inline void bitset_flags( - const BitsetTypeFlag& _bitset_flags) - { - m_bitset_flags = _bitset_flags; - } - - FASTDDS_EXPORTED_API inline void bitset_flags( - BitsetTypeFlag&& _bitset_flags) - { - m_bitset_flags = std::move(_bitset_flags); - } - - FASTDDS_EXPORTED_API inline const BitsetTypeFlag& bitset_flags() const - { - return m_bitset_flags; - } - - FASTDDS_EXPORTED_API inline BitsetTypeFlag& bitset_flags() - { - return m_bitset_flags; - } - - FASTDDS_EXPORTED_API inline void header( - const CompleteBitsetHeader& _header) - { - m_header = _header; - } - - FASTDDS_EXPORTED_API inline void header( - CompleteBitsetHeader&& _header) - { - m_header = std::move(_header); - } - - FASTDDS_EXPORTED_API inline const CompleteBitsetHeader& header() const - { - return m_header; - } - - FASTDDS_EXPORTED_API inline CompleteBitsetHeader& header() - { - return m_header; - } - - FASTDDS_EXPORTED_API inline void field_seq( - const CompleteBitfieldSeq& _field_seq) - { - m_field_seq = _field_seq; - } - - FASTDDS_EXPORTED_API inline void field_seq( - CompleteBitfieldSeq&& _field_seq) - { - m_field_seq = std::move(_field_seq); - } - - FASTDDS_EXPORTED_API inline const CompleteBitfieldSeq& field_seq() const - { - return m_field_seq; - } - - FASTDDS_EXPORTED_API inline CompleteBitfieldSeq& field_seq() - { - return m_field_seq; - } - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteBitsetType& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CompleteBitsetType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - BitsetTypeFlag m_bitset_flags; - CompleteBitsetHeader m_header; - CompleteBitfieldSeq m_field_seq; -}; - -/*struct MinimalBitsetType { - BitsetTypeFlag bitset_flags; // unused - MinimalBitsetHeader header; - MinimalBitfieldSeq field_seq; - };*/ -class MinimalBitsetType -{ -public: - - FASTDDS_EXPORTED_API MinimalBitsetType(); - FASTDDS_EXPORTED_API ~MinimalBitsetType(); - FASTDDS_EXPORTED_API MinimalBitsetType( - const MinimalBitsetType& x); - FASTDDS_EXPORTED_API MinimalBitsetType( - MinimalBitsetType&& x); - FASTDDS_EXPORTED_API MinimalBitsetType& operator =( - const MinimalBitsetType& x); - FASTDDS_EXPORTED_API MinimalBitsetType& operator =( - MinimalBitsetType&& x); - - FASTDDS_EXPORTED_API inline void bitset_flags( - const BitsetTypeFlag& _bitset_flags) - { - m_bitset_flags = _bitset_flags; - } - - FASTDDS_EXPORTED_API inline void bitset_flags( - BitsetTypeFlag&& _bitset_flags) - { - m_bitset_flags = std::move(_bitset_flags); - } - - FASTDDS_EXPORTED_API inline const BitsetTypeFlag& bitset_flags() const - { - return m_bitset_flags; - } - - FASTDDS_EXPORTED_API inline BitsetTypeFlag& bitset_flags() - { - return m_bitset_flags; - } - - FASTDDS_EXPORTED_API inline void header( - const MinimalBitsetHeader& _header) - { - m_header = _header; - } - - FASTDDS_EXPORTED_API inline void header( - MinimalBitsetHeader&& _header) - { - m_header = std::move(_header); - } - - FASTDDS_EXPORTED_API inline const MinimalBitsetHeader& header() const - { - return m_header; - } - - FASTDDS_EXPORTED_API inline MinimalBitsetHeader& header() - { - return m_header; - } - - FASTDDS_EXPORTED_API inline void field_seq( - const MinimalBitfieldSeq& _field_seq) - { - m_field_seq = _field_seq; - } - - FASTDDS_EXPORTED_API inline void field_seq( - MinimalBitfieldSeq&& _field_seq) - { - m_field_seq = std::move(_field_seq); - } - - FASTDDS_EXPORTED_API inline const MinimalBitfieldSeq& field_seq() const - { - return m_field_seq; - } - - FASTDDS_EXPORTED_API inline MinimalBitfieldSeq& field_seq() - { - return m_field_seq; - } - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalBitsetType& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const MinimalBitsetType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - BitsetTypeFlag m_bitset_flags; - MinimalBitsetHeader m_header; - MinimalBitfieldSeq m_field_seq; -}; - -// --- Type Object: -------------------------------------------------- -// The types associated with each case selection must have extensibility -// kind APPENDABLE or MUTABLE so that they can be extended in the future - -/*struct CompleteExtendedType { - // Empty. Available for future extension - };*/ -class CompleteExtendedType -{ -public: - - FASTDDS_EXPORTED_API CompleteExtendedType(); - FASTDDS_EXPORTED_API ~CompleteExtendedType(); - FASTDDS_EXPORTED_API CompleteExtendedType( - const CompleteExtendedType& x); - FASTDDS_EXPORTED_API CompleteExtendedType( - CompleteExtendedType&& x); - FASTDDS_EXPORTED_API CompleteExtendedType& operator =( - const CompleteExtendedType& x); - FASTDDS_EXPORTED_API CompleteExtendedType& operator =( - CompleteExtendedType&& x); - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteExtendedType&) const - { - return true; - } - - FASTDDS_EXPORTED_API bool consistent( - const CompleteExtendedType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - -}; - -/*struct MinimalExtendedType { - // Empty. Available for future extension - };*/ -class MinimalExtendedType -{ -public: - - FASTDDS_EXPORTED_API MinimalExtendedType(); - FASTDDS_EXPORTED_API ~MinimalExtendedType(); - FASTDDS_EXPORTED_API MinimalExtendedType( - const MinimalExtendedType& x); - FASTDDS_EXPORTED_API MinimalExtendedType( - MinimalExtendedType&& x); - FASTDDS_EXPORTED_API MinimalExtendedType& operator =( - const MinimalExtendedType& x); - FASTDDS_EXPORTED_API MinimalExtendedType& operator =( - MinimalExtendedType&& x); - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalExtendedType&) const - { - return true; - } - - FASTDDS_EXPORTED_API bool consistent( - const MinimalExtendedType& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - -}; - -class CompleteTypeObject final -{ -public: - - FASTDDS_EXPORTED_API CompleteTypeObject(); - FASTDDS_EXPORTED_API ~CompleteTypeObject(); - FASTDDS_EXPORTED_API CompleteTypeObject( - const CompleteTypeObject& x); - FASTDDS_EXPORTED_API CompleteTypeObject( - CompleteTypeObject&& x); - FASTDDS_EXPORTED_API CompleteTypeObject& operator =( - const CompleteTypeObject& x); - FASTDDS_EXPORTED_API CompleteTypeObject& operator =( - CompleteTypeObject&& x); - FASTDDS_EXPORTED_API void _d( - octet __d); - FASTDDS_EXPORTED_API octet _d() const; - FASTDDS_EXPORTED_API octet& _d(); - - FASTDDS_EXPORTED_API void alias_type( - CompleteAliasType _alias_type); - FASTDDS_EXPORTED_API const CompleteAliasType& alias_type() const; - FASTDDS_EXPORTED_API CompleteAliasType& alias_type(); - - FASTDDS_EXPORTED_API void annotation_type( - CompleteAnnotationType _annotation_type); - FASTDDS_EXPORTED_API const CompleteAnnotationType& annotation_type() const; - FASTDDS_EXPORTED_API CompleteAnnotationType& annotation_type(); - - FASTDDS_EXPORTED_API void struct_type( - CompleteStructType _struct_type); - FASTDDS_EXPORTED_API const CompleteStructType& struct_type() const; - FASTDDS_EXPORTED_API CompleteStructType& struct_type(); - - FASTDDS_EXPORTED_API void union_type( - CompleteUnionType _union_type); - FASTDDS_EXPORTED_API const CompleteUnionType& union_type() const; - FASTDDS_EXPORTED_API CompleteUnionType& union_type(); - - FASTDDS_EXPORTED_API void bitset_type( - CompleteBitsetType _bitset_type); - FASTDDS_EXPORTED_API const CompleteBitsetType& bitset_type() const; - FASTDDS_EXPORTED_API CompleteBitsetType& bitset_type(); - - FASTDDS_EXPORTED_API void sequence_type( - CompleteSequenceType _sequence_type); - FASTDDS_EXPORTED_API const CompleteSequenceType& sequence_type() const; - FASTDDS_EXPORTED_API CompleteSequenceType& sequence_type(); - - FASTDDS_EXPORTED_API void array_type( - CompleteArrayType _array_type); - FASTDDS_EXPORTED_API const CompleteArrayType& array_type() const; - FASTDDS_EXPORTED_API CompleteArrayType& array_type(); - - FASTDDS_EXPORTED_API void map_type( - CompleteMapType _map_type); - FASTDDS_EXPORTED_API const CompleteMapType& map_type() const; - FASTDDS_EXPORTED_API CompleteMapType& map_type(); - - FASTDDS_EXPORTED_API void enumerated_type( - CompleteEnumeratedType _enumerated_type); - FASTDDS_EXPORTED_API const CompleteEnumeratedType& enumerated_type() const; - FASTDDS_EXPORTED_API CompleteEnumeratedType& enumerated_type(); - - FASTDDS_EXPORTED_API void bitmask_type( - CompleteBitmaskType _bitmask_type); - FASTDDS_EXPORTED_API const CompleteBitmaskType& bitmask_type() const; - FASTDDS_EXPORTED_API CompleteBitmaskType& bitmask_type(); - - FASTDDS_EXPORTED_API void extended_type( - CompleteExtendedType _extended_type); - FASTDDS_EXPORTED_API const CompleteExtendedType& extended_type() const; - FASTDDS_EXPORTED_API CompleteExtendedType& extended_type(); - - FASTDDS_EXPORTED_API bool operator ==( - const CompleteTypeObject& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const CompleteTypeObject& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - octet m__d; - - CompleteAliasType m_alias_type; - CompleteAnnotationType m_annotation_type; - CompleteStructType m_struct_type; - CompleteUnionType m_union_type; - CompleteBitsetType m_bitset_type; - CompleteSequenceType m_sequence_type; - CompleteArrayType m_array_type; - CompleteMapType m_map_type; - CompleteEnumeratedType m_enumerated_type; - CompleteBitmaskType m_bitmask_type; - CompleteExtendedType m_extended_type; -}; - -class MinimalTypeObject final -{ -public: - - FASTDDS_EXPORTED_API MinimalTypeObject(); - FASTDDS_EXPORTED_API ~MinimalTypeObject(); - FASTDDS_EXPORTED_API MinimalTypeObject( - const MinimalTypeObject& x); - FASTDDS_EXPORTED_API MinimalTypeObject( - MinimalTypeObject&& x); - FASTDDS_EXPORTED_API MinimalTypeObject& operator =( - const MinimalTypeObject& x); - FASTDDS_EXPORTED_API MinimalTypeObject& operator =( - MinimalTypeObject&& x); - FASTDDS_EXPORTED_API void _d( - octet __d); - FASTDDS_EXPORTED_API octet _d() const; - FASTDDS_EXPORTED_API octet& _d(); - - FASTDDS_EXPORTED_API void alias_type( - MinimalAliasType _alias_type); - FASTDDS_EXPORTED_API const MinimalAliasType& alias_type() const; - FASTDDS_EXPORTED_API MinimalAliasType& alias_type(); - - FASTDDS_EXPORTED_API void annotation_type( - MinimalAnnotationType _annotation_type); - FASTDDS_EXPORTED_API const MinimalAnnotationType& annotation_type() const; - FASTDDS_EXPORTED_API MinimalAnnotationType& annotation_type(); - - FASTDDS_EXPORTED_API void struct_type( - MinimalStructType _struct_type); - FASTDDS_EXPORTED_API const MinimalStructType& struct_type() const; - FASTDDS_EXPORTED_API MinimalStructType& struct_type(); - - FASTDDS_EXPORTED_API void union_type( - MinimalUnionType _union_type); - FASTDDS_EXPORTED_API const MinimalUnionType& union_type() const; - FASTDDS_EXPORTED_API MinimalUnionType& union_type(); - - FASTDDS_EXPORTED_API void bitset_type( - MinimalBitsetType _bitset_type); - FASTDDS_EXPORTED_API const MinimalBitsetType& bitset_type() const; - FASTDDS_EXPORTED_API MinimalBitsetType& bitset_type(); - - FASTDDS_EXPORTED_API void sequence_type( - MinimalSequenceType _sequence_type); - FASTDDS_EXPORTED_API const MinimalSequenceType& sequence_type() const; - FASTDDS_EXPORTED_API MinimalSequenceType& sequence_type(); - - FASTDDS_EXPORTED_API void array_type( - MinimalArrayType _array_type); - FASTDDS_EXPORTED_API const MinimalArrayType& array_type() const; - FASTDDS_EXPORTED_API MinimalArrayType& array_type(); - - FASTDDS_EXPORTED_API void map_type( - MinimalMapType _map_type); - FASTDDS_EXPORTED_API const MinimalMapType& map_type() const; - FASTDDS_EXPORTED_API MinimalMapType& map_type(); - - FASTDDS_EXPORTED_API void enumerated_type( - MinimalEnumeratedType _enumerated_type); - FASTDDS_EXPORTED_API const MinimalEnumeratedType& enumerated_type() const; - FASTDDS_EXPORTED_API MinimalEnumeratedType& enumerated_type(); - - FASTDDS_EXPORTED_API void bitmask_type( - MinimalBitmaskType _bitmask_type); - FASTDDS_EXPORTED_API const MinimalBitmaskType& bitmask_type() const; - FASTDDS_EXPORTED_API MinimalBitmaskType& bitmask_type(); - - FASTDDS_EXPORTED_API void extended_type( - MinimalExtendedType _extended_type); - FASTDDS_EXPORTED_API const MinimalExtendedType& extended_type() const; - FASTDDS_EXPORTED_API MinimalExtendedType& extended_type(); - - FASTDDS_EXPORTED_API bool operator ==( - const MinimalTypeObject& other) const; - - FASTDDS_EXPORTED_API bool consistent( - const MinimalTypeObject& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - octet m__d; - - MinimalAliasType m_alias_type; - MinimalAnnotationType m_annotation_type; - MinimalStructType m_struct_type; - MinimalUnionType m_union_type; - MinimalBitsetType m_bitset_type; - MinimalSequenceType m_sequence_type; - MinimalArrayType m_array_type; - MinimalMapType m_map_type; - MinimalEnumeratedType m_enumerated_type; - MinimalBitmaskType m_bitmask_type; - MinimalExtendedType m_extended_type; -}; -class TypeObject -{ -public: - - /*! - * @brief Default constructor. - */ - FASTDDS_EXPORTED_API TypeObject(); - - /*! - * @brief Default destructor. - */ - FASTDDS_EXPORTED_API ~TypeObject(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object TypeObject that will be copied. - */ - FASTDDS_EXPORTED_API TypeObject( - const TypeObject& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object TypeObject that will be copied. - */ - FASTDDS_EXPORTED_API TypeObject( - TypeObject&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object TypeObject that will be copied. - */ - FASTDDS_EXPORTED_API TypeObject& operator =( - const TypeObject& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object TypeObject that will be copied. - */ - FASTDDS_EXPORTED_API TypeObject& operator =( - TypeObject&& x); - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - FASTDDS_EXPORTED_API void _d( - uint8_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - FASTDDS_EXPORTED_API uint8_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - FASTDDS_EXPORTED_API uint8_t& _d(); - - /*! - * @brief This function copies the value in member complete - * @param _complete New value to be copied in member complete - */ - FASTDDS_EXPORTED_API void complete( - const CompleteTypeObject& _complete); - - /*! - * @brief This function moves the value in member complete - * @param _complete New value to be moved in member complete - */ - FASTDDS_EXPORTED_API void complete( - CompleteTypeObject&& _complete); - - /*! - * @brief This function returns a constant reference to member complete - * @return Constant reference to member complete - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API const CompleteTypeObject& complete() const; - - /*! - * @brief This function returns a reference to member complete - * @return Reference to member complete - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API CompleteTypeObject& complete(); - /*! - * @brief This function copies the value in member minimal - * @param _minimal New value to be copied in member minimal - */ - FASTDDS_EXPORTED_API void minimal( - const MinimalTypeObject& _minimal); - - /*! - * @brief This function moves the value in member minimal - * @param _minimal New value to be moved in member minimal - */ - FASTDDS_EXPORTED_API void minimal( - MinimalTypeObject&& _minimal); - - /*! - * @brief This function returns a constant reference to member minimal - * @return Constant reference to member minimal - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API const MinimalTypeObject& minimal() const; - - /*! - * @brief This function returns a reference to member minimal - * @return Reference to member minimal - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - FASTDDS_EXPORTED_API MinimalTypeObject& minimal(); - - FASTDDS_EXPORTED_API bool operator ==( - const TypeObject& other) const; - - /*! - * @brief This function check type consistency enforcement with the given TypeObject x. - * @param x TypeObject to check if can be assigned to the current instance. - * @param consistency fastdds::dds::TypeConsistencyEnforcementQoSPolicy to apply. - */ - FASTDDS_EXPORTED_API bool consistent( - const TypeObject& x, - const fastdds::dds::TypeConsistencyEnforcementQosPolicy& consistency) const; - -private: - - uint8_t m__d; - - CompleteTypeObject m_complete; - MinimalTypeObject m_minimal; -}; - -typedef std::vector TypeObjectSeq; - -// Set of TypeObjects representing a strong component: Equivalence class -// for the Strong Connectivity relationship (mutual reachability between -// types). -// Ordered by fully qualified typename lexicographic order -typedef TypeObjectSeq StronglyConnectedComponent; - -/*struct TypeIdentifierTypeObjectPair final { - TypeIdentifier type_identifier; - TypeObject type_object; - };*/ -class TypeIdentifierTypeObjectPair final -{ -public: - - FASTDDS_EXPORTED_API TypeIdentifierTypeObjectPair(); - FASTDDS_EXPORTED_API ~TypeIdentifierTypeObjectPair(); - FASTDDS_EXPORTED_API TypeIdentifierTypeObjectPair( - const TypeIdentifierTypeObjectPair& x); - FASTDDS_EXPORTED_API TypeIdentifierTypeObjectPair( - TypeIdentifierTypeObjectPair&& x); - FASTDDS_EXPORTED_API TypeIdentifierTypeObjectPair& operator =( - const TypeIdentifierTypeObjectPair& x); - FASTDDS_EXPORTED_API TypeIdentifierTypeObjectPair& operator =( - TypeIdentifierTypeObjectPair&& x); - - FASTDDS_EXPORTED_API inline void type_identifier( - const TypeIdentifier& _type_identifier) - { - m_type_identifier = _type_identifier; - } - - FASTDDS_EXPORTED_API inline void type_identifier( - TypeIdentifier&& _type_identifier) - { - m_type_identifier = std::move(_type_identifier); - } - - FASTDDS_EXPORTED_API inline const TypeIdentifier& type_identifier() const - { - return m_type_identifier; - } - - FASTDDS_EXPORTED_API inline TypeIdentifier& type_identifier() - { - return m_type_identifier; - } - - FASTDDS_EXPORTED_API inline void type_object( - const TypeObject& _type_object) - { - m_type_object = _type_object; - } - - FASTDDS_EXPORTED_API inline void type_object( - TypeObject&& _type_object) - { - m_type_object = std::move(_type_object); - } - - FASTDDS_EXPORTED_API inline const TypeObject& type_object() const - { - return m_type_object; - } - - FASTDDS_EXPORTED_API inline TypeObject& type_object() - { - return m_type_object; - } - -private: - - TypeIdentifier m_type_identifier; - TypeObject m_type_object; -}; -typedef std::vector TypeIdentifierTypeObjectPairSeq; - -/*struct TypeIdentifierPair final { - TypeIdentifier type_identifier1; - TypeIdentifier type_identifier2; - };*/ -class TypeIdentifierPair final -{ -public: - - FASTDDS_EXPORTED_API TypeIdentifierPair(); - FASTDDS_EXPORTED_API ~TypeIdentifierPair(); - FASTDDS_EXPORTED_API TypeIdentifierPair( - const TypeIdentifierPair& x); - FASTDDS_EXPORTED_API TypeIdentifierPair( - TypeIdentifierPair&& x); - FASTDDS_EXPORTED_API TypeIdentifierPair& operator =( - const TypeIdentifierPair& x); - FASTDDS_EXPORTED_API TypeIdentifierPair& operator =( - TypeIdentifierPair&& x); - - FASTDDS_EXPORTED_API inline void type_identifier1( - const TypeIdentifier& _type_identifier1) - { - m_type_identifier1 = _type_identifier1; - } - - FASTDDS_EXPORTED_API inline void type_identifier1( - TypeIdentifier&& _type_identifier1) - { - m_type_identifier1 = std::move(_type_identifier1); - } - - FASTDDS_EXPORTED_API inline const TypeIdentifier& type_identifier1() const - { - return m_type_identifier1; - } - - FASTDDS_EXPORTED_API inline TypeIdentifier& type_identifier1() - { - return m_type_identifier1; - } - - FASTDDS_EXPORTED_API inline void type_identifier2( - const TypeIdentifier& _type_identifier2) - { - m_type_identifier2 = _type_identifier2; - } - - FASTDDS_EXPORTED_API inline void type_identifier2( - TypeIdentifier&& _type_identifier2) - { - m_type_identifier2 = std::move(_type_identifier2); - } - - FASTDDS_EXPORTED_API inline const TypeIdentifier& type_identifier2() const - { - return m_type_identifier2; - } - - FASTDDS_EXPORTED_API inline TypeIdentifier& type_identifier2() - { - return m_type_identifier2; - } - -private: - - TypeIdentifier m_type_identifier1; - TypeIdentifier m_type_identifier2; -}; - -typedef std::vector TypeIdentifierPairSeq; -/*struct TypeIdentifierWithSize { - TypeIdentifier type_id; - uint32_t typeobject_serialized_size; - };*/ -class TypeIdentifierWithSize -{ -public: - - FASTDDS_EXPORTED_API TypeIdentifierWithSize(); - FASTDDS_EXPORTED_API ~TypeIdentifierWithSize(); - FASTDDS_EXPORTED_API TypeIdentifierWithSize( - const TypeIdentifierWithSize& x); - FASTDDS_EXPORTED_API TypeIdentifierWithSize( - TypeIdentifierWithSize&& x); - FASTDDS_EXPORTED_API TypeIdentifierWithSize& operator =( - const TypeIdentifierWithSize& x); - FASTDDS_EXPORTED_API TypeIdentifierWithSize& operator =( - TypeIdentifierWithSize&& x); - - FASTDDS_EXPORTED_API inline void type_id( - const TypeIdentifier& _type_id) - { - m_type_id = _type_id; - } - - FASTDDS_EXPORTED_API inline void type_id( - TypeIdentifier&& _type_id) - { - m_type_id = std::move(_type_id); - } - - FASTDDS_EXPORTED_API inline const TypeIdentifier& type_id() const - { - return m_type_id; - } - - FASTDDS_EXPORTED_API inline TypeIdentifier& type_id() - { - return m_type_id; - } - - FASTDDS_EXPORTED_API inline void typeobject_serialized_size( - const uint32_t& _typeobject_serialized_size) - { - m_typeobject_serialized_size = _typeobject_serialized_size; - } - - FASTDDS_EXPORTED_API inline void typeobject_serialized_size( - uint32_t&& _typeobject_serialized_size) - { - m_typeobject_serialized_size = std::move(_typeobject_serialized_size); - } - - FASTDDS_EXPORTED_API inline const uint32_t& typeobject_serialized_size() const - { - return m_typeobject_serialized_size; - } - - FASTDDS_EXPORTED_API inline uint32_t& typeobject_serialized_size() - { - return m_typeobject_serialized_size; - } - -private: - - TypeIdentifier m_type_id; - uint32_t m_typeobject_serialized_size; -}; - -typedef std::vector TypeIdentifierWithSizeSeq; - -/*struct TypeIdentifierWithDependencies { - TypeIdentifierWithSize typeid_with_size; - // The total additional types related to minimal_type - int32_t dependent_typeid_count; - TypeIdentifierWithSizeSeq dependent_typeids; - };*/ -class TypeIdentifierWithDependencies -{ -public: - - FASTDDS_EXPORTED_API TypeIdentifierWithDependencies(); - FASTDDS_EXPORTED_API ~TypeIdentifierWithDependencies(); - FASTDDS_EXPORTED_API TypeIdentifierWithDependencies( - const TypeIdentifierWithDependencies& x); - FASTDDS_EXPORTED_API TypeIdentifierWithDependencies( - TypeIdentifierWithDependencies&& x); - FASTDDS_EXPORTED_API TypeIdentifierWithDependencies& operator =( - const TypeIdentifierWithDependencies& x); - FASTDDS_EXPORTED_API TypeIdentifierWithDependencies& operator =( - TypeIdentifierWithDependencies&& x); - - FASTDDS_EXPORTED_API inline void typeid_with_size( - const TypeIdentifierWithSize& _typeid_with_size) - { - m_typeid_with_size = _typeid_with_size; - } - - FASTDDS_EXPORTED_API inline void typeid_with_size( - TypeIdentifierWithSize&& _typeid_with_size) - { - m_typeid_with_size = std::move(_typeid_with_size); - } - - FASTDDS_EXPORTED_API inline const TypeIdentifierWithSize& typeid_with_size() const - { - return m_typeid_with_size; - } - - FASTDDS_EXPORTED_API inline TypeIdentifierWithSize& typeid_with_size() - { - return m_typeid_with_size; - } - - FASTDDS_EXPORTED_API inline void dependent_typeid_count( - const int32_t& _dependent_typeid_count) - { - m_dependent_typeid_count = _dependent_typeid_count; - } - - FASTDDS_EXPORTED_API inline void dependent_typeid_count( - int32_t&& _dependent_typeid_count) - { - m_dependent_typeid_count = std::move(_dependent_typeid_count); - } - - FASTDDS_EXPORTED_API inline const int32_t& dependent_typeid_count() const - { - return m_dependent_typeid_count; - } - - FASTDDS_EXPORTED_API inline int32_t& dependent_typeid_count() - { - return m_dependent_typeid_count; - } - - FASTDDS_EXPORTED_API inline void dependent_typeids( - const TypeIdentifierWithSizeSeq& _dependent_typeids) - { - m_dependent_typeids = _dependent_typeids; - } - - FASTDDS_EXPORTED_API inline void dependent_typeids( - TypeIdentifierWithSizeSeq&& _dependent_typeids) - { - m_dependent_typeids = std::move(_dependent_typeids); - } - - FASTDDS_EXPORTED_API inline const TypeIdentifierWithSizeSeq& dependent_typeids() const - { - return m_dependent_typeids; - } - - FASTDDS_EXPORTED_API inline TypeIdentifierWithSizeSeq& dependent_typeids() - { - return m_dependent_typeids; - } - -private: - - TypeIdentifierWithSize m_typeid_with_size; - int32_t m_dependent_typeid_count; - TypeIdentifierWithSizeSeq m_dependent_typeids; -}; - -typedef std::vector TypeIdentifierWithDependenciesSeq; -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -// This appears in the builtin DDS topics PublicationBuiltinTopicData -// and SubscriptionBuiltinTopicData - -/*struct TypeInformation { - TypeIdentifierWithDependencies minimal; // @id{0x1001} - TypeIdentifierWithDependencies complete; // @id{0x1002} - };*/ -class TypeInformation -{ -public: - - FASTDDS_EXPORTED_API TypeInformation(); - FASTDDS_EXPORTED_API ~TypeInformation(); - FASTDDS_EXPORTED_API TypeInformation( - const TypeInformation& x); - FASTDDS_EXPORTED_API TypeInformation( - TypeInformation&& x); - FASTDDS_EXPORTED_API TypeInformation& operator =( - const TypeInformation& x); - FASTDDS_EXPORTED_API TypeInformation& operator =( - TypeInformation&& x); - - FASTDDS_EXPORTED_API inline void minimal( - const TypeIdentifierWithDependencies& _minimal) - { - m_minimal = _minimal; - } - - FASTDDS_EXPORTED_API inline void minimal( - TypeIdentifierWithDependencies&& _minimal) - { - m_minimal = std::move(_minimal); - } - - FASTDDS_EXPORTED_API inline const TypeIdentifierWithDependencies& minimal() const - { - return m_minimal; - } - - FASTDDS_EXPORTED_API inline TypeIdentifierWithDependencies& minimal() - { - return m_minimal; - } - - FASTDDS_EXPORTED_API inline void complete( - const TypeIdentifierWithDependencies& _complete) - { - m_complete = _complete; - } - - FASTDDS_EXPORTED_API inline void complete( - TypeIdentifierWithDependencies&& _complete) - { - m_complete = std::move(_complete); - } - - FASTDDS_EXPORTED_API inline const TypeIdentifierWithDependencies& complete() const - { - return m_complete; - } - - FASTDDS_EXPORTED_API inline TypeIdentifierWithDependencies& complete() - { - return m_complete; - } - -private: - - TypeIdentifierWithDependencies m_minimal; - TypeIdentifierWithDependencies m_complete; -}; - -typedef std::vector TypeInformationSeq; -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPES_TYPE_OBJECT_H diff --git a/include/fastrtps/types/TypeObjectFactory.h b/include/fastrtps/types/TypeObjectFactory.h deleted file mode 100644 index 4d935923df4..00000000000 --- a/include/fastrtps/types/TypeObjectFactory.h +++ /dev/null @@ -1,277 +0,0 @@ -// Copyright 2018 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. - -#ifndef TYPE_OBJECT_TYPE_FACTORY_H -#define TYPE_OBJECT_TYPE_FACTORY_H - -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastrtps { -namespace types { - -class TypeObjectFactory -{ -private: - - mutable std::recursive_mutex m_MutexIdentifiers; - mutable std::recursive_mutex m_MutexObjects; - mutable std::recursive_mutex m_MutexInformations; - -protected: - - TypeObjectFactory(); - mutable std::map identifiers_; // Basic, builtin and EK_MINIMAL - std::map complete_identifiers_; // Only EK_COMPLETE - std::map objects_; // EK_MINIMAL - std::map complete_objects_; // EK_COMPLETE - mutable std::vector identifiers_created_; - mutable std::map informations_; - mutable std::vector informations_created_; - std::map aliases_; // Aliases - - DynamicType_ptr build_dynamic_type( - TypeDescriptor& descriptor, - const TypeObject* object, - const DynamicType_ptr annotation_member_type = DynamicType_ptr(nullptr)) const; - - const TypeIdentifier* try_get_complete( - const TypeIdentifier* identifier) const; - - const TypeIdentifier* get_stored_type_identifier( - const TypeIdentifier* identifier) const; - - std::string generate_name_and_store_type_identifier( - const TypeIdentifier* identifier) const; - - void nullify_all_entries( - const TypeIdentifier* identifier); - - void create_builtin_annotations(); - - void apply_type_annotations( - DynamicTypeBuilder_ptr& type_builder, - const AppliedAnnotationSeq& annotations) const; - - void apply_member_annotations( - DynamicTypeBuilder_ptr& parent_type_builder, - MemberId member_id, - const AppliedAnnotationSeq& annotations) const; - - std::string get_key_from_hash( - const DynamicType_ptr annotation_descriptor_type, - const NameHash& hash) const; - - /** - * @brief Fills the TypeInformation provided with the minimal TypeIdentifiers and its minimal dependencies. - * @param info - * @param ident - */ - void fill_minimal_information( - TypeInformation* info, - const TypeIdentifier* ident) const; - - /** - * @brief Fills the TypeInformation provided with the complete TypeIdentifiers and its complete dependencies - * if possible, or minimal ones in other case. - * @param info - * @param ident - */ - void fill_complete_information( - TypeInformation* info, - const TypeIdentifier* ident) const; - - /** - * @brief Auxiliar function to fill minimal dependencies. - * @param info - * @param identifier - */ - void fill_minimal_dependant_types( - TypeInformation* info, - const TypeIdentifier* identifier) const; - - /** - * @brief Auxiliar function to fill complete dependencies. - * @param info - * @param identifier - */ - void fill_complete_dependant_types( - TypeInformation* info, - const TypeIdentifier* identifier) const; - - /** - * @brief Auxiliar function to fill minimal information with complete dependencies. - * @param info - * @param identifier - */ - void fill_complete_minimal_dependant_types( - TypeInformation* info, - const TypeIdentifier* identifier) const; - -public: - - FASTDDS_EXPORTED_API static TypeObjectFactory* get_instance(); - - FASTDDS_EXPORTED_API static ReturnCode_t delete_instance(); - - ~TypeObjectFactory(); - - /** - * @brief get_type_information Retrieves the TypeInformation of the named type. - * @param type_name - * @return - */ - FASTDDS_EXPORTED_API const TypeInformation* get_type_information( - const std::string& type_name) const; - - /** - * @brief get_type_information Retrieves the TypeInformation of the given TypeIdentifier. - * @param identifier - * @return - */ - FASTDDS_EXPORTED_API TypeInformation* get_type_information( - const TypeIdentifier* identifier) const; - - FASTDDS_EXPORTED_API const TypeObject* get_type_object( - const std::string& type_name, - bool complete = false) const; - - FASTDDS_EXPORTED_API const TypeObject* get_type_object( - const TypeIdentifier* identifier) const; - - FASTDDS_EXPORTED_API TypeKind get_type_kind( - const std::string& type_name) const; - - FASTDDS_EXPORTED_API std::string get_type_name( - const TypeKind kind) const; - - FASTDDS_EXPORTED_API std::string get_type_name( - const TypeIdentifier* identifier) const; - - FASTDDS_EXPORTED_API const TypeIdentifier* get_primitive_type_identifier( - TypeKind kind) const; - - FASTDDS_EXPORTED_API const TypeIdentifier* get_type_identifier( - const std::string& type_name, - bool complete = false) const; - - FASTDDS_EXPORTED_API const TypeIdentifier* get_type_identifier_trying_complete( - const std::string& type_name) const; - - FASTDDS_EXPORTED_API const TypeIdentifier* get_string_identifier( - uint32_t bound, - bool wide = false); - - FASTDDS_EXPORTED_API const TypeIdentifier* get_sequence_identifier( - const std::string& type_name, - uint32_t bound, - bool complete = false); - - FASTDDS_EXPORTED_API const TypeIdentifier* get_array_identifier( - const std::string& type_name, - const std::vector& bound, - bool complete = false); - - FASTDDS_EXPORTED_API const TypeIdentifier* get_map_identifier( - const std::string& key_type_name, - const std::string& value_type_name, - uint32_t bound, - bool complete = false); - - FASTDDS_EXPORTED_API DynamicType_ptr build_dynamic_type( - const std::string& name, - const TypeIdentifier* identifier, - const TypeObject* object = nullptr) const; - - FASTDDS_EXPORTED_API bool is_type_identifier_complete( - const TypeIdentifier* identifier) const; - - FASTDDS_EXPORTED_API void add_type_identifier( - const std::string& type_name, - const TypeIdentifier* identifier); - - FASTDDS_EXPORTED_API void add_type_object( - const std::string& type_name, - const TypeIdentifier* identifier, - const TypeObject* object); - - FASTDDS_EXPORTED_API inline void add_alias( - const std::string& alias_name, - const std::string& target_type) - { - std::unique_lock scoped(m_MutexIdentifiers); - aliases_.emplace(std::pair(alias_name, target_type)); - } - - /** - * @brief Returns a TypeIdentifierWithSizeSeq object filled with the dependencies of the - * given identifiers. If continuation_point isn't empty, then it will skip the first - * (max_size * continuation_point) dependencies. - * @param identifiers - * @param in_continuation_point - * @param out_continuation_point - * @param max_size - * @return - */ - FASTDDS_EXPORTED_API TypeIdentifierWithSizeSeq typelookup_get_type_dependencies( - const TypeIdentifierSeq& identifiers, - const OctetSeq& in_continuation_point, - OctetSeq& out_continuation_point, - size_t max_size) const; - - /** - * @brief Fills the given object with the complete version of the given identifier. - * If the given identifier was MINIMAL, then it will return the stored COMPLETE identifier pointer. - * Otherwise, it will return the given identifier address (to make comparision trivial). - * @param identifier - * @param object - * @return - */ - FASTDDS_EXPORTED_API const TypeIdentifier* typelookup_get_type( - const TypeIdentifier& identifier, - TypeObject& object) const; - - /** - * @brief Checks if a TypeIdentifier is already known by the factory. - * @param identifier - * @return - */ - FASTDDS_EXPORTED_API bool typelookup_check_type_identifier( - const TypeIdentifier& identifier) const; - - /** - * @brief Retrieves the CompleteTypeObject from the given TypeInformation. - * If it doesn't exist, it returns nullptr. - * A user that received a TypeInformation from TypeLookupService that calls this method and returns nullptr, - * must iterate through the TypeInformation dependencies calling recursively to getTypeDependencies method in - * its participant (which will call the correspondent method in the TypeLookupService), retrieving the - * TypeObject correspondent and registering the type into the Factory with a name using the add_type_object method, - * for each COMPLETE TypeIdentifier received in this way until all the hierarchy is registered, and then, - * the user may call again this method that should return the TypeObject. - * @param information - * @return - */ - FASTDDS_EXPORTED_API const TypeObject* typelookup_get_type_object_from_information( - const TypeInformation& information) const; -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPE_OBJECT_TYPE_FACTORY_H diff --git a/include/fastrtps/types/TypeObjectHashId.h b/include/fastrtps/types/TypeObjectHashId.h deleted file mode 100644 index 180acb70ae6..00000000000 --- a/include/fastrtps/types/TypeObjectHashId.h +++ /dev/null @@ -1,187 +0,0 @@ -// 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 TypeObjectHashId.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool gen and modified manually. - */ - -#ifndef _TYPEOBJECTHASHID_H_ -#define _TYPEOBJECTHASHID_H_ - -#include -#include -#include -#include -#include - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - -// The types in this file shall be serialized with XCDR encoding version 2 -namespace eprosima { -namespace fastrtps { - -namespace types { - -// First 14 bytes of MD5 of the serialized TypeObject using XCDR -// version 2 with Little Endian encoding -typedef octet EquivalenceHash[14]; - -/*! - * @brief This class represents the union TypeObjectHashId defined by the user in the IDL file. - * @ingroup TYPES_MODULE - */ -class TypeObjectHashId -{ -public: - - /*! - * @brief Default constructor. - */ - TypeObjectHashId(); - - /*! - * @brief Default destructor. - */ - ~TypeObjectHashId(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object TypeObjectHashId that will be copied. - */ - TypeObjectHashId( - const TypeObjectHashId& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object TypeObjectHashId that will be copied. - */ - TypeObjectHashId( - TypeObjectHashId&& x); - - /*! - * @brief Copy assignment. - * @param x Reference to the object TypeObjectHashId that will be copied. - */ - TypeObjectHashId& operator =( - const TypeObjectHashId& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object TypeObjectHashId that will be copied. - */ - TypeObjectHashId& operator =( - TypeObjectHashId&& x); - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - void _d( - uint8_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - uint8_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - uint8_t& _d(); - - /*! - * @brief This function copies the value in member hash - * @param _hash New value to be copied in member hash - */ - void hash( - const EquivalenceHash& _hash); - - /*! - * @brief This function moves the value in member hash - * @param _hash New value to be moved in member hash - */ - void hash( - EquivalenceHash&& _hash); - - /*! - * @brief This function returns a constant reference to member hash - * @return Constant reference to member hash - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - const EquivalenceHash& hash() const; - - /*! - * @brief This function returns a reference to member hash - * @return Reference to member hash - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - EquivalenceHash& hash(); - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - 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. - */ - static size_t getKeyMaxCdrSerializedSize( - size_t current_alignment = 0); - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - -private: - - uint8_t m__d; - - EquivalenceHash m_hash; -}; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // _TYPEOBJECTHASHID_H_ diff --git a/include/fastrtps/types/TypesBase.h b/include/fastrtps/types/TypesBase.h deleted file mode 100644 index 7d5a51f5bd1..00000000000 --- a/include/fastrtps/types/TypesBase.h +++ /dev/null @@ -1,647 +0,0 @@ -// Copyright 2018 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. - -#ifndef TYPES_BASE_H -#define TYPES_BASE_H - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -namespace eprosima { -namespace fastdds { -namespace dds { -using DomainId_t = uint32_t; -} // dds -} // namespace fastdds - -namespace fastcdr { -class Cdr; -} // namespace fastcdr -namespace fastrtps { -namespace types { - -//! A special value indicating an unlimited quantity -constexpr uint32_t BOUND_UNLIMITED = 0; - -using eprosima::fastrtps::rtps::octet; - -using OctetSeq = std::vector; - -OctetSeq& operator ++( - OctetSeq&); - -OctetSeq operator ++( - OctetSeq&, - int); - -size_t to_size_t( - const OctetSeq&); - -const std::string CONST_TRUE = "true"; -const std::string CONST_FALSE = "false"; - -const std::string ANNOTATION_KEY_ID = "key"; -const std::string ANNOTATION_EPKEY_ID = "Key"; -const std::string ANNOTATION_TOPIC_ID = "Topic"; -const std::string ANNOTATION_EXTENSIBILITY_ID = "extensibility"; -const std::string ANNOTATION_FINAL_ID = "final"; -const std::string ANNOTATION_APPENDABLE_ID = "appendable"; -const std::string ANNOTATION_MUTABLE_ID = "mutable"; -const std::string ANNOTATION_NESTED_ID = "nested"; -const std::string ANNOTATION_OPTIONAL_ID = "optional"; -const std::string ANNOTATION_MUST_UNDERSTAND_ID = "must_understand"; -const std::string ANNOTATION_NON_SERIALIZED_ID = "non_serialized"; -const std::string ANNOTATION_BIT_BOUND_ID = "bit_bound"; -const std::string ANNOTATION_DEFAULT_ID = "default"; -const std::string ANNOTATION_DEFAULT_LITERAL_ID = "default_literal"; -const std::string ANNOTATION_VALUE_ID = "value"; -const std::string ANNOTATION_POSITION_ID = "position"; - -const std::string EXTENSIBILITY_FINAL = "FINAL"; -const std::string EXTENSIBILITY_APPENDABLE = "APPENDABLE"; -const std::string EXTENSIBILITY_MUTABLE = "MUTABLE"; - -const std::string TKNAME_BOOLEAN = "bool"; -const std::string TKNAME_INT16 = "int16_t"; -const std::string TKNAME_UINT16 = "uint16_t"; -const std::string TKNAME_INT32 = "int32_t"; -const std::string TKNAME_UINT32 = "uint32_t"; -const std::string TKNAME_INT64 = "int64_t"; -const std::string TKNAME_UINT64 = "uint64_t"; -const std::string TKNAME_CHAR8 = "char"; -const std::string TKNAME_BYTE = "octet"; -const std::string TKNAME_INT8 = "int8_t"; -const std::string TKNAME_UINT8 = "uint8_t"; -const std::string TKNAME_CHAR16 = "wchar"; -const std::string TKNAME_CHAR16T = "wchar_t"; -const std::string TKNAME_FLOAT32 = "float"; -const std::string TKNAME_FLOAT64 = "double"; -const std::string TKNAME_FLOAT128 = "longdouble"; - -const std::string TKNAME_STRING8 = "string"; -const std::string TKNAME_STRING16 = "wstring"; -const std::string TKNAME_ALIAS = "alias"; -const std::string TKNAME_ENUM = "enum"; -const std::string TKNAME_BITMASK = "bitmask"; -const std::string TKNAME_ANNOTATION = "annotation"; -const std::string TKNAME_STRUCTURE = "structure"; -const std::string TKNAME_UNION = "union"; -const std::string TKNAME_BITSET = "bitset"; -const std::string TKNAME_SEQUENCE = "sequence"; -const std::string TKNAME_ARRAY = "array"; -const std::string TKNAME_MAP = "map"; - -// ---------- Equivalence Kinds ------------------ -typedef octet EquivalenceKind; -const octet EK_MINIMAL = 0xF1; // 0x1111 0001 -const octet EK_COMPLETE = 0xF2; // 0x1111 0010 -const octet EK_BOTH = 0xF3; // 0x1111 0011 - -// ---------- TypeKinds (begin) ------------------ -typedef octet TypeKind; // Primitive TKs - -const octet TK_NONE = 0x00; -const octet TK_BOOLEAN = 0x01; -const octet TK_BYTE = 0x02; -const octet TK_INT16 = 0x03; -const octet TK_INT32 = 0x04; -const octet TK_INT64 = 0x05; -const octet TK_UINT16 = 0x06; -const octet TK_UINT32 = 0x07; -const octet TK_UINT64 = 0x08; -const octet TK_FLOAT32 = 0x09; -const octet TK_FLOAT64 = 0x0A; -const octet TK_FLOAT128 = 0x0B; -const octet TK_CHAR8 = 0x10; -const octet TK_CHAR16 = 0x11; - -// String TKs -const octet TK_STRING8 = 0x20; -const octet TK_STRING16 = 0x21; - - -// Constructed/Named types -const octet TK_ALIAS = 0x30; - -// Enumerated TKs -const octet TK_ENUM = 0x40; -const octet TK_BITMASK = 0x41; - -// Structured TKs -const octet TK_ANNOTATION = 0x50; -const octet TK_STRUCTURE = 0x51; -const octet TK_UNION = 0x52; -const octet TK_BITSET = 0x53; - -// Collection TKs -const octet TK_SEQUENCE = 0x60; -const octet TK_ARRAY = 0x61; -const octet TK_MAP = 0x62; - -// ---------- TypeKinds (end) ------------------ - -// The name of some element (e.g. type, type member, module) -// Valid characters are alphanumeric plus the "_" cannot start with digit - -const int32_t MEMBER_NAME_MAX_LENGTH = 256; -typedef std::string MemberName; - -// Qualified type name includes the name of containing modules -// using "::" as separator. No leading "::". E.g. "MyModule::MyType" -const int32_t TYPE_NAME_MAX_LENGTH = 256; -typedef std::string QualifiedTypeName; - -// Every type has an ID. Those of the primitive types are pre-defined. -typedef octet PrimitiveTypeId; - -// First 4 bytes of MD5 of of a member name converted to bytes -// using UTF-8 encoding and without a 'nul' terminator. -// Example: the member name "color" has NameHash {0x70, 0xDD, 0xA5, 0xDF} -typedef std::array NameHash; - -// Mask used to remove the flags that do no affect assignability -// Selects T1, T2, O, M, K, D -const uint16_t MemberFlagMinimalMask = 0x003f; - -/*! - * @brief This class represents the enumeration ReturnCode_t. - */ - -class FASTDDS_EXPORTED_API ReturnCode_t -{ - uint32_t value_; - -public: - - enum ReturnCodeValue - { - RETCODE_OK = 0, - RETCODE_ERROR = 1, - RETCODE_UNSUPPORTED = 2, - RETCODE_BAD_PARAMETER = 3, - RETCODE_PRECONDITION_NOT_MET = 4, - RETCODE_OUT_OF_RESOURCES = 5, - RETCODE_NOT_ENABLED = 6, - RETCODE_IMMUTABLE_POLICY = 7, - RETCODE_INCONSISTENT_POLICY = 8, - RETCODE_ALREADY_DELETED = 9, - RETCODE_TIMEOUT = 10, - RETCODE_NO_DATA = 11, - RETCODE_ILLEGAL_OPERATION = 12, - RETCODE_NOT_ALLOWED_BY_SECURITY = 13 - }; - - ReturnCode_t() - : value_(RETCODE_OK) - { - } - - ReturnCode_t( - uint32_t e) - { - value_ = e; - } - - bool operator ==( - const ReturnCode_t& c) const - { - return value_ == c.value_; - } - - bool operator !=( - const ReturnCode_t& c) const - { - return value_ != c.value_; - } - - explicit operator bool() = delete; - - uint32_t operator ()() const - { - return value_; - } - - bool operator !() const - { - return value_ != 0; - } - -}; - -FASTDDS_EXPORTED_API inline bool operator ==( - ReturnCode_t::ReturnCodeValue a, - const ReturnCode_t& b) -{ - return b.operator ==( - a); -} - -FASTDDS_EXPORTED_API inline bool operator !=( - ReturnCode_t::ReturnCodeValue a, - const ReturnCode_t& b) -{ - return b.operator !=( - a); -} - -FASTDDS_EXPORTED_API inline bool operator ==( - uint32_t a, - const ReturnCode_t& b) -{ - return b.operator ==( - a); -} - -FASTDDS_EXPORTED_API inline bool operator !=( - uint32_t a, - const ReturnCode_t& b) -{ - return b.operator !=( - a); -} - -// TODO Remove this alias when Fast-RTPS reaches version 2 -using ResponseCode = ReturnCode_t; - -typedef uint32_t MemberId; -constexpr uint32_t MEMBER_ID_INVALID {0X0FFFFFFF}; -#define INDEX_INVALID UINT32_MAX - -const int32_t MAX_BITMASK_LENGTH = 64; -const int32_t MAX_ELEMENTS_COUNT = 100; -const int32_t MAX_STRING_LENGTH = 255; - -// Long Bound of a collection type -typedef uint32_t LBound; -typedef std::vector LBoundSeq; -const LBound INVALID_LBOUND = 0; - -// Short Bound of a collection type -typedef octet SBound; -typedef std::vector SBoundSeq; -const SBound INVALID_SBOUND = 0; - -// Auxiliar function to compare sequences (std::vector) -template -bool compareSequence( - const std::vector& a, - const std::vector& b) -{ - if (a.size() == b.size()) - { - auto aIt = a.begin(); - auto bIt = b.begin(); - while (aIt != a.end() && bIt != b.end()) - { - if (*aIt == *bIt) - { - ++aIt; - ++bIt; - } - else - { - return false; - } - } - return true; - } - return false; -} - -// Flags that apply to struct/union/collection/enum/bitmask/bitset -// members/elements and DO affect type assignability -// Depending on the flag it may not apply to members of all types - -// When not all, the applicable member types are listed -class MemberFlag -{ -private: - - std::bitset<16> m_MemberFlag; - -public: - - MemberFlag() - { - } - - MemberFlag( - const MemberFlag& x) - : m_MemberFlag(x.m_MemberFlag) - { - } - - MemberFlag( - MemberFlag&& x) - : m_MemberFlag(std::move(x.m_MemberFlag)) - { - } - - MemberFlag& operator =( - const MemberFlag& x) - { - m_MemberFlag = x.m_MemberFlag; - return *this; - } - - MemberFlag& operator =( - MemberFlag&& x) - { - m_MemberFlag = std::move(x.m_MemberFlag); - return *this; - } - - // T1 | 00 = INVALID, 01 = DISCARD - bool TRY_CONSTRUCT1() const - { - return m_MemberFlag.test(0); - } - - void TRY_CONSTRUCT1( - bool b) - { - b ? m_MemberFlag.set(0) : m_MemberFlag.reset(0); - } - - // T2 | 10 = USE_DEFAULT, 11 = TRIM - bool TRY_CONSTRUCT2() const - { - return m_MemberFlag.test(1); - } - - void TRY_CONSTRUCT2( - bool b) - { - b ? m_MemberFlag.set(1) : m_MemberFlag.reset(1); - } - - // X StructMember, UnionMember, - // CollectionElement - bool IS_EXTERNAL() const - { - return m_MemberFlag.test(2); - } - - void IS_EXTERNAL( - bool b) - { - b ? m_MemberFlag.set(2) : m_MemberFlag.reset(2); - } - - // O StructMember - bool IS_OPTIONAL() const - { - return m_MemberFlag.test(3); - } - - void IS_OPTIONAL( - bool b) - { - b ? m_MemberFlag.set(3) : m_MemberFlag.reset(3); - } - - // M StructMember - bool IS_MUST_UNDERSTAND() const - { - return m_MemberFlag.test(4); - } - - void IS_MUST_UNDERSTAND( - bool b) - { - b ? m_MemberFlag.set(4) : m_MemberFlag.reset(4); - } - - // K StructMember, UnionDiscriminator - bool IS_KEY() const - { - return m_MemberFlag.test(5); - } - - void IS_KEY( - bool b) - { - b ? m_MemberFlag.set(5) : m_MemberFlag.reset(5); - } - - // D UnionMember, EnumerationLiteral - bool IS_DEFAULT() const - { - return m_MemberFlag.test(6); - } - - void IS_DEFAULT( - bool b) - { - b ? m_MemberFlag.set(6) : m_MemberFlag.reset(6); - } - - bool operator ==( - const MemberFlag& other) const - { - return m_MemberFlag == other.m_MemberFlag; - } - - std::bitset<16> bitset() const - { - std::string str_value; - - str_value = m_MemberFlag.to_string() + str_value; - - return std::bitset<16>(str_value); - } - - void bitset( - const std::bitset<16>& bitset) - { - std::string str_value {bitset.to_string()}; - size_t base_diff {0}; - size_t last_post {std::string::npos}; - - base_diff += 16; - m_MemberFlag = std::bitset<16>(str_value.substr(str_value.length() - base_diff, last_post)); - } - -}; - -typedef MemberFlag CollectionElementFlag; // T1, T2, X -typedef MemberFlag StructMemberFlag; // T1, T2, O, M, K, X -typedef MemberFlag UnionMemberFlag; // T1, T2, D, X -typedef MemberFlag UnionDiscriminatorFlag; // T1, T2, K -typedef MemberFlag EnumeratedLiteralFlag; // D -typedef MemberFlag AnnotationParameterFlag; // Unused. No flags apply -typedef MemberFlag AliasMemberFlag; // Unused. No flags apply -typedef MemberFlag BitflagFlag; // Unused. No flags apply -typedef MemberFlag BitsetMemberFlag; // Unused. No flags apply - -// Flags that apply to type declarationa and DO affect assignability -// Depending on the flag it may not apply to all types -// When not all, the applicable types are listed -class TypeFlag -{ -private: - - std::bitset<16> m_TypeFlag; - -public: - - TypeFlag() - { - } - - TypeFlag( - const TypeFlag& x) - : m_TypeFlag(x.m_TypeFlag) - { - } - - TypeFlag( - TypeFlag&& x) - : m_TypeFlag(std::move(x.m_TypeFlag)) - { - } - - TypeFlag& operator =( - const TypeFlag& x) - { - m_TypeFlag = x.m_TypeFlag; - return *this; - } - - TypeFlag& operator =( - TypeFlag&& x) - { - m_TypeFlag = std::move(x.m_TypeFlag); - return *this; - } - - // F | - bool IS_FINAL() const - { - return m_TypeFlag.test(0); - } - - void IS_FINAL( - bool b) - { - b ? m_TypeFlag.set(0) : m_TypeFlag.reset(0); - } - - // A |- Struct, Union - bool IS_APPENDABLE() const - { - return m_TypeFlag.test(1); - } - - void IS_APPENDABLE( - bool b) - { - b ? m_TypeFlag.set(1) : m_TypeFlag.reset(1); - } - - // M | (exactly one flag) - bool IS_MUTABLE() const - { - return m_TypeFlag.test(2); - } - - void IS_MUTABLE( - bool b) - { - b ? m_TypeFlag.set(2) : m_TypeFlag.reset(2); - } - - // N Struct, Union - bool IS_NESTED() const - { - return m_TypeFlag.test(3); - } - - void IS_NESTED( - bool b) - { - b ? m_TypeFlag.set(3) : m_TypeFlag.reset(3); - } - - // H Struct - bool IS_AUTOID_HASH() const - { - return m_TypeFlag.test(4); - } - - void IS_AUTOID_HASH( - bool b) - { - b ? m_TypeFlag.set(4) : m_TypeFlag.reset(4); - } - - bool operator ==( - const TypeFlag& other) const - { - return m_TypeFlag == other.m_TypeFlag; - } - - std::bitset<16> bitset() const - { - std::string str_value; - - str_value = m_TypeFlag.to_string() + str_value; - - return std::bitset<16>(str_value); - } - - void bitset( - const std::bitset<16>& bitset) - { - std::string str_value {bitset.to_string()}; - size_t base_diff {0}; - size_t last_post {std::string::npos}; - - base_diff += 16; - m_TypeFlag = std::bitset<16>(str_value.substr(str_value.length() - base_diff, last_post)); - } - -}; - -typedef TypeFlag StructTypeFlag; // All flags apply -typedef TypeFlag UnionTypeFlag; // All flags apply -typedef TypeFlag CollectionTypeFlag; // Unused. No flags apply -typedef TypeFlag AnnotationTypeFlag; // Unused. No flags apply -typedef TypeFlag AliasTypeFlag; // Unused. No flags apply -typedef TypeFlag EnumTypeFlag; // Unused. No flags apply -typedef TypeFlag BitmaskTypeFlag; // Unused. No flags apply -typedef TypeFlag BitsetTypeFlag; // Unused. No flags apply - -// Mask used to remove the flags that do no affect assignability -const uint16_t TypeFlagMinimalMask = 0x0007; // Selects M, A, F - -// --- Annotation usage: ---------------------------------------------- - -// ID of a type member -const uint32_t ANNOTATION_STR_VALUE_MAX_LEN = 128; -const uint32_t ANNOTATION_OCTETSEC_VALUE_MAX_LEN = 128; - -} // namespace types -} // namespace fastrtps -} // namespace eprosima - -#endif // TYPES_BASE_H diff --git a/include/fastrtps/types/dds-builtin_types.idl b/include/fastrtps/types/dds-builtin_types.idl deleted file mode 100644 index bf373a2a7e0..00000000000 --- a/include/fastrtps/types/dds-builtin_types.idl +++ /dev/null @@ -1,137 +0,0 @@ -module DDS { - @extensibility(APPENDABLE) - struct _String { - string value; - }; - - interface StringDataWriter : DataWriter { - /* This interface shall instantiate the type FooDataWriter defined by - * the DDS specification where "Foo" is an unbounded string. - */ - }; - - interface StringDataReader : DataReader { - /* This interface shall instantiate the type FooDataReader defined by - * the DDS specification where "Foo" is an unbounded string. - */ - }; - - interface StringTypeSupport : TypeSupport { - /* This interface shall instantiate the type FooTypeSupport - * defined by the DDS specification where "Foo" is an unbounded - * string. - */ - }; - - @extensibility(APPENDABLE) - struct KeyedString { - @key string key; - string value; - }; - - typedef sequence KeyedStringSeq; - - interface KeyedStringDataWriter : DataWriter { - /* This interface shall instantiate the type FooDataWriter defined by - * the DDS specification where "Foo" is KeyedString. It also defines - * the operations below. - */ - InstanceHandle_t register_instance_w_key( in string key); - InstanceHandle_t register_instance_w_key_w_timestamp( in string key, in Time_t source_timestamp); - - ReturnCode_t unregister_instance_w_key( in string key); - ReturnCode_t unregister_instance_w_key_w_timestamp( in string key, in Time_t source_timestamp); - - ReturnCode_t write_string_w_key( in string key, in string str, in InstanceHandle_t handle); - ReturnCode_t write_string_w_key_w_timestamp( in string key, in string str, in InstanceHandle_t handle, in Time_t source_timestamp); - - ReturnCode_t dispose_w_key( in string key); - ReturnCode_t dispose_w_key_w_timestamp( in string key, in Time_t source_timestamp); - - ReturnCode_t get_key_value_w_key( inout string key, in InstanceHandle_t handle); - - InstanceHandle_t lookup_instance_w_key( in string key); - }; - - interface KeyedStringDataReader : DataReader { - /* This interface shall instantiate the type FooDataReader defined by - * the DDS specification where "Foo" is KeyedString. - */ - }; - - interface KeyedStringTypeSupport : TypeSupport { - /* This interface shall instantiate the type FooTypeSupport - * defined by the DDS specification where "Foo" is KeyedString. - */ - }; - - - @extensibility(APPENDABLE) - struct Bytes { - ByteSeq value; - }; - typedef sequence BytesSeq; - - interface BytesDataWriter : DataWriter { - /* This interface shall instantiate the type FooDataWriter defined by - * the DDS specification where "Foo" is an unbounded sequence of - * bytes (octets). It also defines the operations below. - */ - ReturnCode_t write_w_bytes( in ByteArray bytes, in long offset, in long length, in InstanceHandle_t handle); - ReturnCode_t write_w_bytes_w_timestamp( in ByteArray bytes, in long offset, in long length, in InstanceHandle_t handle, in Time_t source_timestamp); - }; - - interface BytesDataReader : DataReader { - /* This interface shall instantiate the type FooDataReader defined by - * the DDS specification where "Foo" is Bytes. - */ - }; - - interface BytesTypeSupport : TypeSupport { - /* This interface shall instantiate the type FooTypeSupport - * defined by the DDS specification where "Foo" is Bytes. - */ - }; - - - @extensibility(APPENDABLE) - struct KeyedBytes { - @key string key; - ByteSeq value; - }; - typedef sequence KeyedBytesSeq; - - interface KeyedBytesDataWriter : DataWriter { - /* This interface shall instantiate the type FooDataWriter defined by - * the DDS specification where "Foo" is KeyedBytes. - * It also defines the operations below. - */ - InstanceHandle_t register_instance_w_key( in string key); - InstanceHandle_t register_instance_w_key_w_timestamp( in string key, in Time_t source_timestamp); - - ReturnCode_t unregister_instance_w_key( in string key); - ReturnCode_t unregister_instance_w_key_w_timestamp( in string key, in Time_t source_timestamp); - - ReturnCode_t write_bytes_w_key( in string key, in ByteArray bytes, in long offset, in long length, in InstanceHandle_t handle); - ReturnCode_t write_bytes_w_key_w_timestamp( in string key, in ByteArray bytes, in long offset, in long length, in InstanceHandle_t handle, in Time_t source_timestamp); - - ReturnCode_t dispose_w_key( in string key); - ReturnCode_t dispose_w_key_w_timestamp( in string key, in Time_t source_timestamp); - - ReturnCode_t get_key_value_w_key( inout string key, in InstanceHandle_t handle); - - InstanceHandle_t lookup_instance_w_key( in string key); - }; - - interface KeyedBytesDataReader : DataReader { - /* This interface shall instantiate the type FooDataReader defined by - * the DDS specification where "Foo" is KeyedBytes. - */ - }; - - interface KeyedBytesTypeSupport : TypeSupport { - /* This interface shall instantiate the type FooTypeSupport - * defined by the DDS specification where "Foo" is KeyedBytes. - */ - }; -}; // end module DDS \ No newline at end of file diff --git a/include/fastrtps/types/dds-language_binding.idl b/include/fastrtps/types/dds-language_binding.idl deleted file mode 100644 index f8d7c1fbbb7..00000000000 --- a/include/fastrtps/types/dds-language_binding.idl +++ /dev/null @@ -1,267 +0,0 @@ -module DDS { - local interface DynamicType; - local interface DynamicTypeBuilder; - valuetype TypeDescriptor; - - typedef sequence IncludePathSeq; - - local interface DynamicTypeBuilderFactory { - /*static*/ DynamicTypeBuilderFactory get_instance(); - /*static*/ DDS::ReturnCode_t delete_instance(); - - DynamicType get_primitive_type(in TypeKind kind); - DynamicTypeBuilder create_type(in TypeDescriptor descriptor); - DynamicTypeBuilder create_type_copy(in DynamicType type); - DynamicTypeBuilder create_type_w_type_object(in TypeObject type_object); - DynamicTypeBuilder create_string_type(in unsigned long bound); - DynamicTypeBuilder create_wstring_type(in unsigned long bound); - DynamicTypeBuilder create_sequence_type(in DynamicType element_type, in unsigned long bound); - DynamicTypeBuilder create_array_type(in DynamicType element_type, in BoundSeq bound); - DynamicTypeBuilder create_map_type(in DynamicType key_element_type, in DynamicType element_type, in unsigned long bound); - DynamicTypeBuilder create_bitmask_type(in unsigned long bound); - DynamicTypeBuilder create_type_w_uri( in string document_url, in string type_name, in IncludePathSeq include_paths); - DynamicTypeBuilder create_type_w_document( in string document, in string type_name, in IncludePathSeq include_paths); - DDS::ReturnCode_t delete_type(in DynamicType type); - }; - - interface TypeSupport { - // ReturnCode_t register_type( - // in DomainParticipant domain, - // in string type_name); - // string get_type_name(); - - // DynamicType get_type(); - }; - - /* Implied IDL for type "Foo": - interface FooTypeSupport : DDS::TypeSupport { - DDS::ReturnCode_t register_type( in DDS::DomainParticipant participant, in string type_name); - string get_type_name(); - DynamicType get_type(); - Foo create_sample(in DynamicData src); - DynamicData create_dynamic_sample(in Foo src); - }; */ - - interface DynamicTypeSupport : TypeSupport { - /* This interface shall instantiate the type FooTypeSupport - * defined by the DDS specification where "Foo" is DynamicData. - */ - - /*static*/ DynamicTypeSupport create_type_support( in DynamicType type); - /*static*/ DDS::ReturnCode_t delete_type_support( in DynamicTypeSupport type_support); - - DDS::ReturnCode_t register_type( in DDS::DomainParticipant participant, in ObjectName type_name); - ObjectName get_type_name(); - }; - - typedef map Parameters; - - valuetype AnnotationDescriptor { - public DynamicType type; - - DDS::ReturnCode_t get_value( inout ObjectName value, in ObjectName key); - DDS::ReturnCode_t get_all_value( inout Parameters value); - DDS::ReturnCode_t set_value( in ObjectName key, in ObjectName value); - DDS::ReturnCode_t copy_from(in AnnotationDescriptor other); - boolean equals(in AnnotationDescriptor other); - boolean is_consistent(); - }; - - valuetype TypeDescriptor { - public TypeKind kind; - public ObjectName name; - public DynamicType base_type; - public DynamicType discriminator_type; - public BoundSeq bound; - @optional public DynamicType element_type; - @optional public DynamicType key_element_type; - - DDS::ReturnCode_t copy_from(in TypeDescriptor other); - boolean equals(in TypeDescriptor other); - boolean is_consistent(); - }; - - valuetype MemberDescriptor { - public ObjectName name; - public MemberId id; - public DynamicType type; - public string default_value; - public unsigned long index; - public UnionCaseLabelSeq label; - public boolean default_label; - - DDS::ReturnCode_t copy_from(in MemberDescriptor descriptor); - boolean equals(in MemberDescriptor descriptor); - boolean is_consistent(); - }; - - local interface DynamicTypeMember { - DDS::ReturnCode_t get_descriptor( inout MemberDescriptor descriptor); - - unsigned long get_annotation_count(); - DDS::ReturnCode_t get_annotation( inout AnnotationDescriptor descriptor, in unsigned long idx); - - boolean equals(in DynamicTypeMember other); - - MemberId get_id(); - ObjectName get_name(); - }; - - typedef map DynamicTypeMembersByName; - typedef map DynamicTypeMembersById; - - local interface DynamicTypeBuilder { - DDS::ReturnCode_t get_descriptor( inout TypeDescriptor descriptor); - - ObjectName get_name(); - TypeKind get_kind(); - - DDS::ReturnCode_t get_member_by_name( inout DynamicTypeMember member, in ObjectName name); - DDS::ReturnCode_t get_all_members_by_name( inout DynamicTypeMembersByName member); - - DDS::ReturnCode_t get_member( inout DynamicTypeMember member, in MemberId id); - DDS::ReturnCode_t get_all_members( inout DynamicTypeMembersById member); - - unsigned long get_annotation_count(); - DDS::ReturnCode_t get_annotation( inout AnnotationDescriptor descriptor, in unsigned long idx); - - boolean equals(in DynamicType other); - DDS::ReturnCode_t add_member(in MemberDescriptor descriptor); - DDS::ReturnCode_t apply_annotation( in AnnotationDescriptor descriptor); - - DynamicType build(); - }; - - local interface DynamicType { - DDS::ReturnCode_t get_descriptor( inout TypeDescriptor descriptor); - - ObjectName get_name(); - TypeKind get_kind(); - - DDS::ReturnCode_t get_member_by_name( inout DynamicTypeMember member, in ObjectName name); - DDS::ReturnCode_t get_all_members_by_name( inout DynamicTypeMembersByName member); - - DDS::ReturnCode_t get_member( inout DynamicTypeMember member, in MemberId id); - DDS::ReturnCode_t get_all_members( inout DynamicTypeMembersById member); - - unsigned long get_annotation_count(); - DDS::ReturnCode_t get_annotation( inout AnnotationDescriptor descriptor, in unsigned long idx); - - boolean equals(in DynamicType other); - }; - - local interface DynamicData; - - local interface DynamicDataFactory { - /*static*/ DynamicDataFactory get_instance(); - /*static*/ DDS::ReturnCode_t delete_instance(); - - DynamicData create_data(); - DDS::ReturnCode_t delete_data(in DynamicData data); - }; - - typedef sequence Int32Seq; - typedef sequence UInt32Seq; - typedef sequence Int16Seq; - typedef sequence UInt16Seq; - typedef sequence Int64Seq; - typedef sequence UInt64Seq; - typedef sequence Float32Seq; - typedef sequence Float64Seq; - typedef sequence Float128Seq; - typedef sequence CharSeq; - typedef sequence WcharSeq; - typedef sequence BooleanSeq; - typedef sequence ByteSeq; - - // typedef sequence StringSeq; - typedef sequence WstringSeq; - - local interface DynamicData { - readonly attribute DynamicType type; - - DDS::ReturnCode_t get_descriptor( inout MemberDescriptor value, in MemberId id); - DDS::ReturnCode_t set_descriptor( in MemberId id, in MemberDescriptor value); - - boolean equals(in DynamicData other); - - MemberId get_member_id_by_name(in ObjectName name); - MemberId get_member_id_at_index(in unsigned long index); - - unsigned long get_item_count(); - - DDS::ReturnCode_t clear_all_values(); - DDS::ReturnCode_t clear_nonkey_values(); - DDS::ReturnCode_t clear_value(in MemberId id); - - DynamicData loan_value(in MemberId id); - DDS::ReturnCode_t return_loaned_value(in DynamicData value); - - DynamicData clone(); - - DDS::ReturnCode_t get_int32_value( inout long value, in MemberId id); - DDS::ReturnCode_t set_int32_value( in MemberId id, in long value); - DDS::ReturnCode_t get_uint32_value( inout unsigned long value, in MemberId id); - DDS::ReturnCode_t set_uint32_value( in MemberId id, in unsigned long value); - DDS::ReturnCode_t get_int16_value( inout short value, in MemberId id); - DDS::ReturnCode_t set_int16_value( in MemberId id, in short value); - DDS::ReturnCode_t get_uint16_value( inout unsigned short value, in MemberId id); - DDS::ReturnCode_t set_uint16_value( in MemberId id, in unsigned short value); - DDS::ReturnCode_t get_int64_value( inout long long value, in MemberId id); - DDS::ReturnCode_t set_int64_value( in MemberId id, in long long value); - DDS::ReturnCode_t get_uint64_value( inout unsigned long long value, in MemberId id); - DDS::ReturnCode_t set_uint64_value( in MemberId id, in unsigned long long value); - DDS::ReturnCode_t get_float32_value( inout float value, in MemberId id); - DDS::ReturnCode_t set_float32_value( in MemberId id, in float value); - DDS::ReturnCode_t get_float64_value( inout double value, in MemberId id); - DDS::ReturnCode_t set_float64_value( in MemberId id, in double value); - DDS::ReturnCode_t get_float128_value( inout long double value, in MemberId id); - DDS::ReturnCode_t set_float128_value( in MemberId id, in long double value); - DDS::ReturnCode_t get_char8_value( inout char value, in MemberId id); - DDS::ReturnCode_t set_char8_value( in MemberId id, in char value); - DDS::ReturnCode_t get_char16_value( inout wchar value, in MemberId id); - DDS::ReturnCode_t set_char16_value( in MemberId id, in wchar value); - DDS::ReturnCode_t get_byte_value( inout octet value, in MemberId id); - DDS::ReturnCode_t set_byte_value( in MemberId id, in octet value); - DDS::ReturnCode_t get_boolean_value( inout boolean value, in MemberId id); - DDS::ReturnCode_t set_boolean_value( in MemberId id, in boolean value); - DDS::ReturnCode_t get_string_value( inout string value, in MemberId id); - DDS::ReturnCode_t set_string_value( in MemberId id, in string value); - DDS::ReturnCode_t get_wstring_value( inout wstring value, in MemberId id); - DDS::ReturnCode_t set_wstring_value( in MemberId id, in wstring value); - - DDS::ReturnCode_t get_complex_value( inout DynamicData value, in MemberId id); - DDS::ReturnCode_t set_complex_value( in MemberId id, in DynamicData value); - - DDS::ReturnCode_t get_int32_values( inout Int32Seq value, in MemberId id); - DDS::ReturnCode_t set_int32_values( in MemberId id, in Int32Seq value); - DDS::ReturnCode_t get_uint32_values( inout UInt32Seq value, in MemberId id); - DDS::ReturnCode_t set_uint32_values( in MemberId id, in UInt32Seq value); - DDS::ReturnCode_t get_int16_values( inout Int16Seq value, in MemberId id); - DDS::ReturnCode_t set_int16_values( in MemberId id, in Int16Seq value); - DDS::ReturnCode_t get_uint16_values( inout UInt16Seq value, in MemberId id); - DDS::ReturnCode_t set_uint16_values( in MemberId id, in UInt16Seq value); - DDS::ReturnCode_t get_int64_values( inout Int64Seq value, in MemberId id); - DDS::ReturnCode_t set_int64_values( in MemberId id, in Int64Seq value); - DDS::ReturnCode_t get_uint64_values( inout UInt64Seq value, in MemberId id); - DDS::ReturnCode_t set_uint64_values( in MemberId id, in UInt64Seq value); - DDS::ReturnCode_t get_float32_values( inout Float32Seq value, in MemberId id); - DDS::ReturnCode_t set_float32_values( in MemberId id, in Float32Seq value); - DDS::ReturnCode_t get_float64_values( inout Float64Seq value, in MemberId id); - DDS::ReturnCode_t set_float64_values( in MemberId id, in Float64Seq value); - DDS::ReturnCode_t get_float128_values( inout Float128Seq value, in MemberId id); - DDS::ReturnCode_t set_float128_values( in MemberId id, in Float128Seq value); - DDS::ReturnCode_t get_char8_values( inout CharSeq value, in MemberId id); - DDS::ReturnCode_t set_char8_values( in MemberId id, in CharSeq value); - DDS::ReturnCode_t get_char16_values( inout WcharSeq value, in MemberId id); - DDS::ReturnCode_t set_char16_values( in MemberId id, in WcharSeq value); - DDS::ReturnCode_t get_byte_values( inout ByteSeq value, in MemberId id); - DDS::ReturnCode_t set_byte_values( in MemberId id, in ByteSeq value); - DDS::ReturnCode_t get_boolean_values( inout BooleanSeq value, in MemberId id); - DDS::ReturnCode_t set_boolean_values( in MemberId id, in BooleanSeq value); - DDS::ReturnCode_t get_string_values( inout StringSeq value, in MemberId id); - DDS::ReturnCode_t set_string_values( in MemberId id, in StringSeq value); - DDS::ReturnCode_t get_wstring_values( inout WstringSeq value, in MemberId id); - DDS::ReturnCode_t set_wstring_values( in MemberId id, in WstringSeq value); - }; // local interface DynamicData -}; // end module DDS diff --git a/include/fastrtps/types/dds-xtypes_discovery.idl b/include/fastrtps/types/dds-xtypes_discovery.idl deleted file mode 100644 index c9df7aba0e4..00000000000 --- a/include/fastrtps/types/dds-xtypes_discovery.idl +++ /dev/null @@ -1,298 +0,0 @@ -/* dds-xtypes_discovery.idl */ - -// The types in this file shall be serialized with XCDR encoding version 1 -module DDS { - @extensibility(APPENDABLE) @nested - struct BuiltinTopicKey_t { - octet value[16]; - }; - - @extensibility(FINAL) @nested - struct Duration_t { - long sec; unsigned long nanosec; - }; - - @extensibility(APPENDABLE) @nested - struct DeadlineQosPolicy { - Duration_t period; - }; - - enum DestinationOrderQosPolicyKind { - BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS, - BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS - }; - - @extensibility(APPENDABLE) @nested - struct DestinationOrderQosPolicy { - DestinationOrderQosPolicyKind kind; - }; - - enum DurabilityQosPolicyKind { - VOLATILE_DURABILITY_QOS, - TRANSIENT_LOCAL_DURABILITY_QOS, - TRANSIENT_DURABILITY_QOS, - PERSISTENT_DURABILITY_QOS - }; - - @extensibility(APPENDABLE) @nested - struct DurabilityQosPolicy { - DurabilityQosPolicyKind kind; - }; - - enum HistoryQosPolicyKind { - KEEP_LAST_HISTORY_QOS, - KEEP_ALL_HISTORY_QOS - }; - - @extensibility(APPENDABLE) @nested - struct HistoryQosPolicy { - HistoryQosPolicyKind kind; - long depth; - }; - - @extensibility(APPENDABLE) @nested - struct DurabilityServiceQosPolicy { - Duration_t service_cleanup_delay; - HistoryQosPolicyKind history_kind; - long history_depth; - long max_samples; - long max_instances; - long max_samples_per_instance; - }; - - @extensibility(APPENDABLE) @nested - struct GroupDataQosPolicy { - ByteSeq value; - }; - - @extensibility(APPENDABLE) @nested - struct LatencyBudgetQosPolicy { - Duration_t duration; - }; - - @extensibility(APPENDABLE) @nested - struct LifespanQosPolicy { - Duration_t duration; - }; - - enum LivelinessQosPolicyKind { - AUTOMATIC_LIVELINESS_QOS, - MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, - MANUAL_BY_TOPIC_LIVELINESS_QOS - }; - - @extensibility(APPENDABLE) @nested - struct LivelinessQosPolicy { - LivelinessQosPolicyKind kind; - Duration_t lease_duration; - }; - - enum OwnershipQosPolicyKind { - SHARED_OWNERSHIP_QOS, - EXCLUSIVE_OWNERSHIP_QOS - }; - - @extensibility(APPENDABLE) @nested - struct OwnershipQosPolicy { - OwnershipQosPolicyKind kind; - }; - - @extensibility(APPENDABLE) @nested - struct OwnershipStrengthQosPolicy { - long value; - }; - - @extensibility(APPENDABLE) @nested - struct PartitionQosPolicy { - StringSeq name; - }; - - enum PresentationQosPolicyAccessScopeKind { - INSTANCE_PRESENTATION_QOS, - TOPIC_PRESENTATION_QOS, - GROUP_PRESENTATION_QOS - }; - - @extensibility(APPENDABLE) @nested - struct PresentationQosPolicy { - PresentationQosPolicyAccessScopeKind access_scope; - boolean coherent_access; - boolean ordered_access; - }; - - enum ReliabilityQosPolicyKind { - BEST_EFFORT_RELIABILITY_QOS, - RELIABLE_RELIABILITY_QOS - }; - - @extensibility(APPENDABLE) @nested - struct ReliabilityQosPolicy { - ReliabilityQosPolicyKind kind; - Duration_t max_blocking_time; - }; - - @extensibility(APPENDABLE) @nested - struct ResourceLimitsQosPolicy { - long max_samples; - long max_instances; - long max_samples_per_instance; - }; - - @extensibility(APPENDABLE) @nested - struct TimeBasedFilterQosPolicy { - Duration_t minimum_separation; - }; - - @extensibility(APPENDABLE) @nested - struct TopicDataQosPolicy { - ByteSeq value; - }; - - @extensibility(APPENDABLE) @nested - struct TransportPriorityQosPolicy { - long value; - }; - - @extensibility(APPENDABLE) @nested - struct UserDataQosPolicy { - ByteSeq value; - }; - - @extensibility(MUTABLE) - struct ParticipantBuiltinTopicData { - @id(0x0050) @key BuiltinTopicKey_t key; - @id(0x002C) UserDataQosPolicy user_data; - }; - - typedef short DataRepresentationId_t; - - const DataRepresentationId_t XCDR_DATA_REPRESENTATION = 0; - const DataRepresentationId_t XML_DATA_REPRESENTATION = 1; - const DataRepresentationId_t XCDR2_DATA_REPRESENTATION = 2; - - typedef sequence DataRepresentationIdSeq; - - const QosPolicyId_t DATA_REPRESENTATION_QOS_POLICY_ID = 23; - const string DATA_REPRESENTATION_QOS_POLICY_NAME = "DataRepresentation"; - - @extensibility(APPENDABLE) @nested - struct DataRepresentationQosPolicy { - DataRepresentationIdSeq value; - }; - - @bit_bound(16) enum TypeConsistencyKind { - DISALLOW_TYPE_COERCION, - ALLOW_TYPE_COERCION - }; - - const QosPolicyId_t TYPE_CONSISTENCY_ENFORCEMENT_QOS_POLICY_ID = 24; - const string TYPE_CONSISTENCY_ENFORCEMENT_QOS_POLICY_NAME = "TypeConsistencyEnforcement"; - - @extensibility(APPENDABLE) @nested - struct TypeConsistencyEnforcementQosPolicy { - TypeConsistencyKind kind; - boolean ignore_sequence_bounds; - boolean ignore_string_bounds; - boolean ignore_member_names; - boolean prevent_type_widening; - boolean force_type_validation; - }; - - @extensibility(MUTABLE) - struct TopicBuiltinTopicData { - @id(0x005A) @key BuiltinTopicKey_t key; - @id(0x0005) ObjectName name; - @id(0x0007) ObjectName type_name; - @id(0x0069) @optional TypeIdV1 type_id; // XTYPES 1.1 - @id(0x0072) @optional TypeObjectV1 type; // XTYPES 1.1 - @id(0x0075) @optional XTypes::TypeInformation type_information; - // XTYPES 1.2 - @id(0x001D) DurabilityQosPolicy durability; - @id(0x001E) DurabilityServiceQosPolicy durability_service; - @id(0x0023) DeadlineQosPolicy deadline; - @id(0x0027) LatencyBudgetQosPolicy latency_budget; - @id(0x001B) LivelinessQosPolicy liveliness; - @id(0x001A) ReliabilityQosPolicy reliability; - @id(0x0049) TransportPriorityQosPolicy transport_priority; - @id(0x002B) LifespanQosPolicy lifespan; - @id(0x0025) DestinationOrderQosPolicy destination_order; - @id(0x0040) HistoryQosPolicy history; - @id(0x0041) ResourceLimitsQosPolicy resource_limits; - @id(0x001F) OwnershipQosPolicy ownership; - @id(0x002E) TopicDataQosPolicy topic_data; - @id(0x0073) DataRepresentationQosPolicy representation; - }; - - @extensibility(MUTABLE) struct TopicQos { - // ... - DataRepresentationQosPolicy representation; - }; - - @extensibility(MUTABLE) - struct PublicationBuiltinTopicData { - @id(0x005A) @key BuiltinTopicKey_t key; - @id(0x0050) BuiltinTopicKey_t participant_key; - @id(0x0005) ObjectName topic_name; - @id(0x0007) ObjectName type_name; - @id(0x0069) @optional TypeIdV1 type_id; // XTYPES 1.1 - @id(0x0072) @optional TypeObjectV1 type; // XTYPES 1.1 - @id(0x0075) @optional XTypes::TypeInformation type_information; - // XTYPES 1.2 - @id(0x001D) DurabilityQosPolicy durability; - @id(0x001E) DurabilityServiceQosPolicy durability_service; - @id(0x0023) DeadlineQosPolicy deadline; - @id(0x0027) LatencyBudgetQosPolicy latency_budget; - @id(0x001B) LivelinessQosPolicy liveliness; - @id(0x001A) ReliabilityQosPolicy reliability; - @id(0x002B) LifespanQosPolicy lifespan; - @id(0x002C) UserDataQosPolicy user_data; - @id(0x001F) OwnershipQosPolicy ownership; - @id(0x0006) OwnershipStrengthQosPolicy ownership_strength; - @id(0x0025) DestinationOrderQosPolicy destination_order; - @id(0x0021) PresentationQosPolicy presentation; - @id(0x0029) PartitionQosPolicy partition; - @id(0x002E) TopicDataQosPolicy topic_data; - @id(0x002D) GroupDataQosPolicy group_data; - @id(0x0073) DataRepresentationQosPolicy representation; - }; - - @extensibility(MUTABLE) - struct DataWriterQos { - // ... DataRepresentationQosPolicy representation; - }; - - @extensibility(MUTABLE) - struct SubscriptionBuiltinTopicData { - @id(0x005A) @key BuiltinTopicKey_t key; - @id(0x0050) BuiltinTopicKey_t participant_key; - @id(0x0005) ObjectName topic_name; - @id(0x0007) ObjectName type_name; - @id(0x0069) @optional TypeIdV1 type_id; // XTYPES 1.1 - @id(0x0072) @optional TypeObjectV1 type; // XTYPES 1.1 - @id(0x0075) @optional XTypes::TypeInformation type_information; - // XTYPES 1.2 - @id(0x001D) DurabilityQosPolicy durability; - @id(0x0023) DeadlineQosPolicy deadline; - @id(0x0027) LatencyBudgetQosPolicy latency_budget; - @id(0x001B) LivelinessQosPolicy liveliness; - @id(0x001A) ReliabilityQosPolicy reliability; - @id(0x001F) OwnershipQosPolicy ownership; - @id(0x0025) DestinationOrderQosPolicy destination_order; - @id(0x002C) UserDataQosPolicy user_data; - @id(0x0004) TimeBasedFilterQosPolicy time_based_filter; - @id(0x0021) PresentationQosPolicy presentation; - @id(0x0029) PartitionQosPolicy partition; - @id(0x002E) TopicDataQosPolicy topic_data; - @id(0x002D) GroupDataQosPolicy group_data; - @id(0x0073) DataRepresentationQosPolicy representation; - @id(0x0074) TypeConsistencyEnforcementQosPolicy type_consistency; - }; - - @extensibility(MUTABLE) - struct DataReaderQos { - // ... - DataRepresentationQosPolicy representation; - TypeConsistencyEnforcementQosPolicy type_consistency; - }; -}; // end module DDS - \ No newline at end of file diff --git a/include/fastrtps/types/dds-xtypes_typeobject.idl b/include/fastrtps/types/dds-xtypes_typeobject.idl deleted file mode 100644 index 465300a4c7b..00000000000 --- a/include/fastrtps/types/dds-xtypes_typeobject.idl +++ /dev/null @@ -1,1077 +0,0 @@ -/* dds-xtypes_typeobject.idl */ - -// The types in this file shall be serialized with XCDR encoding version 2 -module DDS { - module XTypes { - - // ---------- Equivalence Kinds ------------------ - typedef octet EquivalenceKind; - const octet EK_MINIMAL = 0xF1; // 0x1111 0001 - const octet EK_COMPLETE = 0xF2; // 0x1111 0010 - const octet EK_BOTH = 0xF3; // 0x1111 0011 - - // ---------- TypeKinds (begin) ------------------ - typedef octet TypeKind; // Primitive TKs - - const octet TK_NONE = 0x00; - const octet TK_BOOLEAN = 0x01; - const octet TK_BYTE = 0x02; - const octet TK_INT16 = 0x03; - const octet TK_INT32 = 0x04; - const octet TK_INT64 = 0x05; - const octet TK_UINT16 = 0x06; - const octet TK_UINT32 = 0x07; - const octet TK_UINT64 = 0x08; - const octet TK_FLOAT32 = 0x09; - const octet TK_FLOAT64 = 0x0A; - const octet TK_FLOAT128 = 0x0B; - const octet TK_CHAR8 = 0x10; - const octet TK_CHAR16 = 0x11; - - // String TKs - const octet TK_STRING8 = 0x20; - const octet TK_STRING16 = 0x21; - - - // Constructed/Named types - const octet TK_ALIAS = 0x30; - - // Enumerated TKs - const octet TK_ENUM = 0x40; - const octet TK_BITMASK = 0x41; - - // Structured TKs - const octet TK_ANNOTATION = 0x50; - const octet TK_STRUCTURE = 0x51; - const octet TK_UNION = 0x52; - const octet TK_BITSET = 0x53; - - // Collection TKs - const octet TK_SEQUENCE = 0x60; - const octet TK_ARRAY = 0x61; - const octet TK_MAP = 0x62; - - // ---------- TypeKinds (end) ------------------ - - // ---------- Extra TypeIdentifiers (begin) ----------- - typedef octet TypeIdentiferKind; - const octet TI_STRING8_SMALL = 0x70; - const octet TI_STRING8_LARGE = 0x71; - const octet TI_STRING16_SMALL = 0x72; - const octet TI_STRING16_LARGE = 0x73; - - const octet TI_PLAIN_SEQUENCE_SMALL = 0x80; - const octet TI_PLAIN_SEQUENCE_LARGE = 0x81; - const octet TI_PLAIN_ARRAY_SMALL = 0x90; - const octet TI_PLAIN_ARRAY_LARGE = 0x91; - const octet TI_PLAIN_MAP_SMALL = 0xA0; - const octet TI_PLAIN_MAP_LARGE = 0xA1; - - const octet TI_STRONGLY_CONNECTED_COMPONENT = 0xB0; - - // ---------- Extra TypeIdentifiers (end) ------------- - - // The name of some element (e.g. type, type member, module) - // Valid characters are alphanumeric plus the "_" cannot start with digit - - const long MEMBER_NAME_MAX_LENGTH = 256; typedef string MemberName; - - // Qualified type name includes the name of containing modules - // using "::" as separator. No leading "::". E.g. "MyModule::MyType" - const long TYPE_NAME_MAX_LENGTH = 256; - typedef string QualifiedTypeName; - - // Every type has an ID. Those of the primitive types are pre-defined. - typedef octet PrimitiveTypeId; - - // First 14 bytes of MD5 of the serialized TypeObject using XCDR - // version 2 with Little Endian encoding - typedef octet EquivalenceHash[14]; - - // First 4 bytes of MD5 of of a member name converted to bytes - // using UTF-8 encoding and without a 'nul' terminator. - // Example: the member name "color" has NameHash {0x70, 0xDD, 0xA5, 0xDF} - - typedef octet NameHash[4]; - - // Long Bound of a collection type - typedef unsigned long LBound; - typedef sequence LBoundSeq; - const LBound INVALID_LBOUND = 0; - - // Short Bound of a collection type - typedef octet SBound; - typedef sequence SBoundSeq; - const SBound INVALID_SBOUND = 0; - - @extensibility(FINAL) @nested - union TypeObjectHashId switch (octet) { - case EK_COMPLETE: - case EK_MINIMAL: - EquivalenceHash hash; - }; - - // Flags that apply to struct/union/collection/enum/bitmask/bitset - // members/elements and DO affect type assignability - // Depending on the flag it may not apply to members of all types - - // When not all, the applicable member types are listed - @bit_bound(16) - bitmask MemberFlag { - @position(0) TRY_CONSTRUCT1, // T1 | 00 = INVALID, 01 = DISCARD - @position(1) TRY_CONSTRUCT2, // T2 | 10 = USE_DEFAULT, 11 = TRIM - @position(2) IS_EXTERNAL, // X StructMember, UnionMember, - // CollectionElement - @position(3) IS_OPTIONAL, // O StructMember - @position(4) IS_MUST_UNDERSTAND, // M StructMember - @position(5) IS_KEY, // K StructMember, UnionDiscriminator - @position(6) IS_DEFAULT // D UnionMember, EnumerationLiteral - }; - - typedef MemberFlag CollectionElementFlag; // T1, T2, X - typedef MemberFlag StructMemberFlag; // T1, T2, O, M, K, X - typedef MemberFlag UnionMemberFlag; // T1, T2, D, X - typedef MemberFlag UnionDiscriminatorFlag; // T1, T2, K - typedef MemberFlag EnumeratedLiteralFlag; // D - typedef MemberFlag AnnotationParameterFlag; // Unused. No flags apply - typedef MemberFlag AliasMemberFlag; // Unused. No flags apply - typedef MemberFlag BitflagFlag; // Unused. No flags apply - typedef MemberFlag BitsetMemberFlag; // Unused. No flags apply - - // Mask used to remove the flags that do no affect assignability - // Selects T1, T2, O, M, K, D - const unsigned short MemberFlagMinimalMask = 0x003f; - - // Flags that apply to type declarationa and DO affect assignability - // Depending on the flag it may not apply to all types - // When not all, the applicable types are listed - @bit_bound(16) bitmask TypeFlag { - @position(0) IS_FINAL, // F | - @position(1) IS_APPENDABLE, // A |- Struct, Union - @position(2) IS_MUTABLE, // M | (exactly one flag) - @position(3) IS_NESTED, // N Struct, Union - @position(4) IS_AUTOID_HASH // H Struct - }; - - typedef TypeFlag StructTypeFlag; // All flags apply - typedef TypeFlag UnionTypeFlag; // All flags apply - typedef TypeFlag CollectionTypeFlag; // Unused. No flags apply - typedef TypeFlag AnnotationTypeFlag; // Unused. No flags apply - typedef TypeFlag AliasTypeFlag; // Unused. No flags apply - typedef TypeFlag EnumTypeFlag; // Unused. No flags apply - typedef TypeFlag BitmaskTypeFlag; // Unused. No flags apply - typedef TypeFlag BitsetTypeFlag; // Unused. No flags apply - - // Mask used to remove the flags that do no affect assignability - const unsigned short TypeFlagMinimalMask = 0x0007; // Selects M, A, F - - // Forward declaration - union TypeIdentifier; - - // 1 Byte - @extensibility(FINAL) @nested - struct StringSTypeDefn { - SBound bound; - }; - - // 4 Bytes - @extensibility(FINAL) @nested - struct StringLTypeDefn { - LBound bound; - }; - - @extensibility(FINAL) @nested - struct PlainCollectionHeader { - EquivalenceKind equiv_kind; - CollectionElementFlag element_flags; - }; - - @extensibility(FINAL) @nested - struct PlainSequenceSElemDefn { - PlainCollectionHeader header; - SBound bound; - @external TypeIdentifier element_identifier; - }; - - @extensibility(FINAL) @nested - struct PlainSequenceLElemDefn { - PlainCollectionHeader header; - LBound bound; - @external TypeIdentifier element_identifier; - }; - - @extensibility(FINAL) @nested - struct PlainArraySElemDefn { - PlainCollectionHeader header; - SBoundSeq array_bound_seq; - @external TypeIdentifier element_identifier; - }; - - @extensibility(FINAL) @nested - struct PlainArrayLElemDefn { - PlainCollectionHeader header; - LBoundSeq array_bound_seq; - @external TypeIdentifier element_identifier; - }; - - @extensibility(FINAL) @nested - struct PlainMapSTypeDefn { - PlainCollectionHeader header; - SBound bound; - @external TypeIdentifier element_identifier; - CollectionElementFlag key_flags; - @external TypeIdentifier key_identifier; - }; - - @extensibility(FINAL) @nested - struct PlainMapLTypeDefn { - PlainCollectionHeader header; - LBound bound; - @external TypeIdentifier element_identifier; - CollectionElementFlag key_flags; - @external TypeIdentifier key_identifier; - }; - - // Used for Types that have cyclic depencencies with other types - @extensibility(APPENDABLE) @nested - struct StronglyConnectedComponentId { - TypeObjectHashId sc_component_id; // Hash StronglyConnectedComponent - long scc_length; // StronglyConnectedComponent.length - long scc_index ; // identify type in Strongly Connected Comp. - }; - - // Future extensibility - @extensibility(MUTABLE) @nested - struct ExtendedTypeDefn { - // Empty. Available for future extension - }; - - - // The TypeIdentifier uniquely identifies a type (a set of equivalent - // types according to an equivalence relationship: COMPLETE, MNIMAL). - // - // In some cases (primitive types, strings, plain types) the identifier - // is a explicit description of the type. - // In other cases the Identifier is a Hash of the type description - // - // In the case of primitive types and strings the implied equivalence - // relation is the identity. - // - // For Plain Types and Hash-defined TypeIdentifiers there are three - // possibilities: MINIMAL, COMPLETE, and COMMON: - // - MINIMAL indicates the TypeIdentifier identifies equivalent types - // according to the MINIMAL equivalence relation - // - COMPLETE indicates the TypeIdentifier identifies equivalent types - // according to the COMPLETE equivalence relation - // - COMMON indicates the TypeIdentifier identifies equivalent types - // according to both the MINIMAL and the COMMON equivalence relation. - // This means the TypeIdentifier is the same for both relationships - // - - @extensibility(FINAL) @nested - union TypeIdentifier switch (octet) { - // ============ Primitive types - use TypeKind ==================== - // All primitive types fall here. - // Commented-out because Unions cannot have cases with no member. - /* case TK_NONE: - case TK_BOOLEAN: - case TK_BYTE_TYPE: - case TK_INT16_TYPE: - case TK_INT32_TYPE: - case TK_INT64_TYPE: - case TK_UINT16_TYPE: - case TK_UINT32_TYPE: - case TK_UINT64_TYPE: - case TK_FLOAT32_TYPE: - case TK_FLOAT64_TYPE: - case TK_FLOAT128_TYPE: - case TK_CHAR8_TYPE: - case TK_CHAR16_TYPE: - // No Value - */ - - // ============ Strings - use TypeIdentifierKind =================== - case TI_STRING8_SMALL: - case TI_STRING16_SMALL: - StringSTypeDefn string_sdefn; - - case TI_STRING8_LARGE: - case TI_STRING16_LARGE: - StringLTypeDefn string_ldefn; - - // ============ Plain collectios - use TypeIdentifierKind ========= - case TI_PLAIN_SEQUENCE_SMALL: - PlainSequenceSElemDefn seq_sdefn; - case TI_PLAIN_SEQUENCE_LARGE: - PlainSequenceLElemDefn seq_ldefn; - - case TI_PLAIN_ARRAY_SMALL: - PlainArraySElemDefn array_sdefn; - case TI_PLAIN_ARRAY_LARGE: - PlainArrayLElemDefn array_ldefn; - - case TI_PLAIN_MAP_SMALL: - PlainMapSTypeDefn map_sdefn; - case TI_PLAIN_MAP_LARGE: - PlainMapLTypeDefn map_ldefn; - - // ============ Types that are mutually dependent on each other === - case TI_STRONGLY_CONNECTED_COMPONENT: - StronglyConnectedComponentId sc_component_id; - - // ============ The remaining cases - use EquivalenceKind ========= - case EK_COMPLETE: - case EK_MINIMAL: - EquivalenceHash equivalence_hash; - - // =================== Future extensibility ============ - // Future extensions - default: ExtendedTypeDefn extended_defn; - }; - typedef sequence TypeIdentifierSeq; - - - // --- Annotation usage: ---------------------------------------------- - - // ID of a type member - typedef unsigned long MemberId; - const unsigned long ANNOTATION_STR_VALUE_MAX_LEN = 128; - const unsigned long ANNOTATION_OCTETSEC_VALUE_MAX_LEN = 128; - - @extensibility(MUTABLE) @nested - struct ExtendedAnnotationParameterValue { - // Empty. Available for future extension - }; - - /* Literal value of an annotation member: either the default value in its - * definition or the value applied in its usage. - */ - - @extensibility(FINAL) @nested - union AnnotationParameterValue switch (octet) { - case TK_BOOLEAN: - boolean boolean_value; - case TK_BYTE: - octet byte_value; - case TK_INT16: - short int16_value; - case TK_UINT16: - unsigned short uint_16_value; - case TK_INT32: - long int32_value; - case TK_UINT32: - unsigned long uint32_value; - case TK_INT64: - long long int64_value; - case TK_UINT64: - unsigned long long uint64_value; - case TK_FLOAT32: - float float32_value; - case TK_FLOAT64: - double float64_value; - case TK_FLOAT128: - long double float128_value; - case TK_CHAR8: - char char_value; - case TK_CHAR16: - wchar wchar_value; - case TK_ENUM: - long enumerated_value; - case TK_STRING8: - string string8_value; - case TK_STRING16: - wstring string16_value; - default: - ExtendedAnnotationParameterValue extended_value; - }; - - // The application of an annotation to some type or type member - @extensibility(APPENDABLE) @nested - struct AppliedAnnotationParameter { - NameHash paramname_hash; - AnnotationParameterValue value; - }; - - // Sorted by AppliedAnnotationParameter.paramname_hash - typedef - sequence AppliedAnnotationParameterSeq; - - @extensibility(APPENDABLE) @nested - struct AppliedAnnotation { - TypeIdentifier annotation_typeid; - @optional AppliedAnnotationParameterSeq param_seq; - }; - - // Sorted by AppliedAnnotation.annotation_typeid - typedef sequence AppliedAnnotationSeq; - - // @verbatim(placement="", language="", text="") - @extensibility(FINAL) @nested - struct AppliedVerbatimAnnotation { - string<32> placement; - string<32> language; - string text; - }; - - // --- Aggregate types: ----------------------------------------------- - @extensibility(APPENDABLE) @nested - struct AppliedBuiltinMemberAnnotations { - @optional string unit; // @unit("") - @optional AnnotationParameterValue min; // @min , @range - @optional AnnotationParameterValue max; // @max , @range - @optional string hash_id; // @hash_id("") - }; - - @extensibility(FINAL) @nested - struct CommonStructMember { - MemberId member_id; - StructMemberFlag member_flags; - TypeIdentifier member_type_id; - }; - - // COMPLETE Details for a member of an aggregate type - @extensibility(FINAL) @nested - struct CompleteMemberDetail { - MemberName name; - @optional AppliedBuiltinMemberAnnotations ann_builtin; - @optional AppliedAnnotationSeq ann_custom; - }; - - // MINIMAL Details for a member of an aggregate type - @extensibility(FINAL) @nested struct MinimalMemberDetail { - NameHash name_hash; - }; - - // Member of an aggregate type - @extensibility(APPENDABLE) @nested - struct CompleteStructMember { - CommonStructMember common; - CompleteMemberDetail detail; - }; - - // Ordered by the member_index - typedef sequence CompleteStructMemberSeq; - - // Member of an aggregate type - @extensibility(APPENDABLE) @nested - struct MinimalStructMember { - CommonStructMember common; - MinimalMemberDetail detail; - }; - - // Ordered by common.member_id - typedef sequence MinimalStructMemberSeq; - - @extensibility(APPENDABLE) @nested - struct AppliedBuiltinTypeAnnotations { - @optional AppliedVerbatimAnnotation verbatim; // @verbatim(...) - }; - - @extensibility(FINAL) @nested - struct MinimalTypeDetail { - // Empty. Available for future extension - }; - - @extensibility(FINAL) @nested - struct CompleteTypeDetail { - @optional AppliedBuiltinTypeAnnotations ann_builtin; - @optional AppliedAnnotationSeq ann_custom; - QualifiedTypeName type_name; - }; - - @extensibility(APPENDABLE) @nested - struct CompleteStructHeader { - TypeIdentifier base_type; - CompleteTypeDetail detail; - }; - - @extensibility(APPENDABLE) @nested - struct MinimalStructHeader { - TypeIdentifier base_type; - MinimalTypeDetail detail; - }; - - @extensibility(FINAL) @nested - struct CompleteStructType { - StructTypeFlag struct_flags; - CompleteStructHeader header; - CompleteStructMemberSeq member_seq; - }; - - @extensibility(FINAL) @nested - struct MinimalStructType { - StructTypeFlag struct_flags; - MinimalStructHeader header; - MinimalStructMemberSeq member_seq; - }; - - // --- Union: --------------------------------------------------------- - - // Case labels that apply to a member of a union type - // Ordered by their values - typedef sequence UnionCaseLabelSeq; - - @extensibility(FINAL) @nested - struct CommonUnionMember { - MemberId member_id; - UnionMemberFlag member_flags; - TypeIdentifier type_id; - UnionCaseLabelSeq label_seq; - }; - - // Member of a union type - @extensibility(APPENDABLE) @nested - struct CompleteUnionMember { - CommonUnionMember common; - CompleteMemberDetail detail; - }; - - // Ordered by member_index - typedef sequence CompleteUnionMemberSeq; - - // Member of a union type - @extensibility(APPENDABLE) @nested - struct MinimalUnionMember { - CommonUnionMember common; - MinimalMemberDetail detail; - }; - - // Ordered by MinimalUnionMember.common.member_id - typedef sequence MinimalUnionMemberSeq; - - @extensibility(FINAL) @nested - struct CommonDiscriminatorMember { - UnionDiscriminatorFlag member_flags; - TypeIdentifier type_id; - }; - - // Member of a union type - @extensibility(APPENDABLE) @nested - struct CompleteDiscriminatorMember { - CommonDiscriminatorMember common; - @optional AppliedBuiltinTypeAnnotations ann_builtin; - @optional AppliedAnnotationSeq ann_custom; - }; - - // Member of a union type - @extensibility(APPENDABLE) @nested - struct MinimalDiscriminatorMember { - CommonDiscriminatorMember common; - }; - - @extensibility(APPENDABLE) @nested - struct CompleteUnionHeader { - CompleteTypeDetail detail; - }; - - @extensibility(APPENDABLE) @nested - struct MinimalUnionHeader { - MinimalTypeDetail detail; - }; - - @extensibility(FINAL) @nested - struct CompleteUnionType { - UnionTypeFlag union_flags; - CompleteUnionHeader header; - CompleteDiscriminatorMember discriminator; - CompleteUnionMemberSeq member_seq; - }; - - @extensibility(FINAL) @nested - struct MinimalUnionType { - UnionTypeFlag union_flags; - MinimalUnionHeader header; - MinimalDiscriminatorMember discriminator; - MinimalUnionMemberSeq member_seq; - }; - - // --- Annotation: --------------------------------------------------- - @extensibility(FINAL) @nested - struct CommonAnnotationParameter { - AnnotationParameterFlag member_flags; - TypeIdentifier member_type_id; - }; - - // Member of an annotation type - @extensibility(APPENDABLE) @nested - struct CompleteAnnotationParameter { - CommonAnnotationParameter common; - MemberName name; - AnnotationParameterValue default_value; - }; - - // Ordered by CompleteAnnotationParameter.name - typedef sequence CompleteAnnotationParameterSeq; - - @extensibility(APPENDABLE) @nested - struct MinimalAnnotationParameter { - CommonAnnotationParameter common; - NameHash name_hash; - AnnotationParameterValue default_value; - }; - - // Ordered by MinimalAnnotationParameter.name_hash - typedef sequence MinimalAnnotationParameterSeq; - - @extensibility(APPENDABLE) @nested - struct CompleteAnnotationHeader { - QualifiedTypeName annotation_name; - }; - - @extensibility(APPENDABLE) @nested - struct MinimalAnnotationHeader { - // Empty. Available for future extension - }; - - @extensibility(FINAL) @nested - struct CompleteAnnotationType { - AnnotationTypeFlag annotation_flag; - CompleteAnnotationHeader header; - CompleteAnnotationParameterSeq member_seq; - }; - - @extensibility(FINAL) @nested - struct MinimalAnnotationType { - AnnotationTypeFlag annotation_flag; - MinimalAnnotationHeader header; - MinimalAnnotationParameterSeq member_seq; - }; - - // --- Alias: --------------------------------------------------------- - @extensibility(FINAL) @nested - struct CommonAliasBody { - AliasMemberFlag related_flags; - TypeIdentifier related_type; - }; - - @extensibility(APPENDABLE) @nested - struct CompleteAliasBody { - CommonAliasBody common; - @optional AppliedBuiltinMemberAnnotations ann_builtin; - @optional AppliedAnnotationSeq ann_custom; - }; - - @extensibility(APPENDABLE) @nested - struct MinimalAliasBody { - CommonAliasBody common; - }; - - @extensibility(APPENDABLE) @nested - struct CompleteAliasHeader { - CompleteTypeDetail detail; - }; - - @extensibility(APPENDABLE) @nested - struct MinimalAliasHeader { - // Empty. Available for future extension - }; - - @extensibility(FINAL) @nested - struct CompleteAliasType { - AliasTypeFlag alias_flags; - CompleteAliasHeader header; - CompleteAliasBody body; - }; - - @extensibility(FINAL) @nested - struct MinimalAliasType { - AliasTypeFlag alias_flags; - MinimalAliasHeader header; - MinimalAliasBody body; - }; - - // --- Collections: --------------------------------------------------- - @extensibility(FINAL) @nested - struct CompleteElementDetail { - @optional AppliedBuiltinMemberAnnotations ann_builtin; - @optional AppliedAnnotationSeq ann_custom; - }; - - @extensibility(FINAL) @nested - struct CommonCollectionElement { - CollectionElementFlag element_flags; - TypeIdentifier type; - }; - - @extensibility(APPENDABLE) @nested - struct CompleteCollectionElement { - CommonCollectionElement common; - CompleteElementDetail detail; - }; - - @extensibility(APPENDABLE) @nested - struct MinimalCollectionElement { - CommonCollectionElement common; - }; - - @extensibility(FINAL) @nested - struct CommonCollectionHeader { - LBound bound; - }; - - @extensibility(APPENDABLE) @nested - struct CompleteCollectionHeader { - CommonCollectionHeader common; - @optional CompleteTypeDetail detail; // not present for anonymous - }; - - @extensibility(APPENDABLE) @nested - struct MinimalCollectionHeader { - CommonCollectionHeader common; - }; - - // --- Sequence: ----------------------------------------------------- - @extensibility(FINAL) @nested - struct CompleteSequenceType { - CollectionTypeFlag collection_flag; - CompleteCollectionHeader header; - CompleteCollectionElement element; - }; - - - @extensibility(FINAL) @nested - struct MinimalSequenceType { - CollectionTypeFlag collection_flag; - MinimalCollectionHeader header; - MinimalCollectionElement element; - }; - - // --- Array: ----------------------------------------------------- - @extensibility(FINAL) @nested - struct CommonArrayHeader { - LBoundSeq bound_seq; - }; - - @extensibility(APPENDABLE) @nested - struct CompleteArrayHeader { - CommonArrayHeader common; - CompleteTypeDetail detail; - }; - - @extensibility(APPENDABLE) @nested - struct MinimalArrayHeader { - CommonArrayHeader common; - }; - - @extensibility(APPENDABLE) @nested - struct CompleteArrayType { - CollectionTypeFlag collection_flag; - CompleteArrayHeader header; - CompleteCollectionElement element; - }; - - @extensibility(FINAL) @nested - struct MinimalArrayType { - CollectionTypeFlag collection_flag; - MinimalArrayHeader header; - MinimalCollectionElement element; - }; - - // --- Map: ----------------------------------------------------- - @extensibility(FINAL) @nested - struct CompleteMapType { - CollectionTypeFlag collection_flag; - CompleteCollectionHeader header; - CompleteCollectionElement key; - CompleteCollectionElement element; - }; - - @extensibility(FINAL) @nested - struct MinimalMapType { - CollectionTypeFlag collection_flag; - MinimalCollectionHeader header; - MinimalCollectionElement key; - MinimalCollectionElement element; - }; - - // --- Enumeration: --------------------------------------------------- - typedef unsigned short BitBound; - - // Constant in an enumerated type - @extensibility(APPENDABLE) @nested - struct CommonEnumeratedLiteral { - long value; - EnumeratedLiteralFlag flags; - }; - - // Constant in an enumerated type - @extensibility(APPENDABLE) @nested - struct CompleteEnumeratedLiteral { - CommonEnumeratedLiteral common; - CompleteMemberDetail detail; - }; - - // Ordered by EnumeratedLiteral.common.value - typedef sequence CompleteEnumeratedLiteralSeq; - - // Constant in an enumerated type - @extensibility(APPENDABLE) @nested - struct MinimalEnumeratedLiteral { - CommonEnumeratedLiteral common; - MinimalMemberDetail detail; - }; - - // Ordered by EnumeratedLiteral.common.value - typedef sequence MinimalEnumeratedLiteralSeq; - - @extensibility(FINAL) @nested - struct CommonEnumeratedHeader { - BitBound bit_bound; - }; - - @extensibility(APPENDABLE) @nested - struct CompleteEnumeratedHeader { - CommonEnumeratedHeader common; - CompleteTypeDetail detail; - }; - - @extensibility(APPENDABLE) @nested - struct MinimalEnumeratedHeader { - CommonEnumeratedHeader common; - }; - - // Enumerated type - @extensibility(FINAL) @nested - struct CompleteEnumeratedType { - EnumTypeFlag enum_flags; // unused - CompleteEnumeratedHeader header; - CompleteEnumeratedLiteralSeq literal_seq; - }; - - // Enumerated type - @extensibility(FINAL) @nested - struct MinimalEnumeratedType { - EnumTypeFlag enum_flags; // unused - MinimalEnumeratedHeader header; - MinimalEnumeratedLiteralSeq literal_seq; - }; - - // --- Bitmask: ------------------------------------------------------- - // Bit in a bit mask - @extensibility(FINAL) @nested - struct CommonBitflag { - unsigned short position; - BitflagFlag flags; - }; - - @extensibility(APPENDABLE) @nested - struct CompleteBitflag { - CommonBitflag common; - CompleteMemberDetail detail; - }; - - // Ordered by Bitflag.position - typedef sequence CompleteBitflagSeq; - - @extensibility(APPENDABLE) @nested - struct MinimalBitflag { - CommonBitflag common; - MinimalMemberDetail detail; - }; - - // Ordered by Bitflag.position - typedef sequence MinimalBitflagSeq; - - @extensibility(FINAL) @nested - struct CommonBitmaskHeader { - BitBound bit_bound; - }; - - typedef CompleteEnumeratedHeader CompleteBitmaskHeader; - - typedef MinimalEnumeratedHeader MinimalBitmaskHeader; - - @extensibility(APPENDABLE) @nested - struct CompleteBitmaskType { - BitmaskTypeFlag bitmask_flags; // unused - CompleteBitmaskHeader header; - CompleteBitflagSeq flag_seq; - }; - - @extensibility(APPENDABLE) @nested - struct MinimalBitmaskType { - BitmaskTypeFlag bitmask_flags; // unused - MinimalBitmaskHeader header; - MinimalBitflagSeq flag_seq; - }; - - // --- Bitset: --------------------------------------------------------- - @extensibility(FINAL) @nested - struct CommonBitfield { - unsigned short position; - BitsetMemberFlag flags; - octet bitcount; - TypeKind holder_type; // Must be primitive integer type - }; - - @extensibility(APPENDABLE) @nested - struct CompleteBitfield { - CommonBitfield common; - CompleteMemberDetail detail; - }; - - // Ordered by Bitfield.position - typedef sequence CompleteBitfieldSeq; - - @extensibility(APPENDABLE) @nested - struct MinimalBitfield { - CommonBitfield common; - NameHash name_hash; - }; - - // Ordered by Bitfield.position - typedef sequence MinimalBitfieldSeq; - - @extensibility(APPENDABLE) @nested - struct CompleteBitsetHeader { - CompleteTypeDetail detail; - }; - - @extensibility(APPENDABLE) @nested - struct MinimalBitsetHeader { - // Empty. Available for future extension - }; - - @extensibility(APPENDABLE) @nested - struct CompleteBitsetType { - BitsetTypeFlag bitset_flags; // unused - CompleteBitsetHeader header; - CompleteBitfieldSeq field_seq; - }; - - @extensibility(APPENDABLE) @nested - struct MinimalBitsetType { - BitsetTypeFlag bitset_flags; // unused - MinimalBitsetHeader header; - MinimalBitfieldSeq field_seq; - }; - - // --- Type Object: -------------------------------------------------- - // The types associated with each case selection must have extensibility - // kind APPENDABLE or MUTABLE so that they can be extended in the future - - @extensibility(MUTABLE) @nested - struct CompleteExtendedType { - // Empty. Available for future extension - }; - - @extensibility(FINAL) @nested - union CompleteTypeObject switch (octet) { - case TK_ALIAS: - CompleteAliasType alias_type; - case TK_ANNOTATION: - CompleteAnnotationType annotation_type; - case TK_STRUCTURE: - CompleteStructType struct_type; - case TK_UNION: - CompleteUnionType union_type; - case TK_BITSET: - CompleteBitsetType bitset_type; - case TK_SEQUENCE: - CompleteSequenceType sequence_type; - case TK_ARRAY: - CompleteArrayType array_type; - case TK_MAP: - CompleteMapType map_type; - case TK_ENUM: - CompleteEnumeratedType enumerated_type; - case TK_BITMASK: - CompleteBitmaskType bitmask_type; - - // =================== Future extensibility ============ - default: - CompleteExtendedType extended_type; - }; - - @extensibility(MUTABLE) @nested - struct MinimalExtendedType { - // Empty. Available for future extension - }; - - - @extensibility(FINAL) @nested - union MinimalTypeObject switch (octet) { - case TK_ALIAS: - MinimalAliasType alias_type; - case TK_ANNOTATION: - MinimalAnnotationType annotation_type; - case TK_STRUCTURE: - MinimalStructType struct_type; - case TK_UNION: - MinimalUnionType union_type; - case TK_BITSET: - MinimalBitsetType bitset_type; - case TK_SEQUENCE: - MinimalSequenceType sequence_type; - case TK_ARRAY: - MinimalArrayType array_type; - case TK_MAP: - MinimalMapType map_type; - case TK_ENUM: - MinimalEnumeratedType enumerated_type; - case TK_BITMASK: - MinimalBitmaskType bitmask_type; - - // =================== Future extensibility ============ - default: - MinimalExtendedType extended_type; - }; - - @extensibility(APPENDABLE) @nested - union TypeObject switch (octet) { // EquivalenceKind - case EK_COMPLETE: - CompleteTypeObject complete; - case EK_MINIMAL: - MinimalTypeObject minimal; - }; - typedef sequence TypeObjectSeq; - - // Set of TypeObjects representing a strong component: Equivalence class - // for the Strong Connectivity relationship (mutual reachability between - // types). - // Ordered by fully qualified typename lexicographic order - typedef TypeObjectSeq StronglyConnectedComponent; - - @extensibility(FINAL) @nested - struct TypeIdentifierTypeObjectPair { - TypeIdentifier type_identifier; - TypeObject type_object; - }; - typedef - sequence TypeIdentifierTypeObjectPairSeq; - - @extensibility(FINAL) @nested - struct TypeIdentifierPair { - TypeIdentifier type_identifier1; - TypeIdentifier type_identifier2; - }; - typedef sequence TypeIdentifierPairSeq; - - @extensibility(APPENDABLE) @nested - struct TypeIdentifierWithSize { - DDS::Xtypes::TypeIdentifier type_id; - unsigned long typeobject_serialized_size; - }; - typedef sequence TypeIdentfierWithSizeSeq; - - @extensibility(APPENDABLE) @nested - struct TypeIdentifierWithDependencies { - TypeIdentifierWithSize typeid_with_size; - // The total additional types related to minimal_type - long dependent_typeid_count; - sequence dependent_typeids; - }; - typedef sequence TypeIdentifierWithDependenciesSeq; - - // This appears in the builtin DDS topics PublicationBuiltinTopicData - // and SubscriptionBuiltinTopicData - - @extensibility(MUTABLE) @nested - struct TypeInformation { - @id(0x1001) TypeIdentifierWithDependencies minimal; - @id(0x1002) TypeIdentifierWithDependencies complete; - }; - typedef sequence TypeInformationSeq; - - }; // end of module XTypes -}; // end module DDS diff --git a/resources/xsd/fastdds_profiles.xsd b/resources/xsd/fastdds_profiles.xsd index 92f1c451195..e9e5d7d6706 100644 --- a/resources/xsd/fastdds_profiles.xsd +++ b/resources/xsd/fastdds_profiles.xsd @@ -715,8 +715,7 @@ ├ writerHistoryMemoryPolicy [0~1], ├ readerPayloadSize [uint32], ├ writerPayloadSize [uint32], - ├ mutation_tries [uint32], - └ typelookup_config [0~1]--> + └ mutation_tries [uint32]--> @@ -731,7 +730,6 @@ - @@ -824,16 +822,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/unittest/logging/CMakeLists.txt b/test/unittest/logging/CMakeLists.txt index e6da51d3d41..1c3cbceba53 100644 --- a/test/unittest/logging/CMakeLists.txt +++ b/test/unittest/logging/CMakeLists.txt @@ -19,10 +19,6 @@ if(WIN32) endif() set(LOG_COMMON_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/utils/netmask_filter.cpp @@ -57,7 +53,11 @@ target_include_directories(LogTests PRIVATE ${Asio_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(LogTests fastcdr GTest::gtest ${MOCKS} +target_link_libraries(LogTests + fastcdr + fastdds::log + GTest::gtest + ${MOCKS} $<$:iphlpapi$Shlwapi> ) gtest_discover_tests(LogTests) @@ -67,8 +67,8 @@ set(LOGFILETESTS_TEST_SOURCE LogFileTests.cpp) set(LOGFILETESTS_SOURCE ${LOG_COMMON_SOURCE} - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/FileConsumer.cpp - ${LOGFILETESTS_TEST_SOURCE}) + ${LOGFILETESTS_TEST_SOURCE} + ) # External sources if(TINYXML2_SOURCE_DIR) @@ -97,5 +97,6 @@ target_link_libraries(LogFileTests GTest::gtest ${MOCKS} $<$:iphlpapi$Shlwapi> ${TINYXML2_LIBRARY} fastcdr + fastdds::log ) gtest_discover_tests(LogFileTests) diff --git a/test/unittest/logging/log_macros/CMakeLists.txt b/test/unittest/logging/log_macros/CMakeLists.txt index 2f7ae85b1f4..8e25c598db3 100644 --- a/test/unittest/logging/log_macros/CMakeLists.txt +++ b/test/unittest/logging/log_macros/CMakeLists.txt @@ -17,10 +17,6 @@ if(WIN32) endif() set(LOG_COMMON_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/utils/netmask_filter.cpp @@ -51,7 +47,11 @@ target_include_directories(LogMacrosAllActiveTests PRIVATE ${Asio_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(LogMacrosAllActiveTests fastcdr GTest::gtest ${MOCKS} +target_link_libraries(LogMacrosAllActiveTests + fastcdr + fastdds::log + GTest::gtest + ${MOCKS} $<$:iphlpapi$Shlwapi> ) gtest_discover_tests(LogMacrosAllActiveTests) @@ -75,7 +75,11 @@ target_include_directories(LogMacrosNoInfoTests PRIVATE ${Asio_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(LogMacrosNoInfoTests fastcdr GTest::gtest ${MOCKS} +target_link_libraries(LogMacrosNoInfoTests + fastcdr + fastdds::log + GTest::gtest + ${MOCKS} $<$:iphlpapi$Shlwapi> ) gtest_discover_tests(LogMacrosNoInfoTests) @@ -99,7 +103,11 @@ target_include_directories(LogMacrosNoWarningTests PRIVATE ${Asio_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(LogMacrosNoWarningTests fastcdr GTest::gtest ${MOCKS} +target_link_libraries(LogMacrosNoWarningTests + fastcdr + fastdds::log + GTest::gtest + ${MOCKS} $<$:iphlpapi$Shlwapi> ) gtest_discover_tests(LogMacrosNoWarningTests) @@ -123,7 +131,11 @@ target_include_directories(LogMacrosNoErrorTests PRIVATE ${Asio_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(LogMacrosNoErrorTests fastcdr GTest::gtest ${MOCKS} +target_link_libraries(LogMacrosNoErrorTests + fastcdr + fastdds::log + GTest::gtest + ${MOCKS} $<$:iphlpapi$Shlwapi> ) gtest_discover_tests(LogMacrosNoErrorTests) @@ -147,7 +159,11 @@ target_include_directories(LogMacrosDefaultTests PRIVATE ${Asio_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(LogMacrosDefaultTests fastcdr GTest::gtest ${MOCKS} +target_link_libraries(LogMacrosDefaultTests + fastcdr + fastdds::log + GTest::gtest + ${MOCKS} $<$:iphlpapi$Shlwapi> ) gtest_discover_tests(LogMacrosDefaultTests) @@ -173,7 +189,11 @@ target_include_directories(LogMacrosInternalDebugOffTests PRIVATE ${Asio_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(LogMacrosInternalDebugOffTests fastcdr GTest::gtest ${MOCKS} +target_link_libraries(LogMacrosInternalDebugOffTests + fastcdr + fastdds::log + GTest::gtest + ${MOCKS} $<$:iphlpapi$Shlwapi> ) gtest_discover_tests(LogMacrosInternalDebugOffTests) @@ -196,7 +216,11 @@ target_include_directories(OldLogMacrosTests PRIVATE ${Asio_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(OldLogMacrosTests fastcdr GTest::gtest ${MOCKS} +target_link_libraries(OldLogMacrosTests + fastcdr + fastdds::log + GTest::gtest + ${MOCKS} $<$:iphlpapi$Shlwapi> ) gtest_discover_tests(OldLogMacrosTests) @@ -220,7 +244,11 @@ target_include_directories(OldLogMacrosDisableTests PRIVATE ${Asio_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(OldLogMacrosDisableTests fastcdr GTest::gtest ${MOCKS} +target_link_libraries(OldLogMacrosDisableTests + fastcdr + fastdds::log + GTest::gtest + ${MOCKS} $<$:iphlpapi$Shlwapi> ) gtest_discover_tests(OldLogMacrosDisableTests) diff --git a/test/unittest/rtps/builtin/CMakeLists.txt b/test/unittest/rtps/builtin/CMakeLists.txt index 6080be5c018..79d207a3766 100644 --- a/test/unittest/rtps/builtin/CMakeLists.txt +++ b/test/unittest/rtps/builtin/CMakeLists.txt @@ -13,36 +13,12 @@ # limitations under the License. set(BUILTIN_DATA_SERIALIZATION_TESTS_SOURCE BuiltinDataSerializationTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/xtypes/exception/Exception.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/xtypes/type_representation/dds_xtypes_typeobjectPubSubTypes.cxx ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/data/ParticipantProxyData.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/data/ReaderProxyData.cpp @@ -88,13 +64,18 @@ target_compile_definitions(BuiltinDataSerializationTests PRIVATE $<$:__INTERNALDEBUG> # Internal debug activated. ) target_include_directories(BuiltinDataSerializationTests PRIVATE + ${PROJECT_SOURCE_DIR}/test/mock/dds/TypeObjectRegistry + ${PROJECT_SOURCE_DIR}/test/mock/dds/TypeObjectUtils ${PROJECT_SOURCE_DIR}/test/mock/rtps/NetworkFactory + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSDomainImpl ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ${Asio_INCLUDE_DIR} $<$:${ANDROID_IFADDRS_INCLUDE_DIR}> ) -target_link_libraries(BuiltinDataSerializationTests foonathan_memory +target_link_libraries(BuiltinDataSerializationTests + fastdds::log + foonathan_memory GTest::gmock ${CMAKE_DL_LIBS}) if(QNX) diff --git a/test/unittest/rtps/common/CMakeLists.txt b/test/unittest/rtps/common/CMakeLists.txt index 87b35987e0c..770533a4d34 100644 --- a/test/unittest/rtps/common/CMakeLists.txt +++ b/test/unittest/rtps/common/CMakeLists.txt @@ -15,10 +15,6 @@ set(CACHECHANGETESTS_SOURCE CacheChangeTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp) set(GUID_UTILS_TESTS_SOURCE GuidUtilsTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/GuidPrefix_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -47,10 +43,6 @@ endif() set(SEQUENCENUMBERTESTS_SOURCE SequenceNumberTests.cpp) set(PORTPARAMETERSTESTS_SOURCE PortParametersTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/utils/netmask_filter.cpp @@ -89,7 +81,11 @@ target_include_directories(GuidUtilsTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${Asio_INCLUDE_DIR} $<$:${ANDROID_IFADDRS_INCLUDE_DIR}>) -target_link_libraries(GuidUtilsTests fastcdr GTest::gtest) +target_link_libraries(GuidUtilsTests + fastcdr + fastdds::log + GTest::gtest + ) if(QNX) target_link_libraries(GuidUtilsTests socket) endif() @@ -119,7 +115,11 @@ target_include_directories(PortParametersTests PRIVATE ${Asio_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(PortParametersTests fastcdr GTest::gtest) +target_link_libraries(PortParametersTests + fastcdr + fastdds::log + GTest::gtest + ) gtest_discover_tests(PortParametersTests PROPERTIES LABELS "NoMemoryCheck") ################### diff --git a/test/unittest/rtps/discovery/CMakeLists.txt b/test/unittest/rtps/discovery/CMakeLists.txt index 008079adcf4..c3bbc5c71e2 100644 --- a/test/unittest/rtps/discovery/CMakeLists.txt +++ b/test/unittest/rtps/discovery/CMakeLists.txt @@ -14,32 +14,6 @@ #EDP TESTS set(EDPTESTS_SOURCE EdpTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp @@ -89,11 +63,15 @@ target_include_directories(EdpTests PRIVATE ${PROJECT_SOURCE_DIR}/test/mock/rtps/TimedEvent ${PROJECT_SOURCE_DIR}/test/mock/rtps/ResourceEvent ${PROJECT_SOURCE_DIR}/test/mock/rtps/SecurityManager + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSDomainImpl ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ${Asio_INCLUDE_DIR} ) -target_link_libraries(EdpTests foonathan_memory +target_link_libraries(EdpTests + fastdds::log + fastdds::xtypes::type-representation + foonathan_memory GTest::gmock ${CMAKE_DL_LIBS}) if(QNX) @@ -131,36 +109,11 @@ if(TLS_FOUND) endif() set(PDPTESTS_SOURCE PDPTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/xtypes/type_representation/dds_xtypes_typeobjectPubSubTypes.cxx ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/data/ParticipantProxyData.cpp @@ -220,7 +173,9 @@ target_include_directories(PDPTests PRIVATE ${Asio_INCLUDE_DIR} ) -target_link_libraries(PDPTests foonathan_memory +target_link_libraries(PDPTests + fastdds::log + foonathan_memory GTest::gmock ${CMAKE_DL_LIBS} $<$:OpenSSL::SSL$OpenSSL::Crypto>) diff --git a/test/unittest/rtps/discovery/PDPTests.cpp b/test/unittest/rtps/discovery/PDPTests.cpp index 0a386b796b2..cae1a91143d 100644 --- a/test/unittest/rtps/discovery/PDPTests.cpp +++ b/test/unittest/rtps/discovery/PDPTests.cpp @@ -22,7 +22,6 @@ #include #include -#include #include #include #include @@ -48,17 +47,6 @@ #endif // if defined(_WIN32) namespace eprosima { - -namespace fastdds { -namespace dds { -namespace builtin { - -const fastrtps::rtps::SampleIdentity INVALID_SAMPLE_IDENTITY; - -} // namespace builtin -} // namespace dds -} // namespace fastdds - namespace fastrtps { namespace rtps { diff --git a/test/unittest/rtps/domain/RTPSDomainTests.cpp b/test/unittest/rtps/domain/RTPSDomainTests.cpp index 806617f5275..ed89b579c8f 100644 --- a/test/unittest/rtps/domain/RTPSDomainTests.cpp +++ b/test/unittest/rtps/domain/RTPSDomainTests.cpp @@ -85,7 +85,7 @@ TEST(RTPSDomainTests, get_topic_attributes_from_profile_test) )"; EXPECT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->load_XML_profiles_string(xml.c_str(), - xml.length()), ReturnCode_t::RETCODE_OK); + xml.length()), eprosima::fastdds::dds::RETCODE_OK); EXPECT_TRUE(eprosima::fastrtps::rtps::RTPSDomain::get_topic_attributes_from_profile(profile_name, topic_att)); EXPECT_EQ(topic_att.topicName, "Test"); EXPECT_EQ(topic_att.topicDataType, "DataTest"); diff --git a/test/unittest/rtps/flowcontrol/CMakeLists.txt b/test/unittest/rtps/flowcontrol/CMakeLists.txt index b5c706ae2d1..e4c7e412dc9 100644 --- a/test/unittest/rtps/flowcontrol/CMakeLists.txt +++ b/test/unittest/rtps/flowcontrol/CMakeLists.txt @@ -17,9 +17,6 @@ if(WIN32) endif() set(FLOWCONTROLLER_COMMON_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -58,6 +55,7 @@ target_include_directories(FlowControllerFactoryTests PRIVATE ) target_link_libraries(FlowControllerFactoryTests fastcdr + fastdds::log GTest::gmock ) if(MSVC OR MSVC_IDE) @@ -92,6 +90,7 @@ target_include_directories(FlowControllerPublishModesTests PRIVATE ) target_link_libraries(FlowControllerPublishModesTests fastcdr + fastdds::log GTest::gmock ) if(MSVC OR MSVC_IDE) @@ -122,6 +121,7 @@ target_include_directories(FlowControllerSchedulersTests PRIVATE ) target_link_libraries(FlowControllerSchedulersTests fastcdr + fastdds::log GTest::gmock ) if(MSVC OR MSVC_IDE) diff --git a/test/unittest/rtps/history/CMakeLists.txt b/test/unittest/rtps/history/CMakeLists.txt index 6113b4d4d0e..31fa6a7ca92 100644 --- a/test/unittest/rtps/history/CMakeLists.txt +++ b/test/unittest/rtps/history/CMakeLists.txt @@ -13,10 +13,6 @@ # limitations under the License. set(READERHISTORYTESTS_SOURCE ReaderHistoryTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/CacheChangePool.cpp @@ -32,10 +28,6 @@ set(READERHISTORYTESTS_SOURCE ReaderHistoryTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp) set(BASICPOOLSTESTS_SOURCE BasicPoolsTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/CacheChangePool.cpp @@ -49,10 +41,6 @@ set(BASICPOOLSTESTS_SOURCE BasicPoolsTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp) set(CACHECHANGEPOOLTESTS_SOURCE CacheChangePoolTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/CacheChangePool.cpp @@ -67,10 +55,6 @@ set(CACHECHANGEPOOLTESTS_SOURCE CacheChangePoolTests.cpp set(TOPICPAYLOADPOOLTESTS_SOURCE TopicPayloadPoolTests.cpp TopicPayloadPoolRegistryTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/TopicPayloadPool.cpp @@ -113,6 +97,7 @@ target_include_directories(ReaderHistoryTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) target_link_libraries(ReaderHistoryTests fastcdr + fastdds::log GTest::gmock ${CMAKE_DL_LIBS}) gtest_discover_tests(ReaderHistoryTests) @@ -130,6 +115,7 @@ target_include_directories(BasicPoolsTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) target_link_libraries(BasicPoolsTests fastcdr + fastdds::log GTest::gtest ${CMAKE_DL_LIBS}) gtest_discover_tests(BasicPoolsTests) @@ -147,6 +133,7 @@ target_include_directories(CacheChangePoolTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) target_link_libraries(CacheChangePoolTests fastcdr + fastdds::log GTest::gtest ${CMAKE_DL_LIBS}) gtest_discover_tests(CacheChangePoolTests) @@ -165,6 +152,7 @@ target_include_directories(TopicPayloadPoolTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) target_link_libraries(TopicPayloadPoolTests fastcdr + fastdds::log GTest::gtest ${CMAKE_DL_LIBS}) gtest_discover_tests(TopicPayloadPoolTests) diff --git a/test/unittest/rtps/network/CMakeLists.txt b/test/unittest/rtps/network/CMakeLists.txt index 4f00d2753ac..8095ff14daf 100644 --- a/test/unittest/rtps/network/CMakeLists.txt +++ b/test/unittest/rtps/network/CMakeLists.txt @@ -16,10 +16,6 @@ set(NETWORKFACTORYTESTS_SOURCE NetworkFactoryTests.cpp mock/MockTransport.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/GuidPrefix_t.cpp @@ -94,7 +90,10 @@ target_include_directories(NetworkFactoryTests PRIVATE ${PROJECT_SOURCE_DIR}/src/cpp $<$:${ANDROID_IFADDRS_INCLUDE_DIR}> ) -target_link_libraries(NetworkFactoryTests fastcdr foonathan_memory +target_link_libraries(NetworkFactoryTests + fastcdr + fastdds::log + foonathan_memory GTest::gtest ${MOCKS} $<$:OpenSSL::SSL$OpenSSL::Crypto> ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}) @@ -104,34 +103,10 @@ if(QNX) endif() add_executable(ExternalLocatorsTests ExternalLocatorsTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/xtypes/exception/Exception.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -157,13 +132,19 @@ target_compile_definitions(ExternalLocatorsTests PRIVATE ) target_include_directories(ExternalLocatorsTests PRIVATE ${Asio_INCLUDE_DIR} + ${PROJECT_SOURCE_DIR}/test/mock/dds/TypeObjectRegistry + ${PROJECT_SOURCE_DIR}/test/mock/dds/TypeObjectUtils ${PROJECT_SOURCE_DIR}/test/mock/rtps/ParticipantProxyData ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReaderProxyData + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSDomainImpl # Dependency of fastdds::xtypes::type_representation ${PROJECT_SOURCE_DIR}/test/mock/rtps/WriterProxyData ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(ExternalLocatorsTests fastcdr +target_link_libraries(ExternalLocatorsTests + fastcdr + fastdds::log + fastdds::xtypes::dynamic-types::impl GTest::gtest ${MOCKS} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}) diff --git a/test/unittest/rtps/network/NetworkFactoryTests.cpp b/test/unittest/rtps/network/NetworkFactoryTests.cpp index 557c237e1e1..241c2dc79a8 100644 --- a/test/unittest/rtps/network/NetworkFactoryTests.cpp +++ b/test/unittest/rtps/network/NetworkFactoryTests.cpp @@ -27,9 +27,9 @@ #include #include -using namespace std; using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; +using namespace eprosima::fastdds::rtps; class NetworkTests : public ::testing::Test { diff --git a/test/unittest/rtps/network/mock/MockTransport.cpp b/test/unittest/rtps/network/mock/MockTransport.cpp index f7a0d6bed62..506b7137256 100644 --- a/test/unittest/rtps/network/mock/MockTransport.cpp +++ b/test/unittest/rtps/network/mock/MockTransport.cpp @@ -12,14 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include #include -#include +#include -using namespace std; +#include namespace eprosima { -namespace fastrtps { +namespace fastdds { namespace rtps { std::vector MockTransport::mockTransportInstances; @@ -49,7 +48,7 @@ MockTransport::~MockTransport() } bool MockTransport::init( - const PropertyPolicy* /*properties*/, + const fastrtps::rtps::PropertyPolicy* /*properties*/, const uint32_t& /*max_msg_size_no_frag*/) { return true; @@ -116,7 +115,6 @@ Locator_t MockTransport::RemoteToMainLocal( const Locator_t& remote) const { Locator_t mainLocal(remote); - //memset(mainLocal.address, 0x00, sizeof(mainLocal.address)); mainLocal.set_Invalid_Address(); return mainLocal; } @@ -140,12 +138,12 @@ LocatorList_t MockTransport::NormalizeLocator( } void MockTransport::select_locators( - LocatorSelector& selector) const + fastrtps::rtps::LocatorSelector& selector) const { - ResourceLimitedVector& entries = selector.transport_starts(); + fastrtps::ResourceLimitedVector& entries = selector.transport_starts(); for (size_t i = 0; i < entries.size(); ++i) { - LocatorSelectorEntry* entry = entries[i]; + fastrtps::rtps::LocatorSelectorEntry* entry = entries[i]; if (entry->transport_should_process) { for (size_t j = 0; j < entry->unicast.size(); ++j) diff --git a/test/unittest/rtps/network/mock/MockTransport.h b/test/unittest/rtps/network/mock/MockTransport.h index 1d363e55d6c..358d45224f0 100644 --- a/test/unittest/rtps/network/mock/MockTransport.h +++ b/test/unittest/rtps/network/mock/MockTransport.h @@ -24,9 +24,13 @@ #include namespace eprosima { -namespace fastrtps { +namespace fastdds { namespace rtps { +using Locator_t = eprosima::fastrtps::rtps::Locator_t; +using LocatorList_t = eprosima::fastrtps::rtps::LocatorList_t; +using SenderResource = eprosima::fastrtps::rtps::SenderResource; + class MockTransportDescriptor; class MockSenderResource : public SenderResource @@ -62,7 +66,7 @@ class MockTransport : public fastdds::rtps::TransportInterface ~MockTransport(); bool init( - const PropertyPolicy* properties = nullptr, + const fastrtps::rtps::PropertyPolicy* properties = nullptr, const uint32_t& max_msg_size_no_frag = 0) override; //API implementation @@ -108,7 +112,7 @@ class MockTransport : public fastdds::rtps::TransportInterface * @param [in, out] selector Locator selector. */ void select_locators( - LocatorSelector& selector) const override; + fastrtps::rtps::LocatorSelector& selector) const override; bool is_local_locator( const Locator_t&) const override @@ -168,7 +172,7 @@ class MockTransport : public fastdds::rtps::TransportInterface bool configureInitialPeerLocator( Locator_t&, - const PortParameters&, + const fastrtps::rtps::PortParameters&, uint32_t, LocatorList_t& ) const override { @@ -208,7 +212,7 @@ class MockTransport : public fastdds::rtps::TransportInterface { Locator_t destination; Locator_t origin; - std::vector data; + std::vector data; } MockMessage; std::vector mockMessagesToReceive; @@ -246,7 +250,7 @@ class MockTransportDescriptor : public fastdds::rtps::SocketTransportDescriptor }; } // namespace rtps -} // namespace fastrtps +} // namespace fastdds } // namespace eprosima #endif // ifndef MOCK_TRANSPORT_H diff --git a/test/unittest/rtps/persistence/CMakeLists.txt b/test/unittest/rtps/persistence/CMakeLists.txt index a830e6c160f..eeadf5ffe1f 100644 --- a/test/unittest/rtps/persistence/CMakeLists.txt +++ b/test/unittest/rtps/persistence/CMakeLists.txt @@ -18,10 +18,6 @@ if(SQLITE3_SUPPORT) set(PERSISTENCETESTS_SOURCE PersistenceTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -54,8 +50,9 @@ if(SQLITE3_SUPPORT) ) target_link_libraries(PersistenceTests fastcdr + fastdds::log foonathan_memory - GTest::gmock + GTest::gmock ${CMAKE_DL_LIBS} ) if(MSVC OR MSVC_IDE) diff --git a/test/unittest/rtps/reader/CMakeLists.txt b/test/unittest/rtps/reader/CMakeLists.txt index 92ca8e696e8..503782b447a 100644 --- a/test/unittest/rtps/reader/CMakeLists.txt +++ b/test/unittest/rtps/reader/CMakeLists.txt @@ -17,10 +17,6 @@ # WriterProxyTests ########################################################################### set(WRITERPROXYTESTS_SOURCE WriterProxyTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -62,7 +58,10 @@ target_include_directories(WriterProxyTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(WriterProxyTests fastcdr foonathan_memory +target_link_libraries(WriterProxyTests + fastcdr + fastdds::log + foonathan_memory GTest::gmock ${CMAKE_DL_LIBS}) gtest_discover_tests(WriterProxyTests) @@ -71,10 +70,6 @@ gtest_discover_tests(WriterProxyTests) # WriterProxyStopTest ########################################################################### set(WRITERPROXYSTOPTEST_SOURCE WriterProxyStopTest.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -118,7 +113,10 @@ target_include_directories(WriterProxyStopTest PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(WriterProxyStopTest fastcdr foonathan_memory +target_link_libraries(WriterProxyStopTest + fastcdr + fastdds::log + foonathan_memory GTest::gmock ${CMAKE_DL_LIBS}) gtest_discover_tests(WriterProxyStopTest) @@ -127,10 +125,6 @@ gtest_discover_tests(WriterProxyStopTest) # WriterProxyAcknackTests ########################################################################### set(WRITERPROXYACKNACKTESTS_SOURCE WriterProxyAcknackTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -173,7 +167,10 @@ target_include_directories(WriterProxyAcknackTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(WriterProxyAcknackTests fastcdr foonathan_memory +target_link_libraries(WriterProxyAcknackTests + fastcdr + fastdds::log + foonathan_memory GTest::gmock ${CMAKE_DL_LIBS}) gtest_discover_tests(WriterProxyAcknackTests) diff --git a/test/unittest/rtps/resources/timedevent/CMakeLists.txt b/test/unittest/rtps/resources/timedevent/CMakeLists.txt index d67929d1885..b25201384ff 100644 --- a/test/unittest/rtps/resources/timedevent/CMakeLists.txt +++ b/test/unittest/rtps/resources/timedevent/CMakeLists.txt @@ -14,10 +14,6 @@ set(TIMEDEVENTTESTS_SOURCE mock/MockEvent.cpp TimedEventTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/utils/netmask_filter.cpp @@ -58,5 +54,10 @@ target_include_directories(TimedEventTests PRIVATE ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(TimedEventTests fastcdr GTest::gtest ${CMAKE_DL_LIBS}) +target_link_libraries(TimedEventTests + fastcdr + fastdds::log + GTest::gtest + ${CMAKE_DL_LIBS} + ) gtest_discover_tests(TimedEventTests) diff --git a/test/unittest/rtps/security/CMakeLists.txt b/test/unittest/rtps/security/CMakeLists.txt index d0e70b5ce98..c927133ca28 100644 --- a/test/unittest/rtps/security/CMakeLists.txt +++ b/test/unittest/rtps/security/CMakeLists.txt @@ -17,10 +17,6 @@ if(WIN32) endif() set(SOURCES_SECURITY_TEST_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp @@ -96,7 +92,9 @@ target_include_directories(SecurityAuthentication PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(SecurityAuthentication fastcdr +target_link_libraries(SecurityAuthentication + fastcdr + fastdds::log GTest::gmock ${OPENSSL_LIBRARIES} ) diff --git a/test/unittest/rtps/writer/CMakeLists.txt b/test/unittest/rtps/writer/CMakeLists.txt index 1f9fe52f487..8011e7f35b0 100644 --- a/test/unittest/rtps/writer/CMakeLists.txt +++ b/test/unittest/rtps/writer/CMakeLists.txt @@ -14,10 +14,6 @@ # ReaderProxy set(WRITERPROXYTESTS_SOURCE ReaderProxyTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -65,6 +61,7 @@ target_include_directories(ReaderProxyTests PRIVATE ) target_link_libraries(ReaderProxyTests fastcdr + fastdds::log foonathan_memory GTest::gmock ${CMAKE_DL_LIBS} @@ -72,10 +69,6 @@ target_link_libraries(ReaderProxyTests gtest_discover_tests(ReaderProxyTests) set(LIVELINESSMANAGERTESTS_SOURCE LivelinessManagerTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/utils/netmask_filter.cpp @@ -107,7 +100,9 @@ target_include_directories(LivelinessManagerTests PRIVATE ) target_link_libraries(LivelinessManagerTests PRIVATE fastcdr - GTest::gmock) + fastdds::log + GTest::gmock + ) gtest_discover_tests(LivelinessManagerTests) if(NOT QNX) diff --git a/test/unittest/security/accesscontrol/CMakeLists.txt b/test/unittest/security/accesscontrol/CMakeLists.txt index aca75a8eda6..fe0a56d91d6 100644 --- a/test/unittest/security/accesscontrol/CMakeLists.txt +++ b/test/unittest/security/accesscontrol/CMakeLists.txt @@ -16,15 +16,12 @@ if(WIN32) add_definitions( -D_WIN32_WINNT=0x0601 -D_CRT_SECURE_NO_WARNINGS + -DNOMINMAX ) endif() set(COMMON_SOURCES_ACCESS_CONTROL_TEST_SOURCE ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -101,6 +98,7 @@ target_link_libraries(AccessControlTests GTest::gmock ${OPENSSL_LIBRARIES} fastcdr + fastdds::log foonathan_memory $<$:ws2_32> ${TINYXML2_LIBRARY} @@ -128,12 +126,6 @@ set( add_executable( ${DISTINGUISHEDNAME_TEST_NAME} - # Log related files - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - # src files ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -145,6 +137,7 @@ add_executable( ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/DistinguishedName.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp + # Log related files ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp # test files @@ -169,9 +162,9 @@ target_include_directories( ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries( - ${DISTINGUISHEDNAME_TEST_NAME} +target_link_libraries(${DISTINGUISHEDNAME_TEST_NAME} fastcdr + fastdds::log GTest::gtest ) diff --git a/test/unittest/security/authentication/CMakeLists.txt b/test/unittest/security/authentication/CMakeLists.txt index b03767f0723..e896ba3d77b 100644 --- a/test/unittest/security/authentication/CMakeLists.txt +++ b/test/unittest/security/authentication/CMakeLists.txt @@ -16,15 +16,12 @@ if(WIN32) add_definitions( -D_WIN32_WINNT=0x0601 -D_CRT_SECURE_NO_WARNINGS + -DNOMINMAX ) endif() set(COMMON_SOURCES_AUTH_PLUGIN_TEST_SOURCE ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/data/ParticipantProxyData.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/GuidPrefix_t.cpp @@ -75,6 +72,7 @@ target_link_libraries(BuiltinPKIDH GTest::gtest ${OPENSSL_LIBRARIES} fastcdr + fastdds::log foonathan_memory $<$:ws2_32> $<$:eProsima_p11> # $ diff --git a/test/unittest/security/cryptography/CMakeLists.txt b/test/unittest/security/cryptography/CMakeLists.txt index f353b295f69..4e5bc2508e2 100644 --- a/test/unittest/security/cryptography/CMakeLists.txt +++ b/test/unittest/security/cryptography/CMakeLists.txt @@ -17,10 +17,6 @@ if(WIN32) endif() set(COMMON_SOURCES_CRYPTO_PLUGIN_TEST_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -63,7 +59,12 @@ target_include_directories(BuiltinAESGCMGMAC PRIVATE ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(BuiltinAESGCMGMAC fastcdr GTest::gmock ${OPENSSL_LIBRARIES}) +target_link_libraries(BuiltinAESGCMGMAC + fastcdr + fastdds::log + GTest::gmock + ${OPENSSL_LIBRARIES} + ) gtest_discover_tests(BuiltinAESGCMGMAC SOURCES ${COMMON_SOURCES_CRYPTO_PLUGIN_TEST_SOURCE} PROPERTIES ENVIRONMENT "CERTS_PATH=${PROJECT_SOURCE_DIR}/test/certs") diff --git a/test/unittest/security/logging/CMakeLists.txt b/test/unittest/security/logging/CMakeLists.txt index fa218fa762b..5e6d9b02922 100644 --- a/test/unittest/security/logging/CMakeLists.txt +++ b/test/unittest/security/logging/CMakeLists.txt @@ -17,10 +17,6 @@ if(WIN32) endif() set(COMMON_SOURCES_LOGGING_PLUGIN_TEST_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -53,5 +49,10 @@ target_include_directories(BuiltinLogging PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) -target_link_libraries(BuiltinLogging fastcdr GTest::gtest ${OPENSSL_LIBRARIES}) +target_link_libraries(BuiltinLogging + fastcdr + fastdds::log + GTest::gtest + ${OPENSSL_LIBRARIES} + ) gtest_discover_tests(BuiltinLogging) diff --git a/test/unittest/statistics/dds/CMakeLists.txt b/test/unittest/statistics/dds/CMakeLists.txt index 65ba16222a2..3f73993aa35 100644 --- a/test/unittest/statistics/dds/CMakeLists.txt +++ b/test/unittest/statistics/dds/CMakeLists.txt @@ -25,12 +25,11 @@ endif(TINYXML2_INCLUDE_DIR) ## StatisticsDomainParticipantTests set(STATISTICS_DOMAINPARTICIPANT_TESTS_SOURCE StatisticsDomainParticipantTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesv1.cxx ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_types.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesv1.cxx) + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesTypeObjectSupport.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesTypeObjectSupport.cxx + ) add_executable(StatisticsDomainParticipantTests ${STATISTICS_DOMAINPARTICIPANT_TESTS_SOURCE}) target_compile_definitions(StatisticsDomainParticipantTests PRIVATE @@ -39,7 +38,11 @@ target_compile_definitions(StatisticsDomainParticipantTests PRIVATE ) target_include_directories(StatisticsDomainParticipantTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(StatisticsDomainParticipantTests fastdds fastcdr GTest::gtest) +target_link_libraries(StatisticsDomainParticipantTests + fastcdr + fastdds + GTest::gtest + ) gtest_discover_tests(StatisticsDomainParticipantTests) ## StatisticsQosTests @@ -63,7 +66,12 @@ target_compile_definitions(StatisticsQosTests PRIVATE BOOST_ASIO_STANDALONE ASIO ) target_include_directories(StatisticsQosTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ${THIRDPARTY_BOOST_INCLUDE_DIR}) -target_link_libraries(StatisticsQosTests fastdds fastcdr ${TINYXML2_LIBRARY} foonathan_memory GTest::gtest) +target_link_libraries(StatisticsQosTests + fastcdr + fastdds + foonathan_memory + ${TINYXML2_LIBRARY} + GTest::gtest) gtest_discover_tests(StatisticsQosTests) ## StatisticsDomainParticipantListenerTests @@ -72,16 +80,20 @@ if (FASTDDS_STATISTICS) DomainParticipantStatisticsListenerTests.cpp) add_executable(DomainParticipantStatisticsListenerTests + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipantStatisticsListener.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesv1.cxx ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_types.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesv1.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesTypeObjectSupport.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesTypeObjectSupport.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/utils/network.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp ${TINYXML2_SOURCES} ${DOMAINPARTICIPANTSTATISTICSLISTENER_TESTS_SOURCE}) target_compile_definitions(DomainParticipantStatisticsListenerTests PRIVATE @@ -90,11 +102,18 @@ if (FASTDDS_STATISTICS) ) target_include_directories(DomainParticipantStatisticsListenerTests PRIVATE DomainParticipantStatisticsListenerTests/mock + ${PROJECT_SOURCE_DIR}/test/mock/dds/DomainParticipantFactory/ + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSDomainImpl/ ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) target_link_libraries(DomainParticipantStatisticsListenerTests - ${TINYXML2_LIBRARY} fastcdr GTest::gmock ) + ${TINYXML2_LIBRARY} + fastcdr + fastdds::log + fastdds::xtypes::type-representation + GTest::gmock + ) gtest_discover_tests(DomainParticipantStatisticsListenerTests) endif() @@ -103,33 +122,13 @@ if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS AND NOT QNX) # this test includes C sources enable_language(C) - set(STATISTICS_DOMAINPARTICIPANT_MOCK_TESTS_SOURCE + file(GLOB STATISTICS_DOMAINPARTICIPANT_MOCK_TESTS_SOURCE StatisticsDomainParticipantMockTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/typelookup/common/TypeLookupTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/typelookup/TypeLookupManager.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/typelookup/TypeLookupReplyListener.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/typelookup/TypeLookupRequestListener.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/type_lookup_service/detail/rpc_typesPubSubTypes.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/type_lookup_service/detail/TypeLookupTypesPubSubTypes.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupReplyListener.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupRequestListener.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/Condition.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/ConditionNotifier.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/StatusCondition.cpp @@ -283,12 +282,10 @@ if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS AND NOT QNX) ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/reader/StatisticsReaderImpl.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/StatisticsBase.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/writer/StatisticsWriterImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_types.cxx ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesv1.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesTypeObjectSupport.cxx ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesv1.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesTypeObjectSupport.cxx ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp @@ -307,31 +304,12 @@ if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS AND NOT QNX) set(STATISTICS_DOMAINPARTICIPANT_STATUS_QUERYABLE_TESTS_SOURCE StatisticsDomainParticipantStatusQueryableTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/typelookup/common/TypeLookupTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/typelookup/TypeLookupManager.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/typelookup/TypeLookupReplyListener.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/typelookup/TypeLookupRequestListener.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/type_lookup_service/detail/rpc_typesPubSubTypes.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/type_lookup_service/detail/TypeLookupTypesPubSubTypes.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupReplyListener.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupRequestListener.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/Entity.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/Condition.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/ConditionNotifier.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/StatusCondition.cpp @@ -344,11 +322,6 @@ if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS AND NOT QNX) ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/DomainParticipantFactory.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/qos/DomainParticipantFactoryQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/qos/DomainParticipantQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/FileConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/DataWriter.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/DataWriterHistory.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/PublisherImpl.cpp @@ -482,12 +455,10 @@ if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS AND NOT QNX) ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/reader/StatisticsReaderImpl.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/StatisticsBase.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/writer/StatisticsWriterImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_types.cxx ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesv1.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesTypeObjectSupport.cxx ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesv1.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesTypeObjectSupport.cxx ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp @@ -528,79 +499,43 @@ if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS AND NOT QNX) # Security Support if(SECURITY) - list(APPEND STATISTICS_DOMAINPARTICIPANT_MOCK_TESTS_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/exceptions/Exception.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Token.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/exceptions/SecurityException.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/common/SharedSecretHandle.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/logging/Logging.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/SecurityManager.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/SecurityPluginFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/participant/DS/PDPSecurityInitiatorListener.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/artifact_providers/FileProvider.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/artifact_providers/Pkcs11Provider.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIDH.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/Permissions.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/DistinguishedName.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_KeyExchange.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_KeyFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_Transform.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_Types.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIIdentityHandle.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIHandshakeHandle.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/AccessPermissionsHandle.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/CommonParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/GovernanceParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/PermissionsParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/logging/LogTopic.cpp - ) - list(APPEND STATISTICS_DOMAINPARTICIPANT_STATUS_QUERYABLE_TESTS_SOURCE + file(GLOB security_sources ${PROJECT_SOURCE_DIR}/src/cpp/rtps/exceptions/Exception.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Token.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/exceptions/SecurityException.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/common/SharedSecretHandle.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/logging/Logging.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/SecurityManager.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/SecurityPluginFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/*.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/participant/DS/PDPSecurityInitiatorListener.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/artifact_providers/FileProvider.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/artifact_providers/Pkcs11Provider.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIDH.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/Permissions.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/DistinguishedName.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_KeyExchange.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_KeyFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_Transform.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_Types.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIIdentityHandle.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIHandshakeHandle.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/AccessPermissionsHandle.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/CommonParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/GovernanceParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/PermissionsParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/logging/LogTopic.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/*.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/artifact_providers/*.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/*.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/*.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/logging/*.cpp ) + list(APPEND STATISTICS_DOMAINPARTICIPANT_MOCK_TESTS_SOURCE ${security_sources}) + list(APPEND STATISTICS_DOMAINPARTICIPANT_STATUS_QUERYABLE_TESTS_SOURCE ${security_sources}) endif() # External sources if(TINYXML2_SOURCE_DIR) list(APPEND STATISTICS_DOMAINPARTICIPANT_MOCK_TESTS_SOURCE - ${TINYXML2_SOURCE_DIR}/tinyxml2.cpp + ${TINYXML2_SOURCES} ) list(APPEND STATISTICS_DOMAINPARTICIPANT_STATUS_QUERYABLE_TESTS_SOURCE ${TINYXML2_SOURCE_DIR}/tinyxml2.cpp ) endif() - add_executable(StatisticsDomainParticipantMockTests ${STATISTICS_DOMAINPARTICIPANT_MOCK_TESTS_SOURCE}) + add_executable(StatisticsDomainParticipantMockTests + ${STATISTICS_DOMAINPARTICIPANT_MOCK_TESTS_SOURCE} + ) target_compile_definitions(StatisticsDomainParticipantMockTests PRIVATE BOOST_ASIO_STANDALONE ASIO_STANDALONE SQLITE_WIN32_GETVERSIONEX=0 $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. + $<$:__INTERNAL_DEBUG> # Internal debug activated. $<$,$>:_WIN32_WINNT=0x0603> $<$,$>>:_WIN32_WINNT=0x0601> $<$,$>:SQLITE_OS_WINRT> @@ -612,7 +547,7 @@ if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS AND NOT QNX) ) target_include_directories(StatisticsDomainParticipantMockTests PRIVATE $<$:${OPENSSL_INCLUDE_DIR}> - StatisticsDomainParticipantMockTests/mock/ + StatisticsDomainParticipantMockTests/mock ${PROJECT_SOURCE_DIR}/test/mock/dds/Publisher/ ${PROJECT_SOURCE_DIR}/test/mock/dds/DomainParticipantImpl/ ${PROJECT_SOURCE_DIR}/include @@ -622,6 +557,9 @@ if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS AND NOT QNX) ${THIRDPARTY_BOOST_INCLUDE_DIR}) target_link_libraries(StatisticsDomainParticipantMockTests ${PRIVACY} fastcdr + fastdds::log + fastdds::xtypes::dynamic-types::impl + fastdds::xtypes::type-representation foonathan_memory GTest::gmock ${CMAKE_DL_LIBS} @@ -668,7 +606,11 @@ if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS AND NOT QNX) ${THIRDPARTY_BOOST_INCLUDE_DIR}) target_link_libraries(StatisticsDomainParticipantStatusQueryableTests ${PRIVACY} fastcdr + fastdds::xtypes::dynamic-types::impl foonathan_memory + fastdds::log + fastdds::xtypes::dynamic-types::impl + fastdds::xtypes::type-representation GTest::gmock ${CMAKE_DL_LIBS} ${TINYXML2_LIBRARY} diff --git a/test/unittest/statistics/dds/DomainParticipantStatisticsListenerTests.cpp b/test/unittest/statistics/dds/DomainParticipantStatisticsListenerTests.cpp index f5ba6b07242..7475d19bed1 100644 --- a/test/unittest/statistics/dds/DomainParticipantStatisticsListenerTests.cpp +++ b/test/unittest/statistics/dds/DomainParticipantStatisticsListenerTests.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include namespace eprosima { namespace fastdds { diff --git a/test/unittest/statistics/dds/DomainParticipantStatisticsListenerTests/mock/fastdds/dds/publisher/DataWriter.hpp b/test/unittest/statistics/dds/DomainParticipantStatisticsListenerTests/mock/fastdds/dds/publisher/DataWriter.hpp index 0fc0cff7f28..fc7e092503a 100644 --- a/test/unittest/statistics/dds/DomainParticipantStatisticsListenerTests/mock/fastdds/dds/publisher/DataWriter.hpp +++ b/test/unittest/statistics/dds/DomainParticipantStatisticsListenerTests/mock/fastdds/dds/publisher/DataWriter.hpp @@ -21,10 +21,18 @@ #include +#include +#include +#include + namespace eprosima { namespace fastdds { namespace dds { +class DataWriterImpl; +class Publisher; +class Topic; + class DataWriter { public: diff --git a/test/unittest/statistics/dds/StatisticsDomainParticipantMockTests.cpp b/test/unittest/statistics/dds/StatisticsDomainParticipantMockTests.cpp index 88c0399fa36..b276d4611d1 100644 --- a/test/unittest/statistics/dds/StatisticsDomainParticipantMockTests.cpp +++ b/test/unittest/statistics/dds/StatisticsDomainParticipantMockTests.cpp @@ -14,6 +14,8 @@ #include #include + +#include #include #include #include @@ -21,15 +23,12 @@ #include #include #include -#include #include #include #include #include "../../logging/mock/MockConsumer.h" -using eprosima::fastrtps::types::ReturnCode_t; - namespace eprosima { namespace fastdds { namespace statistics { @@ -77,7 +76,7 @@ class DomainParticipantTest : public eprosima::fastdds::dds::DomainParticipant }; /** - * This test checks that enable_statistics_datawriter fails returning RETCODE_ERROR when create_datawriter fails + * This test checks that enable_statistics_datawriter fails returning eprosima::fastdds::dds::RETCODE_ERROR when create_datawriter fails * returning a nullptr. * 1. Create participant * 2. Mock create_datawriter so it returns nullptr @@ -116,7 +115,8 @@ TEST_F(StatisticsDomainParticipantMockTests, EnableStatisticsDataWriterFailureCr EXPECT_CALL(*builtin_pub_impl, create_datawriter_mock()).WillOnce(testing::Return(true)); // 3. enable_statistics_datawriter - EXPECT_EQ(ReturnCode_t::RETCODE_ERROR, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_ERROR, + statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(HEARTBEAT_COUNT_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(count_type.get_type_name())); @@ -127,12 +127,12 @@ TEST_F(StatisticsDomainParticipantMockTests, EnableStatisticsDataWriterFailureCr EXPECT_EQ(consumed_entries.size(), 1u); EXPECT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()-> - delete_participant(participant), ReturnCode_t::RETCODE_OK); + delete_participant(participant), fastdds::dds::RETCODE_OK); #endif // FASTDDS_STATISTICS } /** - * This test checks that disable_statistics_datawriter fails returning RETCODE_ERROR when delete_datawriter fails. + * This test checks that disable_statistics_datawriter fails returning eprosima::fastdds::dds::RETCODE_ERROR when delete_datawriter fails. * 1. Create a participant * 2. Mock delete_datawriter * 3. Enable a statistics datawriter @@ -168,29 +168,30 @@ TEST_F(StatisticsDomainParticipantMockTests, DisableStatisticsDataWriterFailureD // 3. enable_statistics_datawriter EXPECT_CALL(*builtin_pub_impl, create_datawriter_mock()).WillOnce(testing::Return(false)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, + statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); // 4. disable_statistics_datawriter - EXPECT_EQ(ReturnCode_t::RETCODE_ERROR, statistics_participant->disable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_ERROR, statistics_participant->disable_statistics_datawriter( HEARTBEAT_COUNT_TOPIC)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(HEARTBEAT_COUNT_TOPIC)); EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); EXPECT_CALL(*builtin_pub, delete_datawriter_mock()).WillOnce(testing::Return(false)); EXPECT_CALL(*statistics_participant_impl_test, delete_topic_mock()).WillOnce(testing::Return(false)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter( HEARTBEAT_COUNT_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(HEARTBEAT_COUNT_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(count_type.get_type_name())); EXPECT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()-> - delete_participant(statistics_participant), ReturnCode_t::RETCODE_OK); + delete_participant(statistics_participant), fastdds::dds::RETCODE_OK); #endif // FASTDDS_STATISTICS } /** - * This test checks that disable_statistics_datawriter fails returning RETCODE_ERROR when delete_topic fails. + * This test checks that disable_statistics_datawriter fails returning eprosima::fastdds::dds::RETCODE_ERROR when delete_topic fails. * 1. Create a participant * 2. Mock delete_topic * 3. Enable a statistics datawriter @@ -223,24 +224,25 @@ TEST_F(StatisticsDomainParticipantMockTests, DisableStatisticsDataWriterFailureD // 3. enable_statistics_datawriter EXPECT_CALL(*builtin_pub_impl, create_datawriter_mock()).WillOnce(testing::Return(false)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, + statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(HEARTBEAT_COUNT_TOPIC)); // 4. disable_statistics_datawriter - EXPECT_EQ(ReturnCode_t::RETCODE_ERROR, statistics_participant->disable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_ERROR, statistics_participant->disable_statistics_datawriter( HEARTBEAT_COUNT_TOPIC)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(HEARTBEAT_COUNT_TOPIC)); // As the DataWriter has been deleted, the topic has to be removed manually EXPECT_CALL(*statistics_participant_impl_test, delete_topic_mock()).WillOnce(testing::Return(false)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->delete_topic( + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->delete_topic( dynamic_cast(statistics_participant->lookup_topicdescription( HEARTBEAT_COUNT_TOPIC)))); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(HEARTBEAT_COUNT_TOPIC)); EXPECT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()-> - delete_participant(statistics_participant), ReturnCode_t::RETCODE_OK); + delete_participant(statistics_participant), fastdds::dds::RETCODE_OK); #endif // FASTDDS_STATISTICS } diff --git a/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests.cpp b/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests.cpp index 09558402292..74209e880f0 100644 --- a/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests.cpp +++ b/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests.cpp @@ -22,15 +22,12 @@ #include #include #include -#include #include #include #include #include "../../logging/mock/MockConsumer.h" -using eprosima::fastrtps::types::ReturnCode_t; - constexpr const char* TEST_TOPIC = "test_topic"; class TopicDataTypeMock : public eprosima::fastdds::dds::TopicDataType diff --git a/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests/mock/fastdds/publisher/DataWriterImpl.hpp b/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests/mock/fastdds/publisher/DataWriterImpl.hpp index 3d109619673..ca7b6c59787 100644 --- a/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests/mock/fastdds/publisher/DataWriterImpl.hpp +++ b/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests/mock/fastdds/publisher/DataWriterImpl.hpp @@ -21,6 +21,7 @@ #include +#include #include #include #include @@ -39,7 +40,6 @@ #include #include #include -#include #include #include @@ -145,25 +145,25 @@ class DataWriterImpl : protected rtps::IReaderDataFilter virtual ReturnCode_t enable() { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t check_delete_preconditions() { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t loan_sample( void*&, LoanInitializationKind ) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t discard_loan( void*& ) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } bool write( @@ -183,7 +183,7 @@ class DataWriterImpl : protected rtps::IReaderDataFilter void*, const InstanceHandle_t& ) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t write_w_timestamp( @@ -191,7 +191,7 @@ class DataWriterImpl : protected rtps::IReaderDataFilter const InstanceHandle_t&, const fastrtps::Time_t& ) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } InstanceHandle_t register_instance( @@ -212,7 +212,7 @@ class DataWriterImpl : protected rtps::IReaderDataFilter const InstanceHandle_t&, bool = false) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t unregister_instance_w_timestamp( @@ -221,7 +221,7 @@ class DataWriterImpl : protected rtps::IReaderDataFilter const fastrtps::Time_t&, bool = false) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void gen_guid() @@ -251,7 +251,7 @@ class DataWriterImpl : protected rtps::IReaderDataFilter ReturnCode_t wait_for_acknowledgments( const fastrtps::Duration_t& ) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t wait_for_acknowledgments( @@ -259,33 +259,33 @@ class DataWriterImpl : protected rtps::IReaderDataFilter const InstanceHandle_t&, const fastrtps::Duration_t& ) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t get_publication_matched_status( PublicationMatchedStatus&) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t get_offered_deadline_missed_status( OfferedDeadlineMissedStatus& status) { status = deadline_missed_status_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t get_offered_incompatible_qos_status( OfferedIncompatibleQosStatus& status) { status = offered_incompatible_qos_status_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t set_qos( const DataWriterQos&) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const DataWriterQos& get_qos() const @@ -306,21 +306,21 @@ class DataWriterImpl : protected rtps::IReaderDataFilter ReturnCode_t set_listener( DataWriterListener*) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t get_key_value( void*, const InstanceHandle_t& ) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t get_liveliness_lost_status( LivelinessLostStatus& status) { status = liveliness_lost_status_; - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } const Publisher* get_publisher() const @@ -336,7 +336,7 @@ class DataWriterImpl : protected rtps::IReaderDataFilter ReturnCode_t assert_liveliness() { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } virtual void disable() @@ -347,13 +347,13 @@ class DataWriterImpl : protected rtps::IReaderDataFilter ReturnCode_t clear_history( size_t*) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } ReturnCode_t get_sending_locators( rtps::LocatorList&) const { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } void filter_is_being_removed( @@ -405,14 +405,14 @@ class DataWriterImpl : protected rtps::IReaderDataFilter static ReturnCode_t check_qos( const ::eprosima::fastdds::dds::DataWriterQos&) { - return ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } static ReturnCode_t check_qos_including_resource_limits( const DataWriterQos&, const TypeSupport& ) { - return fastrtps::types::ReturnCode_t::RETCODE_OK; + return RETCODE_OK; } static void set_qos( diff --git a/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests/mock/statistics/fastdds/publisher/DataWriterImpl.hpp b/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests/mock/statistics/fastdds/publisher/DataWriterImpl.hpp index f56e0b3326b..7fb59c56b26 100644 --- a/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests/mock/statistics/fastdds/publisher/DataWriterImpl.hpp +++ b/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests/mock/statistics/fastdds/publisher/DataWriterImpl.hpp @@ -65,9 +65,9 @@ class DataWriterImpl : public efd::DataWriterImpl { } - ReturnCode_t enable() override + efd::ReturnCode_t enable() override { - return fastrtps::types::ReturnCode_t::RETCODE_OK; + return efd::RETCODE_OK; } void disable() override diff --git a/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests/mock/statistics/fastdds/publisher/PublisherImpl.hpp b/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests/mock/statistics/fastdds/publisher/PublisherImpl.hpp index 69e0f445156..6b5f3e54759 100644 --- a/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests/mock/statistics/fastdds/publisher/PublisherImpl.hpp +++ b/test/unittest/statistics/dds/StatisticsDomainParticipantStatusQueryableTests/mock/statistics/fastdds/publisher/PublisherImpl.hpp @@ -116,7 +116,7 @@ class PublisherImpl : public efd::PublisherImpl return retcode; } - ReturnCode_t delete_datawriters() + efd::ReturnCode_t delete_datawriters() { std::unique_lock lock(mtx_writers_); @@ -131,7 +131,7 @@ class PublisherImpl : public efd::PublisherImpl writers_.clear(); - return ReturnCode_t::RETCODE_OK; + return efd::RETCODE_OK; } private: diff --git a/test/unittest/statistics/dds/StatisticsDomainParticipantTests.cpp b/test/unittest/statistics/dds/StatisticsDomainParticipantTests.cpp index aaa34188199..c3d0db2e535 100644 --- a/test/unittest/statistics/dds/StatisticsDomainParticipantTests.cpp +++ b/test/unittest/statistics/dds/StatisticsDomainParticipantTests.cpp @@ -31,7 +31,6 @@ #include #include #include -#include #include #include "../../logging/mock/MockConsumer.h" @@ -41,8 +40,6 @@ namespace fastdds { namespace statistics { namespace dds { -using ReturnCode_t = eprosima::fastrtps::types::ReturnCode_t; - class FooType { public: @@ -191,31 +188,31 @@ TEST_F(StatisticsDomainParticipantTests, NarrowDomainParticipantTest) // 4. Delete DDS entities ASSERT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->delete_participant(participant), - eprosima::fastrtps::types::ReturnCode_t::RETCODE_OK); + fastdds::dds::RETCODE_OK); } /* * This test checks both eprosima::fastdds::statistics::dds::DomainParticipant enable_statistics_datawriter() and * disable_statistics_datawriter() methods. - * 1. If the FASTDDS_STATISTICS compilation flag is not set, check that the methods return RETCODE_UNSUPPORTED. + * 1. If the FASTDDS_STATISTICS compilation flag is not set, check that the methods return fastdds::dds::RETCODE_UNSUPPORTED. * Check that this error takes precedence over other possible errors. * 2. Narrow DomainParticipant to the children class. * 3. Create TypeSupports. * 4. Check that the types are not registered yet. * 5. Check that the topics do not exist yet. * 6. Enable each statistics DataWriter checking that topics are created and types are registered. - * 7. Enable an already enabled statistics DataWriter and check that it returns RETCODE_OK. - * 8. Call enable_statistics_datawriter method with an invalid topic name and check that returns RETCODE_BAD_PARAMETER. + * 7. Enable an already enabled statistics DataWriter and check that it returns fastdds::dds::RETCODE_OK. + * 8. Call enable_statistics_datawriter method with an invalid topic name and check that returns fastdds::dds::RETCODE_BAD_PARAMETER. * 9. Disable one statistics DataWriter and check that it is successful. * 10. Enable the previous statistics DataWriter with an inconsistent QoS and check that it returns - * RETCODE_INCONSISTENT_POLICY. - * 11. Check error code precedence: RETCODE_BAD_PARAMETER takes precedence over RETCODE_INCONSISTENT_POLICY. - * The case where the create_datawriter fails returning RETCODE_ERROR is not checked because it only passes the error + * fastdds::dds::RETCODE_INCONSISTENT_POLICY. + * 11. Check error code precedence: fastdds::dds::RETCODE_BAD_PARAMETER takes precedence over fastdds::dds::RETCODE_INCONSISTENT_POLICY. + * The case where the create_datawriter fails returning fastdds::dds::RETCODE_ERROR is not checked because it only passes the error * upstream. - * 12. Try to disable an already disabled statistics DataWriter and check that returns RETCODE_ERROR. + * 12. Try to disable an already disabled statistics DataWriter and check that returns fastdds::dds::RETCODE_ERROR. * 13. Check that if an invalid topic name is provided to the disable_statistics_datawriter method, it returns - * RETCODE_BAD_PARAMETER. - * The case where the delete_datawriter fails returning RETCODE_ERROR is not checked because it only passes the error + * fastdds::dds::RETCODE_BAD_PARAMETER. + * The case where the delete_datawriter fails returning fastdds::dds::RETCODE_ERROR is not checked because it only passes the error * upstream. * 14. Delete DDS entities. */ @@ -235,13 +232,13 @@ TEST_F(StatisticsDomainParticipantTests, EnableDisableStatisticsDataWriterTest) DomainParticipant* statistics_participant = static_cast(participant); ASSERT_NE(statistics_participant, nullptr); - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, statistics_participant->enable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_UNSUPPORTED, statistics_participant->enable_statistics_datawriter( HISTORY_LATENCY_TOPIC, STATISTICS_DATAWRITER_QOS)); - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, statistics_participant->enable_statistics_datawriter("INVALID_TOPIC", + EXPECT_EQ(fastdds::dds::RETCODE_UNSUPPORTED, statistics_participant->enable_statistics_datawriter("INVALID_TOPIC", inconsistent_qos)); - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, statistics_participant->disable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_UNSUPPORTED, statistics_participant->disable_statistics_datawriter( HISTORY_LATENCY_TOPIC)); - EXPECT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, statistics_participant->disable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_UNSUPPORTED, statistics_participant->disable_statistics_datawriter( "INVALID_TOPIC")); #else // 2. Narrow DomainParticipant to eprosima::fastdds::statistics::dds::DomainParticipant @@ -289,202 +286,202 @@ TEST_F(StatisticsDomainParticipantTests, EnableDisableStatisticsDataWriterTest) EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(PHYSICAL_DATA_TOPIC)); // 6. Enable each statistics DataWriter checking that topics are created and types are registered. - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HISTORY_LATENCY_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HISTORY_LATENCY_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(HISTORY_LATENCY_TOPIC)); EXPECT_TRUE(history_latency_type == statistics_participant->find_type(history_latency_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(NETWORK_LATENCY_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(NETWORK_LATENCY_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(NETWORK_LATENCY_TOPIC)); EXPECT_TRUE(network_latency_type == statistics_participant->find_type(network_latency_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter( PUBLICATION_THROUGHPUT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(PUBLICATION_THROUGHPUT_TOPIC)); EXPECT_TRUE(throughput_type == statistics_participant->find_type(throughput_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter( SUBSCRIPTION_THROUGHPUT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(SUBSCRIPTION_THROUGHPUT_TOPIC)); EXPECT_TRUE(throughput_type == statistics_participant->find_type(throughput_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(RTPS_SENT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(RTPS_SENT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(RTPS_SENT_TOPIC)); EXPECT_TRUE(rtps_traffic_type == statistics_participant->find_type(rtps_traffic_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(RTPS_LOST_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(RTPS_LOST_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(RTPS_LOST_TOPIC)); EXPECT_TRUE(rtps_traffic_type == statistics_participant->find_type(rtps_traffic_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(RESENT_DATAS_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(RESENT_DATAS_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(RESENT_DATAS_TOPIC)); EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(HEARTBEAT_COUNT_TOPIC)); EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(ACKNACK_COUNT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(ACKNACK_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(ACKNACK_COUNT_TOPIC)); EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(NACKFRAG_COUNT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(NACKFRAG_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(NACKFRAG_COUNT_TOPIC)); EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(GAP_COUNT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(GAP_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(GAP_COUNT_TOPIC)); EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(DATA_COUNT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(DATA_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(DATA_COUNT_TOPIC)); EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(PDP_PACKETS_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(PDP_PACKETS_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(PDP_PACKETS_TOPIC)); EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(EDP_PACKETS_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(EDP_PACKETS_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(EDP_PACKETS_TOPIC)); EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(DISCOVERY_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(DISCOVERY_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(DISCOVERY_TOPIC)); EXPECT_TRUE(discovery_type == statistics_participant->find_type(discovery_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(SAMPLE_DATAS_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(SAMPLE_DATAS_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(SAMPLE_DATAS_TOPIC)); EXPECT_TRUE(sample_identity_count_type == statistics_participant->find_type( sample_identity_count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(PHYSICAL_DATA_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(PHYSICAL_DATA_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(PHYSICAL_DATA_TOPIC)); EXPECT_TRUE(physical_data_type == statistics_participant->find_type(physical_data_type.get_type_name())); // 7. Enable an already enabled statistics DataWriter - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(SAMPLE_DATAS_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(SAMPLE_DATAS_TOPIC, STATISTICS_DATAWRITER_QOS)); // 8. Invalid topic name - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, statistics_participant->enable_statistics_datawriter("INVALID_TOPIC", + EXPECT_EQ(fastdds::dds::RETCODE_BAD_PARAMETER, statistics_participant->enable_statistics_datawriter("INVALID_TOPIC", STATISTICS_DATAWRITER_QOS)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription("INVALID_TOPIC")); // 9. Disable statistics DataWriter - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(HISTORY_LATENCY_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(HISTORY_LATENCY_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(HISTORY_LATENCY_TOPIC)); EXPECT_NE(nullptr, statistics_participant->lookup_topicdescription(PDP_PACKETS_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(history_latency_type.get_type_name())); // 10. Enable previous statistics DataWriter with an inconsistent QoS - EXPECT_EQ(ReturnCode_t::RETCODE_INCONSISTENT_POLICY, statistics_participant->enable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_INCONSISTENT_POLICY, statistics_participant->enable_statistics_datawriter( HISTORY_LATENCY_TOPIC, inconsistent_qos)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(HISTORY_LATENCY_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(history_latency_type.get_type_name())); - // 11. RETCODE_BAD_PARAMETER error has precedence over RETCODE_INCONSISTENT_POLICY - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, statistics_participant->enable_statistics_datawriter("INVALID_TOPIC", + // 11. fastdds::dds::RETCODE_BAD_PARAMETER error has precedence over fastdds::dds::RETCODE_INCONSISTENT_POLICY + EXPECT_EQ(fastdds::dds::RETCODE_BAD_PARAMETER, statistics_participant->enable_statistics_datawriter("INVALID_TOPIC", inconsistent_qos)); // 12. Disable already disabled DataWriter - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(HISTORY_LATENCY_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(HISTORY_LATENCY_TOPIC)); // 13. Disable invalid topic name - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, statistics_participant->disable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_BAD_PARAMETER, statistics_participant->disable_statistics_datawriter( "INVALID_TOPIC")); // 14. Remove DDS entities - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(NETWORK_LATENCY_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(NETWORK_LATENCY_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(NETWORK_LATENCY_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(network_latency_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter( PUBLICATION_THROUGHPUT_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(PUBLICATION_THROUGHPUT_TOPIC)); // The type is being used by another topic yet EXPECT_TRUE(throughput_type == statistics_participant->find_type(throughput_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter( + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter( SUBSCRIPTION_THROUGHPUT_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(SUBSCRIPTION_THROUGHPUT_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(throughput_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(RTPS_SENT_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(RTPS_SENT_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(RTPS_SENT_TOPIC)); // The type is being used by another topic yet EXPECT_TRUE(rtps_traffic_type == statistics_participant->find_type(rtps_traffic_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(RTPS_LOST_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(RTPS_LOST_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(RTPS_LOST_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(rtps_traffic_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(RESENT_DATAS_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(RESENT_DATAS_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(RESENT_DATAS_TOPIC)); // The type is being used by another topic yet EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(HEARTBEAT_COUNT_TOPIC)); // The type is being used by another topic yet EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(ACKNACK_COUNT_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(ACKNACK_COUNT_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(ACKNACK_COUNT_TOPIC)); // The type is being used by another topic yet EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(NACKFRAG_COUNT_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(NACKFRAG_COUNT_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(NACKFRAG_COUNT_TOPIC)); // The type is being used by another topic yet EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(GAP_COUNT_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(GAP_COUNT_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(GAP_COUNT_TOPIC)); // The type is being used by another topic yet EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(DATA_COUNT_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(DATA_COUNT_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(DATA_COUNT_TOPIC)); // The type is being used by another topic yet EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(PDP_PACKETS_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(PDP_PACKETS_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(PDP_PACKETS_TOPIC)); // The type is being used by another topic yet EXPECT_TRUE(count_type == statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(EDP_PACKETS_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(EDP_PACKETS_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(EDP_PACKETS_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(DISCOVERY_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(DISCOVERY_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(DISCOVERY_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(discovery_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(SAMPLE_DATAS_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(SAMPLE_DATAS_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(SAMPLE_DATAS_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(sample_identity_count_type.get_type_name())); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->disable_statistics_datawriter(PHYSICAL_DATA_TOPIC)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->disable_statistics_datawriter(PHYSICAL_DATA_TOPIC)); EXPECT_EQ(nullptr, statistics_participant->lookup_topicdescription(PHYSICAL_DATA_TOPIC)); EXPECT_EQ(null_type, statistics_participant->find_type(physical_data_type.get_type_name())); #endif // FASTDDS_STATISTICS - EXPECT_EQ(ReturnCode_t::RETCODE_OK, eprosima::fastdds::dds::DomainParticipantFactory::get_instance()-> + EXPECT_EQ(fastdds::dds::RETCODE_OK, eprosima::fastdds::dds::DomainParticipantFactory::get_instance()-> delete_participant(statistics_participant)); } @@ -559,12 +556,12 @@ TEST_F(StatisticsDomainParticipantTests, CreateParticipantWithInvalidTopicName) EXPECT_EQ(consumed_entries.size(), 2u); EXPECT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->delete_participant(participant), - ReturnCode_t::RETCODE_OK); + fastdds::dds::RETCODE_OK); #endif // FASTDDS_STATISTICS } /** - * This test checks that enable_statistics_datawriter fails returning RETCODE_ERROR when there is already a TypeSupport + * This test checks that enable_statistics_datawriter fails returning fastdds::dds::RETCODE_ERROR when there is already a TypeSupport * using a statistics reserved name registered in the participant. * 1. Create a participant and register a TypeSupport using one of the statistics reserved type names. * 2. Call enable_statistics_datawriter and check that it fails. @@ -603,7 +600,7 @@ TEST_F(StatisticsDomainParticipantTests, EnableStatisticsDataWriterFailureIncomp DomainParticipant* statistics_participant = DomainParticipant::narrow(participant); ASSERT_NE(statistics_participant, nullptr); - EXPECT_EQ(ReturnCode_t::RETCODE_ERROR, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_ERROR, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); eprosima::fastdds::dds::TypeSupport type = participant->find_type(count_type.get_type_name()); EXPECT_FALSE(count_type == type); @@ -614,7 +611,7 @@ TEST_F(StatisticsDomainParticipantTests, EnableStatisticsDataWriterFailureIncomp // 4. Call enable_statistics_datawriter with an already correctly registered type. EXPECT_EQ(nullptr, participant->lookup_topicdescription(PHYSICAL_DATA_TOPIC)); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(PHYSICAL_DATA_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(PHYSICAL_DATA_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_TRUE(physical_data_type == participant->find_type(physical_data_type.get_type_name())); EXPECT_NE(nullptr, participant->lookup_topicdescription(PHYSICAL_DATA_TOPIC)); @@ -626,12 +623,12 @@ TEST_F(StatisticsDomainParticipantTests, EnableStatisticsDataWriterFailureIncomp // delete_participant removes all builtin statistics entities EXPECT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()-> - delete_participant(statistics_participant), ReturnCode_t::RETCODE_OK); + delete_participant(statistics_participant), fastdds::dds::RETCODE_OK); #endif // FASTDDS_STATISTICS } /** - * This test checks that enable_statistics_datawriter fails returning RETCODE_ERROR when there is already a statistics + * This test checks that enable_statistics_datawriter fails returning fastdds::dds::RETCODE_ERROR when there is already a statistics * Topic created with another type different from the one expected. * 1. Create a participant and register a Topic using one of the statistics reserved topic names and with another type * different from the one expected. Register another Topic correctly. @@ -678,19 +675,19 @@ TEST_F(StatisticsDomainParticipantTests, EnableStatisticsDataWriterFailureIncomp DomainParticipant* statistics_participant = DomainParticipant::narrow(participant); ASSERT_NE(statistics_participant, nullptr); - EXPECT_EQ(ReturnCode_t::RETCODE_ERROR, statistics_participant->enable_statistics_datawriter(HISTORY_LATENCY_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_ERROR, statistics_participant->enable_statistics_datawriter(HISTORY_LATENCY_TOPIC, STATISTICS_DATAWRITER_QOS)); // 3. Check type registration EXPECT_EQ(null_type, participant->find_type(history_latency_type.get_type_name())); // 4. Call enable_statistics_datawriter with correctly created topic - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); EXPECT_TRUE(count_type == participant->find_type(count_type.get_type_name())); // 5. Call enable_statistics_datawriter and check it is successful - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(PHYSICAL_DATA_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(PHYSICAL_DATA_TOPIC, STATISTICS_DATAWRITER_QOS)); // 6. Check log error entry @@ -699,9 +696,9 @@ TEST_F(StatisticsDomainParticipantTests, EnableStatisticsDataWriterFailureIncomp EXPECT_EQ(consumed_entries.size(), 1u); // delete_participant removes all builtin statistics entities but not others - EXPECT_EQ(ReturnCode_t::RETCODE_OK, participant->delete_topic(invalid_topic)); + EXPECT_EQ(fastdds::dds::RETCODE_OK, participant->delete_topic(invalid_topic)); EXPECT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()-> - delete_participant(statistics_participant), ReturnCode_t::RETCODE_OK); + delete_participant(statistics_participant), fastdds::dds::RETCODE_OK); #endif // FASTDDS_STATISTICS } @@ -736,15 +733,15 @@ TEST_F(StatisticsDomainParticipantTests, DeleteParticipantAfterDeleteContainedEn DomainParticipant* statistics_participant = DomainParticipant::narrow(participant); ASSERT_NE(statistics_participant, nullptr); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, + EXPECT_EQ(fastdds::dds::RETCODE_OK, statistics_participant->enable_statistics_datawriter(HEARTBEAT_COUNT_TOPIC, STATISTICS_DATAWRITER_QOS)); // 3. Perform a delete_contained_entities() in the statistics participant - EXPECT_EQ(participant->delete_contained_entities(), ReturnCode_t::RETCODE_OK); + EXPECT_EQ(participant->delete_contained_entities(), fastdds::dds::RETCODE_OK); // 4. Delete the participant EXPECT_EQ(eprosima::fastdds::dds::DomainParticipantFactory::get_instance()-> - delete_participant(participant), ReturnCode_t::RETCODE_OK); + delete_participant(participant), fastdds::dds::RETCODE_OK); #endif // FASTDDS_STATISTICS } diff --git a/test/unittest/statistics/dds/StatisticsQosTests.cpp b/test/unittest/statistics/dds/StatisticsQosTests.cpp index f10abe591a6..aaad09d88ba 100644 --- a/test/unittest/statistics/dds/StatisticsQosTests.cpp +++ b/test/unittest/statistics/dds/StatisticsQosTests.cpp @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -38,8 +39,6 @@ namespace fastdds { namespace statistics { namespace dds { -using ReturnCode_t = eprosima::fastrtps::types::ReturnCode_t; - class StatisticsFromXMLProfileTests : public ::testing::Test { public: @@ -316,10 +315,10 @@ TEST_F(StatisticsFromXMLProfileTests, XMLConfigurationForStatisticsDataWritersQo ASSERT_EQ(network_latency_writer, nullptr); // But user can enable it manually through enable_statistics_datawriter_with_profile() - ReturnCode_t ret = statistics_participant->enable_statistics_datawriter_with_profile( + fastdds::dds::ReturnCode_t ret = statistics_participant->enable_statistics_datawriter_with_profile( "NETWORK_LATENCY_TOPIC", "NETWORK_LATENCY_TOPIC"); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, ret); + ASSERT_EQ(fastdds::dds::RETCODE_OK, ret); network_latency_writer = statistics_publisher->lookup_datawriter(network_latency_name); ASSERT_NE(network_latency_writer, nullptr); @@ -337,7 +336,7 @@ TEST_F(StatisticsFromXMLProfileTests, XMLConfigurationForStatisticsDataWritersQo ret = statistics_participant->enable_statistics_datawriter_with_profile( "SUBSCRIPTION_THROUGHPUT_TOPIC", "SUBSCRIPTION_THROUGHPUT_TOPIC"); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, ret); + ASSERT_EQ(fastdds::dds::RETCODE_OK, ret); subscription_througput_writer = statistics_publisher->lookup_datawriter(subscription_throughput_name); ASSERT_NE(subscription_througput_writer, nullptr); @@ -357,11 +356,11 @@ TEST_F(StatisticsFromXMLProfileTests, XMLConfigurationForStatisticsDataWritersQo ASSERT_EQ(qos4, subscription_througput_writer->get_qos()); // Calling enable_statistics_datawriter_with_profile with a profile that does not exist, - // RETCODE_ERROR must be returned. + // fastdds::dds::RETCODE_ERROR must be returned. ret = statistics_participant->enable_statistics_datawriter_with_profile( "FAKE_TOPIC", "FAKE_TOPIC"); - ASSERT_EQ(ReturnCode_t::RETCODE_ERROR, ret); + ASSERT_EQ(fastdds::dds::RETCODE_ERROR, ret); // DATA_COUNT_TOPIC is defined with inconsistent QoS policies, // and configured to be enabled automatically at initialization @@ -374,17 +373,17 @@ TEST_F(StatisticsFromXMLProfileTests, XMLConfigurationForStatisticsDataWritersQo ASSERT_EQ(data_count_writer, nullptr); // Calling enable_statistics_datawriter_with_profile with a profile defined with inconsistent QoS configuration, - // RETCODE_INCONSISTENT_POLICY must be returned. + // fastdds::dds::RETCODE_INCONSISTENT_POLICY must be returned. ret = statistics_participant->enable_statistics_datawriter_with_profile( "HEARTBEAT_COUNT_TOPIC", "HEARTBEAT_COUNT_TOPIC"); - ASSERT_EQ(ReturnCode_t::RETCODE_INCONSISTENT_POLICY, ret); + ASSERT_EQ(fastdds::dds::RETCODE_INCONSISTENT_POLICY, ret); // There is the possibility to enable a statistics topic with a profile defined with different name: ret = statistics_participant->enable_statistics_datawriter_with_profile( "OTHER_NAME_FOR_PROFILE", "NACKFRAG_COUNT_TOPIC"); - ASSERT_EQ(ReturnCode_t::RETCODE_OK, ret); + ASSERT_EQ(fastdds::dds::RETCODE_OK, ret); std::string nackfrag_count_name = NACKFRAG_COUNT_TOPIC; eprosima::fastdds::dds::DataWriter* nackfrag_count_writer = statistics_publisher->lookup_datawriter(nackfrag_count_name); @@ -412,20 +411,20 @@ TEST_F(StatisticsFromXMLProfileTests, XMLConfigurationForStatisticsDataWritersQo statistics_participant = static_cast(participant); ASSERT_NE(statistics_participant, nullptr); - ReturnCode_t ret = statistics_participant->enable_statistics_datawriter_with_profile( + fastdds::dds::ReturnCode_t ret = statistics_participant->enable_statistics_datawriter_with_profile( "HISTORY_LATENCY_TOPIC", "HISTORY_LATENCY_TOPIC"); - ASSERT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, ret); + ASSERT_EQ(fastdds::dds::RETCODE_UNSUPPORTED, ret); ret = statistics_participant->enable_statistics_datawriter_with_profile( "NETWORK_LATENCY_TOPIC", "NETWORK_LATENCY_TOPIC"); - ASSERT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, ret); + ASSERT_EQ(fastdds::dds::RETCODE_UNSUPPORTED, ret); ret = statistics_participant->enable_statistics_datawriter_with_profile( "SUBSCRIPTION_THROUGHPUT_TOPIC", "SUBSCRIPTION_THROUGHPUT_TOPIC"); - ASSERT_EQ(ReturnCode_t::RETCODE_UNSUPPORTED, ret); + ASSERT_EQ(fastdds::dds::RETCODE_UNSUPPORTED, ret); #endif // FASTDDS_STATISTICS diff --git a/test/unittest/statistics/rtps/CMakeLists.txt b/test/unittest/statistics/rtps/CMakeLists.txt index 213e45996af..ea906b30359 100644 --- a/test/unittest/statistics/rtps/CMakeLists.txt +++ b/test/unittest/statistics/rtps/CMakeLists.txt @@ -18,10 +18,6 @@ endif() set(STATISTICS_RTPS_TESTS_SOURCE RTPSStatisticsTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_types.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesv1.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesv1.cxx ) add_executable(RTPSStatisticsTests ${STATISTICS_RTPS_TESTS_SOURCE}) @@ -66,37 +62,7 @@ endif() set(STATISTICS_RTPS_MONITORSERVICETESTS_SOURCE MonitorServiceTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp @@ -123,11 +89,10 @@ set(STATISTICS_RTPS_MONITORSERVICETESTS_SOURCE ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/LocatorSelectorSender.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/monitor-service/MonitorService.cpp ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/monitor-service/MonitorServiceListener.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_types.cxx ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesv1.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesv1.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/monitorservice_typesTypeObjectSupport.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesTypeObjectSupport.cxx ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp @@ -148,6 +113,7 @@ target_compile_definitions(MonitorServiceTests PRIVATE FASTDDS_NO_LIB target_include_directories(MonitorServiceTests PRIVATE mock/Publisher mock/StatisticsBase + ${PROJECT_SOURCE_DIR}/test/mock/dds/DomainParticipantFactory ${PROJECT_SOURCE_DIR}/test/mock/rtps/BuiltinProtocols ${PROJECT_SOURCE_DIR}/test/mock/rtps/EDP ${PROJECT_SOURCE_DIR}/test/mock/rtps/Endpoint @@ -155,6 +121,7 @@ target_include_directories(MonitorServiceTests PRIVATE ${PROJECT_SOURCE_DIR}/test/mock/rtps/ExternalLocatorsProcessor ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReaderHistory ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReceiverResource + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSDomainImpl ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSParticipantImpl ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSReader ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSWriter @@ -174,9 +141,13 @@ target_include_directories(MonitorServiceTests PRIVATE target_link_libraries(MonitorServiceTests fastcdr + fastdds::log + fastdds::xtypes::dynamic-types::impl + fastdds::xtypes::type-representation GTest::gtest GTest::gmock - $<$:OpenSSL::SSL$OpenSSL::Crypto>) + $<$:OpenSSL::SSL$OpenSSL::Crypto> + ) gtest_discover_tests(MonitorServiceTests) diff --git a/test/unittest/statistics/rtps/MonitorServiceTests.cpp b/test/unittest/statistics/rtps/MonitorServiceTests.cpp index 70c08a5177d..b955ff3d7a4 100644 --- a/test/unittest/statistics/rtps/MonitorServiceTests.cpp +++ b/test/unittest/statistics/rtps/MonitorServiceTests.cpp @@ -218,11 +218,11 @@ TEST_F(MonitorServiceTests, multiple_dds_status_updates) //! Trigger statuses updates for each entity for (auto& entity : mock_guids) { - listener_.on_local_entity_status_change(entity, statistics::INCOMPATIBLE_QOS); - listener_.on_local_entity_status_change(entity, statistics::LIVELINESS_CHANGED); - listener_.on_local_entity_status_change(entity, statistics::LIVELINESS_LOST); - listener_.on_local_entity_status_change(entity, statistics::DEADLINE_MISSED); - listener_.on_local_entity_status_change(entity, statistics::SAMPLE_LOST); + listener_.on_local_entity_status_change(entity, statistics::StatusKind::INCOMPATIBLE_QOS); + listener_.on_local_entity_status_change(entity, statistics::StatusKind::LIVELINESS_CHANGED); + listener_.on_local_entity_status_change(entity, statistics::StatusKind::LIVELINESS_LOST); + listener_.on_local_entity_status_change(entity, statistics::StatusKind::DEADLINE_MISSED); + listener_.on_local_entity_status_change(entity, statistics::StatusKind::SAMPLE_LOST); } //! Verify expectations @@ -264,11 +264,11 @@ TEST_F(MonitorServiceTests, entity_removal_correctly_performs) for (auto& entity : mock_guids) { listener_.on_local_entity_connections_change(entity); - listener_.on_local_entity_status_change(entity, statistics::INCOMPATIBLE_QOS); - listener_.on_local_entity_status_change(entity, statistics::LIVELINESS_CHANGED); - listener_.on_local_entity_status_change(entity, statistics::LIVELINESS_LOST); - listener_.on_local_entity_status_change(entity, statistics::DEADLINE_MISSED); - listener_.on_local_entity_status_change(entity, statistics::SAMPLE_LOST); + listener_.on_local_entity_status_change(entity, statistics::StatusKind::INCOMPATIBLE_QOS); + listener_.on_local_entity_status_change(entity, statistics::StatusKind::LIVELINESS_CHANGED); + listener_.on_local_entity_status_change(entity, statistics::StatusKind::LIVELINESS_LOST); + listener_.on_local_entity_status_change(entity, statistics::StatusKind::DEADLINE_MISSED); + listener_.on_local_entity_status_change(entity, statistics::StatusKind::SAMPLE_LOST); } //! Verify expectations diff --git a/test/unittest/statistics/rtps/RTPSStatisticsTests.cpp b/test/unittest/statistics/rtps/RTPSStatisticsTests.cpp index c272890046a..1fa17765aac 100644 --- a/test/unittest/statistics/rtps/RTPSStatisticsTests.cpp +++ b/test/unittest/statistics/rtps/RTPSStatisticsTests.cpp @@ -46,9 +46,8 @@ #include #include -#include -#include -#include +#include +#include #include #include diff --git a/test/unittest/statistics/rtps/mock/StatisticsBase/statistics/rtps/StatisticsBase.hpp b/test/unittest/statistics/rtps/mock/StatisticsBase/statistics/rtps/StatisticsBase.hpp index f3630f6f42f..8f2b04b0f27 100644 --- a/test/unittest/statistics/rtps/mock/StatisticsBase/statistics/rtps/StatisticsBase.hpp +++ b/test/unittest/statistics/rtps/mock/StatisticsBase/statistics/rtps/StatisticsBase.hpp @@ -26,7 +26,7 @@ #include -#include +#include namespace eprosima { namespace fastdds { diff --git a/test/unittest/statistics/rtps/mock/StatisticsBase/statistics/rtps/monitor-service/MonitorService.hpp b/test/unittest/statistics/rtps/mock/StatisticsBase/statistics/rtps/monitor-service/MonitorService.hpp index 7a3a60c3f56..cd608af8251 100644 --- a/test/unittest/statistics/rtps/mock/StatisticsBase/statistics/rtps/monitor-service/MonitorService.hpp +++ b/test/unittest/statistics/rtps/mock/StatisticsBase/statistics/rtps/monitor-service/MonitorService.hpp @@ -36,7 +36,7 @@ #include #include -#include +#include #include namespace eprosima { @@ -167,7 +167,7 @@ class MonitorService */ bool write_status( const fastrtps::rtps::EntityId_t& entity_id, - const std::bitset& changed_statuses, + const std::bitset& changed_statuses, const bool& entity_disposed); /** @@ -233,7 +233,7 @@ class MonitorService //! inserted twice. std::map, bool>> local_entities_; + std::bitset, bool>> local_entities_; std::unique_ptr event_; diff --git a/test/unittest/transport/CMakeLists.txt b/test/unittest/transport/CMakeLists.txt index af11fe402ce..fdbe4c131cb 100644 --- a/test/unittest/transport/CMakeLists.txt +++ b/test/unittest/transport/CMakeLists.txt @@ -67,10 +67,6 @@ endif() set(UDPV4TESTS_SOURCE UDPv4Tests.cpp mock/MockReceiverResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/GuidPrefix_t.cpp @@ -99,10 +95,6 @@ set(UDPV4TESTS_SOURCE set(UDPV6TESTS_SOURCE UDPv6Tests.cpp mock/MockReceiverResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/GuidPrefix_t.cpp @@ -134,10 +126,6 @@ set(TCPV4TESTS_SOURCE mock/MockReceiverResource.cpp mock/MockTCPChannelResource.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/GuidPrefix_t.cpp @@ -184,10 +172,6 @@ set(TCPV6TESTS_SOURCE TCPv6Tests.cpp mock/MockReceiverResource.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/GuidPrefix_t.cpp @@ -233,10 +217,6 @@ endif() set(SHAREDMEMTESTS_SOURCE SharedMemTests.cpp mock/MockReceiverResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/GuidPrefix_t.cpp @@ -303,6 +283,7 @@ target_include_directories(UDPv4Tests PRIVATE ) target_link_libraries(UDPv4Tests fastcdr + fastdds::log GTest::gtest ${MOCKS} $<$:OpenSSL::SSL$OpenSSL::Crypto>) @@ -339,6 +320,7 @@ if(NOT DISABLE_UDPV6_TESTS) ) target_link_libraries(UDPv6Tests fastcdr + fastdds::log GTest::gtest ${MOCKS} $<$:OpenSSL::SSL$OpenSSL::Crypto>) @@ -372,6 +354,7 @@ if(NOT DISABLE_UDPV6_TESTS) ) target_link_libraries(TCPv6Tests fastcdr + fastdds::log GTest::gtest ${MOCKS} $<$:OpenSSL::SSL$OpenSSL::Crypto>) @@ -408,6 +391,7 @@ target_include_directories(TCPv4Tests PRIVATE ) target_link_libraries(TCPv4Tests fastcdr + fastdds::log GTest::gtest ${MOCKS} $<$:OpenSSL::SSL$OpenSSL::Crypto>) @@ -447,6 +431,7 @@ if(IS_THIRDPARTY_BOOST_OK) target_link_libraries(SharedMemTests foonathan_memory fastcdr + fastdds::log GTest::gtest ${MOCKS} $<$:OpenSSL::SSL$OpenSSL::Crypto> diff --git a/test/unittest/transport/TCPv4Tests.cpp b/test/unittest/transport/TCPv4Tests.cpp index cd64dbdd0e0..64786dfcd13 100644 --- a/test/unittest/transport/TCPv4Tests.cpp +++ b/test/unittest/transport/TCPv4Tests.cpp @@ -35,8 +35,12 @@ using namespace eprosima::fastdds; using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; -using TCPv4Transport = eprosima::fastdds::rtps::TCPv4Transport; +using MockTCPv4Transport = eprosima::fastdds::rtps::MockTCPv4Transport; +using SendResourceList = eprosima::fastdds::rtps::SendResourceList; +using TCPChannelResourceBasic = eprosima::fastdds::rtps::TCPChannelResourceBasic; using TCPHeader = eprosima::fastdds::rtps::TCPHeader; +using TCPv4Transport = eprosima::fastdds::rtps::TCPv4Transport; +using TCPv4TransportDescriptor = eprosima::fastdds::rtps::TCPv4TransportDescriptor; #if defined(_WIN32) #define GET_PID _getpid @@ -1440,7 +1444,8 @@ TEST_F(TCPv4Tests, secure_non_blocking_send) auto sender_unbound_channel_resources = senderTransportUnderTest.get_unbound_channel_resources(); ASSERT_TRUE(sender_unbound_channel_resources.size() == 1u); auto sender_channel_resource = - std::static_pointer_cast(sender_unbound_channel_resources[0]); + std::static_pointer_cast( + sender_unbound_channel_resources[0]); // Prepare the message asio::error_code ec; @@ -1953,7 +1958,8 @@ TEST_F(TCPv4Tests, non_blocking_send) auto sender_unbound_channel_resources = senderTransportUnderTest.get_unbound_channel_resources(); ASSERT_TRUE(sender_unbound_channel_resources.size() == 1u); auto sender_channel_resource = - std::static_pointer_cast(sender_unbound_channel_resources[0]); + std::static_pointer_cast( + sender_unbound_channel_resources[0]); // Prepare the message asio::error_code ec; diff --git a/test/unittest/transport/TCPv6Tests.cpp b/test/unittest/transport/TCPv6Tests.cpp index 1d3cf40f695..c5abb31ca88 100644 --- a/test/unittest/transport/TCPv6Tests.cpp +++ b/test/unittest/transport/TCPv6Tests.cpp @@ -34,6 +34,7 @@ using namespace eprosima::fastrtps::rtps; using namespace eprosima::fastrtps; using TCPv6Transport = eprosima::fastdds::rtps::TCPv6Transport; +using TCPv6TransportDescriptor = eprosima::fastdds::rtps::TCPv6TransportDescriptor; #if defined(_WIN32) #define GET_PID _getpid diff --git a/test/unittest/transport/UDPv4Tests.cpp b/test/unittest/transport/UDPv4Tests.cpp index 2c905c4d9f6..21d5f2d037b 100644 --- a/test/unittest/transport/UDPv4Tests.cpp +++ b/test/unittest/transport/UDPv4Tests.cpp @@ -31,6 +31,8 @@ using namespace eprosima::fastdds; using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; using UDPv4Transport = eprosima::fastdds::rtps::UDPv4Transport; +using UDPv4TransportDescriptor = eprosima::fastdds::rtps::UDPv4TransportDescriptor; +using SendResourceList = eprosima::fastdds::rtps::SendResourceList; #ifndef __APPLE__ const uint32_t ReceiveBufferCapacity = 65536; diff --git a/test/unittest/transport/UDPv6Tests.cpp b/test/unittest/transport/UDPv6Tests.cpp index ef7f6967162..803753dfb9d 100644 --- a/test/unittest/transport/UDPv6Tests.cpp +++ b/test/unittest/transport/UDPv6Tests.cpp @@ -31,6 +31,8 @@ using namespace eprosima::fastdds; using namespace eprosima::fastrtps; using namespace eprosima::fastrtps::rtps; using UDPv6Transport = eprosima::fastdds::rtps::UDPv6Transport; +using UDPv6TransportDescriptor = eprosima::fastdds::rtps::UDPv6TransportDescriptor; +using SendResourceList = eprosima::fastdds::rtps::SendResourceList; #ifndef __APPLE__ const uint32_t ReceiveBufferCapacity = 65536; diff --git a/test/unittest/transport/mock/MockTCPv4Transport.h b/test/unittest/transport/mock/MockTCPv4Transport.h index 680dc0f73d9..414b3c52c3b 100644 --- a/test/unittest/transport/mock/MockTCPv4Transport.h +++ b/test/unittest/transport/mock/MockTCPv4Transport.h @@ -20,12 +20,10 @@ #include namespace eprosima { -namespace fastrtps { +namespace fastdds { namespace rtps { -using TCPv4Transport = eprosima::fastdds::rtps::TCPv4Transport; -using TCPChannelResource = eprosima::fastdds::rtps::TCPChannelResource; -using TCPChannelResourceBasic = eprosima::fastdds::rtps::TCPChannelResourceBasic; +using Locator_t = eprosima::fastrtps::rtps::Locator_t; class MockTCPv4Transport : public TCPv4Transport { diff --git a/test/unittest/utils/CMakeLists.txt b/test/unittest/utils/CMakeLists.txt index d8638db4465..881b79ded67 100644 --- a/test/unittest/utils/CMakeLists.txt +++ b/test/unittest/utils/CMakeLists.txt @@ -18,10 +18,6 @@ endif() set(STRINGMATCHINGTESTS_SOURCE StringMatchingTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/utils/netmask_filter.cpp @@ -42,10 +38,6 @@ set(RESOURCELIMITEDVECTORTESTS_SOURCE set(LOCATORTESTS_SOURCE LocatorTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/utils/netmask_filter.cpp @@ -62,10 +54,6 @@ set(FIXEDSIZEQUEUETESTS_SOURCE set(SYSTEMINFOTESTS_SOURCE SystemInfoTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/utils/netmask_filter.cpp @@ -90,7 +78,12 @@ target_include_directories(StringMatchingTests PRIVATE ${Asio_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(StringMatchingTests fastcdr GTest::gtest ${MOCKS}) +target_link_libraries(StringMatchingTests + fastcdr + fastdds::log + GTest::gtest + ${MOCKS} + ) if(MSVC OR MSVC_IDE) target_link_libraries(StringMatchingTests ${PRIVACY} iphlpapi Shlwapi ) @@ -129,7 +122,12 @@ target_compile_definitions(LocatorTests PRIVATE target_include_directories(LocatorTests PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${Asio_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/src/cpp) -target_link_libraries(LocatorTests fastcdr GTest::gtest ${MOCKS}) +target_link_libraries(LocatorTests + fastcdr + fastdds::log + GTest::gtest + ${MOCKS} + ) if(QNX) target_link_libraries(LocatorTests socket) endif() @@ -156,7 +154,11 @@ target_compile_definitions(SystemInfoTests PRIVATE target_include_directories(SystemInfoTests PRIVATE ${Asio_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ${PROJECT_BINARY_DIR}/include) -target_link_libraries(SystemInfoTests fastcdr GTest::gtest) +target_link_libraries(SystemInfoTests + fastcdr + fastdds::log + GTest::gtest + ) gtest_discover_tests(SystemInfoTests) add_executable(SharedMutexTests shared_mutex_tests.cpp) diff --git a/test/unittest/utils/SystemInfoTests.cpp b/test/unittest/utils/SystemInfoTests.cpp index d94a6e4bb34..50da9759535 100644 --- a/test/unittest/utils/SystemInfoTests.cpp +++ b/test/unittest/utils/SystemInfoTests.cpp @@ -30,15 +30,13 @@ #endif // _WIN32 #include -#include -#include #include + +#include #include #define SIZE 512 -using ReturnCode_t = eprosima::fastrtps::types::ReturnCode_t; - class SystemInfoTests : public ::testing::Test { public: @@ -96,68 +94,69 @@ TEST_F(SystemInfoTests, GetEnvTest) ASSERT_EQ(0, setenv(eprosima::fastdds::rtps::DEFAULT_ROS2_MASTER_URI, value.c_str(), 1)); ASSERT_EQ(0, setenv(empty_var_name.c_str(), value.c_str(), 1)); #endif // _WIN32 - ASSERT_EQ(ReturnCode_t::RETCODE_OK, eprosima::SystemInfo::set_environment_file()); + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, eprosima::SystemInfo::set_environment_file()); // 2. Read environment variable not contained in the file but set in the environment - EXPECT_EQ(ReturnCode_t::RETCODE_OK, eprosima::SystemInfo::get_env(env_var_name, env_value)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, eprosima::SystemInfo::get_env(env_var_name, env_value)); EXPECT_EQ(env_value, value); // 3. Read environment variable contained in the file and in the environment: file has priority - EXPECT_EQ(ReturnCode_t::RETCODE_OK, eprosima::SystemInfo::get_env(eprosima::fastdds::rtps::DEFAULT_ROS2_MASTER_URI, + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, + eprosima::SystemInfo::get_env(eprosima::fastdds::rtps::DEFAULT_ROS2_MASTER_URI, env_value)); EXPECT_EQ("localhost:11811", env_value); // 4. Read variable set empty in the file but with a valid value in the environment: file has priority - EXPECT_EQ(ReturnCode_t::RETCODE_OK, eprosima::SystemInfo::get_env(empty_var_name, env_value)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, eprosima::SystemInfo::get_env(empty_var_name, env_value)); EXPECT_TRUE(env_value.empty()); // 5. Invalid environment name: neither in the file nor in the environment - EXPECT_EQ(eprosima::SystemInfo::get_env("INVALID_NAME", env_value), ReturnCode_t::RETCODE_NO_DATA); + EXPECT_EQ(eprosima::SystemInfo::get_env("INVALID_NAME", env_value), eprosima::fastdds::dds::RETCODE_NO_DATA); // 6. Bad parameters: empty environment name std::string non_init_string; - EXPECT_EQ(eprosima::SystemInfo::get_env("", env_value), ReturnCode_t::RETCODE_BAD_PARAMETER); - EXPECT_EQ(eprosima::SystemInfo::get_env(non_init_string, env_value), ReturnCode_t::RETCODE_BAD_PARAMETER); + EXPECT_EQ(eprosima::SystemInfo::get_env("", env_value), eprosima::fastdds::dds::RETCODE_BAD_PARAMETER); + EXPECT_EQ(eprosima::SystemInfo::get_env(non_init_string, env_value), eprosima::fastdds::dds::RETCODE_BAD_PARAMETER); // 7. Check that reading the environment variable directly from file returns correctly - ASSERT_EQ(ReturnCode_t::RETCODE_OK, eprosima::SystemInfo::get_env(filename, + ASSERT_EQ(eprosima::fastdds::dds::RETCODE_OK, eprosima::SystemInfo::get_env(filename, eprosima::fastdds::rtps::DEFAULT_ROS2_MASTER_URI, env_value)); EXPECT_EQ("localhost:11811", env_value); // 8. Check that an empty environment variable returns correctly std::string empty_environment_variable = "EMPTY_ENV_VAR"; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, eprosima::SystemInfo::get_env(filename, + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, eprosima::SystemInfo::get_env(filename, empty_environment_variable, env_value)); EXPECT_TRUE(env_value.empty()); - // 9. Check that a non-existent tag returns RETCODE_NO_DATA + // 9. Check that a non-existent tag returns eprosima::fastdds::dds::RETCODE_NO_DATA std::string non_existent_env_variable = "NON_EXISTENT_ENV_VARIBLE"; env_value.clear(); - EXPECT_EQ(ReturnCode_t::RETCODE_NO_DATA, eprosima::SystemInfo::get_env(filename, + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_NO_DATA, eprosima::SystemInfo::get_env(filename, non_existent_env_variable, env_value)); EXPECT_TRUE(env_value.empty()); - // 10. Check that a non-existent file returns RETCODE_BAD_PARAMETER + // 10. Check that a non-existent file returns eprosima::fastdds::dds::RETCODE_BAD_PARAMETER filename = "non_existent.json"; - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, eprosima::SystemInfo::get_env(filename, + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_BAD_PARAMETER, eprosima::SystemInfo::get_env(filename, eprosima::fastdds::rtps::DEFAULT_ROS2_MASTER_URI, env_value)); EXPECT_TRUE(env_value.empty()); - // 11. Check that a wrong formatted file returns RETCODE_ERROR + // 11. Check that a wrong formatted file returns eprosima::fastdds::dds::RETCODE_ERROR filename = "empty_environment_test_file.json"; - EXPECT_EQ(ReturnCode_t::RETCODE_ERROR, eprosima::SystemInfo::get_env(filename, + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_ERROR, eprosima::SystemInfo::get_env(filename, eprosima::fastdds::rtps::DEFAULT_ROS2_MASTER_URI, env_value)); EXPECT_TRUE(env_value.empty()); } /* * This test checks the get_username static method of the SystemInfo class - * The test only checks that the method returns RETCODE_OK and that the username is not an empty string + * The test only checks that the method returns eprosima::fastdds::dds::RETCODE_OK and that the username is not an empty string */ TEST_F(SystemInfoTests, GetUsernameTest) { std::string username; - EXPECT_EQ(ReturnCode_t::RETCODE_OK, eprosima::SystemInfo::get_username(username)); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, eprosima::SystemInfo::get_username(username)); EXPECT_FALSE(username.empty()); } @@ -204,9 +203,9 @@ TEST_F(SystemInfoTests, FileExistsTest) */ TEST_F(SystemInfoTests, EnvironmentFileTest) { - // 1. Environment variable not set: call to set_environment_variable returns RETCODE_NO_DATA and + // 1. Environment variable not set: call to set_environment_variable returns eprosima::fastdds::dds::RETCODE_NO_DATA and // get_environment_file returns empty - EXPECT_EQ(ReturnCode_t::RETCODE_NO_DATA, eprosima::SystemInfo::set_environment_file()); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_NO_DATA, eprosima::SystemInfo::set_environment_file()); EXPECT_TRUE(eprosima::SystemInfo::get_environment_file().empty()); // 2. Set environment file variable and see that it returns correctly @@ -216,7 +215,7 @@ TEST_F(SystemInfoTests, EnvironmentFileTest) #else ASSERT_EQ(0, setenv(eprosima::FASTDDS_ENVIRONMENT_FILE_ENV_VAR, value.c_str(), 1)); #endif // _WIN32 - EXPECT_EQ(ReturnCode_t::RETCODE_OK, eprosima::SystemInfo::set_environment_file()); + EXPECT_EQ(eprosima::fastdds::dds::RETCODE_OK, eprosima::SystemInfo::set_environment_file()); EXPECT_EQ(0, eprosima::SystemInfo::get_environment_file().compare(value)); } diff --git a/test/unittest/xmlparser/CMakeLists.txt b/test/unittest/xmlparser/CMakeLists.txt index d0015a34e5d..a5575b364fe 100644 --- a/test/unittest/xmlparser/CMakeLists.txt +++ b/test/unittest/xmlparser/CMakeLists.txt @@ -78,31 +78,10 @@ file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/regressions" DESTINATION "${CMAKE_CURRENT ################################### XMLProfileParserTests #################################################### set(XMLPROFILEPARSER_SOURCE XMLProfileParserTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/xtypes/exception/Exception.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -155,7 +134,10 @@ target_compile_definitions(XMLProfileParserTests PRIVATE $<$:__INTERNALDEBUG> # Internal debug activated. ) target_include_directories(XMLProfileParserTests PRIVATE + ${PROJECT_SOURCE_DIR}/test/mock/dds/TypeObjectRegistry + ${PROJECT_SOURCE_DIR}/test/mock/dds/TypeObjectUtils ${PROJECT_SOURCE_DIR}/test/mock/rtps/Log + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSDomainImpl # Dependency of fastdds::xtypes::type_representation ${PROJECT_SOURCE_DIR}/test/mock/rtps/SharedMemTransportDescriptor ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPTransportDescriptor ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPv4TransportDescriptor @@ -164,7 +146,8 @@ target_include_directories(XMLProfileParserTests PRIVATE ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPv4TransportDescriptor ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPv6TransportDescriptor ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSParticipantAttributes - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/include + ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ${Asio_INCLUDE_DIR} $<$:${ANDROID_IFADDRS_INCLUDE_DIR}> @@ -175,6 +158,7 @@ target_link_libraries(XMLProfileParserTests GTest::gmock $<$:ws2_32> ${TINYXML2_LIBRARY} fastcdr + fastdds::xtypes::dynamic-types::impl ) if(QNX) target_link_libraries(XMLProfileParserTests socket) @@ -188,36 +172,10 @@ gtest_discover_tests(XMLProfileParserTests) set(XMLPARSER_SOURCE XMLParserTests.cpp XMLElementParserTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/FileConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/xtypes/exception/Exception.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -265,6 +223,9 @@ target_compile_definitions(XMLParserTests PRIVATE $<$:__INTERNALDEBUG> # Internal debug activated. ) target_include_directories(XMLParserTests PRIVATE + ${PROJECT_SOURCE_DIR}/test/mock/dds/TypeObjectRegistry + ${PROJECT_SOURCE_DIR}/test/mock/dds/TypeObjectUtils + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSDomainImpl # Dependency of fastdds::xtypes::type_representation ${PROJECT_SOURCE_DIR}/test/mock/rtps/SharedMemTransportDescriptor ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPTransportDescriptor ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPv4TransportDescriptor @@ -285,6 +246,8 @@ target_link_libraries(XMLParserTests GTest::gtest $<$:ws2_32> ${TINYXML2_LIBRARY} fastcdr + fastdds::log + fastdds::xtypes::dynamic-types::impl ) if(QNX) target_link_libraries(XMLParserTests socket) @@ -329,36 +292,10 @@ gtest_discover_tests(XMLTreeTests) ################################### XMLENDPOINTPARSERTESTS ################################################### set(XMLENDPOINTPARSERTESTS_SOURCE XMLEndpointParserTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/FileConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/xtypes/exception/Exception.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/ThreadSettings.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp @@ -404,7 +341,10 @@ target_compile_definitions(XMLEndpointParserTests PRIVATE ASIO_STANDALONE ) target_include_directories(XMLEndpointParserTests PRIVATE + ${PROJECT_SOURCE_DIR}/test/mock/dds/TypeObjectRegistry + ${PROJECT_SOURCE_DIR}/test/mock/dds/TypeObjectUtils ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReaderProxyData + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSDomainImpl ${PROJECT_SOURCE_DIR}/test/mock/rtps/SharedMemTransportDescriptor ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPTransportDescriptor ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPv4TransportDescriptor @@ -426,6 +366,8 @@ target_link_libraries(XMLEndpointParserTests GTest::gtest $<$:ws2_32> ${TINYXML2_LIBRARY} fastcdr + fastdds::log + fastdds::xtypes::dynamic-types::impl ) if(QNX) target_link_libraries(XMLEndpointParserTests socket) diff --git a/test/unittest/xmlparser/XMLElementParserTests.cpp b/test/unittest/xmlparser/XMLElementParserTests.cpp index 80f0b4c1b49..190c552e2d9 100644 --- a/test/unittest/xmlparser/XMLElementParserTests.cpp +++ b/test/unittest/xmlparser/XMLElementParserTests.cpp @@ -554,7 +554,7 @@ TEST_F(XMLParserTests, getXMLLocatorTCPv6) TEST_F(XMLParserTests, getXMLTransports) { uint8_t ident = 1; - std::vector> transports; + std::vector> transports; tinyxml2::XMLDocument xml_doc; tinyxml2::XMLElement* titleElement; @@ -2012,7 +2012,6 @@ TEST_F(XMLParserTests, getXMLDurabilityQosKind) * * * - * * 2. Check invalid element */ TEST_F(XMLParserTests, getXMLBuiltinAttributes_NegativeClauses) @@ -2053,8 +2052,7 @@ TEST_F(XMLParserTests, getXMLBuiltinAttributes_NegativeClauses) "readerPayloadSize", "writerPayloadSize", "mutation_tries", - "avoid_builtin_multicast", - "typelookup_config" + "avoid_builtin_multicast" }; for (std::string tag : field_vec) @@ -4005,109 +4003,6 @@ TEST_F(XMLParserTests, getXMLOwnershipStrengthQos) } } -/* - * This test checks the positive cases of configuration through XML of the TypeLookupService. - * 1. Check that the XML return code is correct for the TypeLookup configuration settings. - * 2. Check that the flags are corretly set. - */ -TEST_F(XMLParserTests, getXMLTypeLookupSettings) -{ - uint8_t ident = 1; - TypeLookupSettings settings; - tinyxml2::XMLDocument xml_doc; - tinyxml2::XMLElement* titleElement; - - // XML snippet - const char* xml = - "\ - \ - true\ - false\ - \ - "; - - // Load the xml - ASSERT_EQ(tinyxml2::XMLError::XML_SUCCESS, xml_doc.Parse(xml)); - // Check that the XML return code is correct for the TypeLookup settings - titleElement = xml_doc.RootElement(); - EXPECT_EQ(XMLP_ret::XML_OK, XMLParserTest::getXMLTypeLookupSettings_wrapper(titleElement, settings, ident)); - EXPECT_TRUE(settings.use_server); - EXPECT_FALSE(settings.use_client); - - // XML snippet - xml = - "\ - \ - false\ - true\ - \ - "; - - // Load the xml - ASSERT_EQ(tinyxml2::XMLError::XML_SUCCESS, xml_doc.Parse(xml)); - // Check that the XML return code is correct for the TypeLookup settings - EXPECT_EQ(XMLP_ret::XML_OK, XMLParserTest::getXMLTypeLookupSettings_wrapper(titleElement, settings, ident)); - EXPECT_FALSE(settings.use_server); - EXPECT_TRUE(settings.use_client); -} - -/* - * This test checks the negative cases in the xml element. - * 1. Check an invalid tag of: - * - * - * 2. Check invalid element. - */ -TEST_F(XMLParserTests, getXMLTypeLookupSettings_NegativeClauses) -{ - uint8_t ident = 1; - TypeLookupSettings settings; - tinyxml2::XMLDocument xml_doc; - tinyxml2::XMLElement* titleElement; - - // Parametrized XML - const char* xml_p = - "\ - \ - %s\ - \ - "; - constexpr size_t xml_len {1000}; - char xml[xml_len]; - - const char* field_p = - "\ - <%s>\ - \ - \ - "; - constexpr size_t field_len {500}; - char field[field_len]; - - std::vector field_vec = - { - "use_client", - "use_server", - }; - - for (std::string tag : field_vec) - { - snprintf(field, field_len, field_p, tag.c_str(), tag.c_str()); - snprintf(xml, xml_len, xml_p, field); - ASSERT_EQ(tinyxml2::XMLError::XML_SUCCESS, xml_doc.Parse(xml)); - titleElement = xml_doc.RootElement(); - EXPECT_EQ(XMLP_ret::XML_ERROR, - XMLParserTest::getXMLTypeLookupSettings_wrapper(titleElement, settings, ident)); - } - - // Invalid element - snprintf(xml, xml_len, xml_p, " "); - ASSERT_EQ(tinyxml2::XMLError::XML_SUCCESS, xml_doc.Parse(xml)); - titleElement = xml_doc.RootElement(); - EXPECT_EQ(XMLP_ret::XML_ERROR, - XMLParserTest::getXMLTypeLookupSettings_wrapper(titleElement, settings, ident)); -} - TEST_F(XMLParserTests, get_element_text) { using namespace eprosima::fastdds::xml::detail; diff --git a/test/unittest/xmlparser/XMLParserTests.cpp b/test/unittest/xmlparser/XMLParserTests.cpp index 99b27a7cd04..8d64b483d96 100644 --- a/test/unittest/xmlparser/XMLParserTests.cpp +++ b/test/unittest/xmlparser/XMLParserTests.cpp @@ -523,8 +523,6 @@ TEST_F(XMLParserTests, Data) EXPECT_EQ(builtin.readerPayloadSize, 1000u); EXPECT_EQ(builtin.writerPayloadSize, 2000u); EXPECT_EQ(builtin.mutation_tries, 55u); - EXPECT_TRUE(builtin.typelookup_config.use_client); - EXPECT_TRUE(builtin.typelookup_config.use_server); EXPECT_EQ(port.portBase, 12); EXPECT_EQ(port.domainIDGain, 34); EXPECT_EQ(port.participantIDGain, 56); @@ -619,8 +617,6 @@ TEST_F(XMLParserTests, DataDeprecated) EXPECT_EQ(builtin.readerPayloadSize, 1000u); EXPECT_EQ(builtin.writerPayloadSize, 2000u); EXPECT_EQ(builtin.mutation_tries, 55u); - EXPECT_TRUE(builtin.typelookup_config.use_client); - EXPECT_TRUE(builtin.typelookup_config.use_server); EXPECT_EQ(port.portBase, 12); EXPECT_EQ(port.domainIDGain, 34); EXPECT_EQ(port.participantIDGain, 56); @@ -715,8 +711,6 @@ TEST_F(XMLParserTests, DataBuffer) EXPECT_EQ(builtin.readerPayloadSize, 1000u); EXPECT_EQ(builtin.writerPayloadSize, 2000u); EXPECT_EQ(builtin.mutation_tries, 55u); - EXPECT_TRUE(builtin.typelookup_config.use_client); - EXPECT_TRUE(builtin.typelookup_config.use_server); EXPECT_EQ(port.portBase, 12); EXPECT_EQ(port.domainIDGain, 34); EXPECT_EQ(port.participantIDGain, 56); @@ -811,8 +805,6 @@ TEST_F(XMLParserTests, DataBufferDeprecated) EXPECT_EQ(builtin.readerPayloadSize, 1000u); EXPECT_EQ(builtin.writerPayloadSize, 2000u); EXPECT_EQ(builtin.mutation_tries, 55u); - EXPECT_TRUE(builtin.typelookup_config.use_client); - EXPECT_TRUE(builtin.typelookup_config.use_server); EXPECT_EQ(port.portBase, 12); EXPECT_EQ(port.domainIDGain, 34); EXPECT_EQ(port.participantIDGain, 56); diff --git a/test/unittest/xmlparser/XMLProfileParserTests.cpp b/test/unittest/xmlparser/XMLProfileParserTests.cpp index d4abc6fee9a..78020cedce6 100644 --- a/test/unittest/xmlparser/XMLProfileParserTests.cpp +++ b/test/unittest/xmlparser/XMLProfileParserTests.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -550,8 +551,6 @@ TEST_P(XMLProfileParserTests, XMLParserParticipant) EXPECT_EQ(builtin.readerPayloadSize, 1000u); EXPECT_EQ(builtin.writerPayloadSize, 2000u); EXPECT_EQ(builtin.mutation_tries, 55u); - EXPECT_TRUE(builtin.typelookup_config.use_client); - EXPECT_TRUE(builtin.typelookup_config.use_server); EXPECT_EQ(port.portBase, 12); EXPECT_EQ(port.domainIDGain, 34); EXPECT_EQ(port.participantIDGain, 56); @@ -652,8 +651,6 @@ TEST_F(XMLProfileParserBasicTests, XMLParserParticipantDeprecated) EXPECT_EQ(builtin.readerPayloadSize, 1000u); EXPECT_EQ(builtin.writerPayloadSize, 2000u); EXPECT_EQ(builtin.mutation_tries, 55u); - EXPECT_TRUE(builtin.typelookup_config.use_client); - EXPECT_TRUE(builtin.typelookup_config.use_server); EXPECT_EQ(port.portBase, 12); EXPECT_EQ(port.domainIDGain, 34); EXPECT_EQ(port.participantIDGain, 56); @@ -737,8 +734,6 @@ TEST_P(XMLProfileParserTests, XMLParserDefaultParticipantProfile) EXPECT_EQ(builtin.readerPayloadSize, 1000u); EXPECT_EQ(builtin.writerPayloadSize, 2000u); EXPECT_EQ(builtin.mutation_tries, 55u); - EXPECT_TRUE(builtin.typelookup_config.use_client); - EXPECT_TRUE(builtin.typelookup_config.use_server); EXPECT_EQ(port.portBase, 12); EXPECT_EQ(port.domainIDGain, 34); EXPECT_EQ(port.participantIDGain, 56); @@ -822,8 +817,6 @@ TEST_F(XMLProfileParserBasicTests, XMLParserDefaultParticipantProfileDeprecated) EXPECT_EQ(builtin.readerPayloadSize, 1000u); EXPECT_EQ(builtin.writerPayloadSize, 2000u); EXPECT_EQ(builtin.mutation_tries, 55u); - EXPECT_TRUE(builtin.typelookup_config.use_client); - EXPECT_TRUE(builtin.typelookup_config.use_server); EXPECT_EQ(port.portBase, 12); EXPECT_EQ(port.domainIDGain, 34); EXPECT_EQ(port.participantIDGain, 56); @@ -1792,7 +1785,9 @@ TEST_F(XMLProfileParserBasicTests, insertTransportByIdNegativeClauses) */ TEST_F(XMLProfileParserBasicTests, getDynamicTypeByNameNegativeClausesNegativeClauses) { - EXPECT_EQ(nullptr, xmlparser::XMLProfileManager::getDynamicTypeByName("wrong_type")); + eprosima::fastdds::dds::traits::ref_type type; + EXPECT_EQ(xmlparser::XMLP_ret::XML_ERROR, xmlparser::XMLProfileManager::getDynamicTypeByName(type, "wrong_type")); + ASSERT_FALSE(type); } /* diff --git a/test/unittest/xmlparser/test_xml_deprecated.xml b/test/unittest/xmlparser/test_xml_deprecated.xml index 193251845af..742ffad487a 100644 --- a/test/unittest/xmlparser/test_xml_deprecated.xml +++ b/test/unittest/xmlparser/test_xml_deprecated.xml @@ -127,10 +127,6 @@ 1000 2000 55 - - true - true - 12 diff --git a/test/unittest/xmlparser/test_xml_profile.xml b/test/unittest/xmlparser/test_xml_profile.xml index 5ff93ba86aa..7e850567d7d 100644 --- a/test/unittest/xmlparser/test_xml_profile.xml +++ b/test/unittest/xmlparser/test_xml_profile.xml @@ -146,10 +146,6 @@ 1000 2000 55 - - true - true - 12 diff --git a/test/unittest/xmlparser/test_xml_profile_env_var.xml b/test/unittest/xmlparser/test_xml_profile_env_var.xml index 9c0fd41c471..8ecf1c12cd8 100644 --- a/test/unittest/xmlparser/test_xml_profile_env_var.xml +++ b/test/unittest/xmlparser/test_xml_profile_env_var.xml @@ -127,10 +127,6 @@ ${XML_PROFILES_ENV_VAR_51} ${XML_PROFILES_ENV_VAR_52} ${XML_PROFILES_ENV_VAR_53} - - ${XML_PROFILES_ENV_VAR_54} - ${XML_PROFILES_ENV_VAR_55} - ${XML_PROFILES_ENV_VAR_56} diff --git a/test/unittest/xmlparser/test_xml_rooted_deprecated.xml b/test/unittest/xmlparser/test_xml_rooted_deprecated.xml index db67a690cc1..48e6926cab8 100644 --- a/test/unittest/xmlparser/test_xml_rooted_deprecated.xml +++ b/test/unittest/xmlparser/test_xml_rooted_deprecated.xml @@ -105,10 +105,6 @@ - - true - true - 12 diff --git a/test/unittest/xmlparser/test_xml_rooted_profile.xml b/test/unittest/xmlparser/test_xml_rooted_profile.xml index 84195cf4a1a..a8fb6503d6d 100644 --- a/test/unittest/xmlparser/test_xml_rooted_profile.xml +++ b/test/unittest/xmlparser/test_xml_rooted_profile.xml @@ -124,10 +124,6 @@ - - true - true - 12 diff --git a/test/unittest/xmlparser/wrapper/XMLParserTest.hpp b/test/unittest/xmlparser/wrapper/XMLParserTest.hpp index 14ba59964cb..f6b54832a32 100644 --- a/test/unittest/xmlparser/wrapper/XMLParserTest.hpp +++ b/test/unittest/xmlparser/wrapper/XMLParserTest.hpp @@ -150,7 +150,7 @@ class XMLParserTest : public XMLParser static XMLP_ret getXMLTransports_wrapper( tinyxml2::XMLElement* elem, - std::vector>& transports, + std::vector>& transports, uint8_t ident) { return getXMLTransports(elem, transports, ident); @@ -245,14 +245,6 @@ class XMLParserTest : public XMLParser return getXMLBuiltinAttributes(elem, builtin, ident); } - static XMLP_ret getXMLTypeLookupSettings_wrapper( - tinyxml2::XMLElement* elem, - TypeLookupSettings& settings, - uint8_t ident) - { - return getXMLTypeLookupSettings(elem, settings, ident); - } - static XMLP_ret getXMLThroughputController_wrapper( tinyxml2::XMLElement* elem, ThroughputControllerDescriptor& throughputController, diff --git a/test/unittest/xtypes/CMakeLists.txt b/test/unittest/xtypes/CMakeLists.txt deleted file mode 100644 index 3b10f04b396..00000000000 --- a/test/unittest/xtypes/CMakeLists.txt +++ /dev/null @@ -1,103 +0,0 @@ -# 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. - -if(WIN32) - add_definitions( - -D_WIN32_WINNT=0x0601 - -D_CRT_SECURE_NO_WARNINGS - ) -endif() - -set(XTYPES_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicDataType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/LocatorWithMask.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/utils/netmask_filter.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/utils/network.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/network/NetmaskFilterKind.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/network/NetworkInterface.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/network/NetworkInterfaceWithFilter.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp - ) - -set(XTYPES_TEST_SOURCE - XTypesTests.cpp - idl/TypesTypeObject.cxx - idl/Types.cxx - idl/Typesv1.cxx - idl/WideEnumTypeObject.cxx - idl/WideEnum.cxx - idl/WideEnumv1.cxx - ${XTYPES_SOURCE} - ) - -if(ANDROID) - if (ANDROID_NATIVE_API_LEVEL LESS 24) - list(APPEND XTYPES_TEST_SOURCE - ${ANDROID_IFADDRS_SOURCE_DIR}/ifaddrs.c - ) - endif() -endif() - -include_directories(mock/) - -add_executable(XTypesTests ${XTYPES_TEST_SOURCE}) -target_compile_definitions(XTypesTests PRIVATE - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) -target_include_directories(XTypesTests PRIVATE - ${Asio_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - ) -target_link_libraries(XTypesTests GTest::gtest ${MOCKS}) -if(MSVC OR MSVC_IDE) - target_link_libraries(XTypesTests ${PRIVACY} fastcdr iphlpapi Shlwapi ws2_32) -else() - target_link_libraries(XTypesTests ${PRIVACY} fastcdr) -endif() -gtest_discover_tests(XTypesTests) diff --git a/test/unittest/xtypes/XTypesTests.cpp b/test/unittest/xtypes/XTypesTests.cpp deleted file mode 100644 index 9961f876c39..00000000000 --- a/test/unittest/xtypes/XTypesTests.cpp +++ /dev/null @@ -1,846 +0,0 @@ -// 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. - -#include - -#include -#include -#include -#include -#include - -#include "idl/TypesTypeObject.h" -#include "idl/WideEnumTypeObject.h" - -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::types; - -class XTypesTests : public ::testing::Test -{ -public: - - XTypesTests() - { - //registerTypesTypes(); - } - - ~XTypesTests() - { - TypeObjectFactory::delete_instance(); - eprosima::fastdds::dds::Log::KillThread(); - } - - virtual void TearDown() - { - } - -}; - -TEST_F(XTypesTests, EnumMinimalCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - eprosima::fastdds::dds::TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* my_enum = GetMinimalMyEnumStructObject(); - const TypeObject* my_bad_enum = GetMinimalMyBadEnumStructObject(); - const TypeObject* my_wide_enum = GetMinimalMyEnumWideStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = eprosima::fastdds::dds::ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(my_enum->consistent(*my_enum, consistencyQos)); - ASSERT_TRUE(my_enum->consistent(*my_bad_enum, consistencyQos)); - ASSERT_TRUE(my_enum->consistent(*my_wide_enum, consistencyQos)); - ASSERT_TRUE(my_wide_enum->consistent(*my_enum, consistencyQos)); - - // Now don't ignore names - consistencyQos.m_ignore_member_names = false; - ASSERT_FALSE(my_enum->consistent(*my_bad_enum, consistencyQos)); - ASSERT_FALSE(my_enum->consistent(*my_wide_enum, consistencyQos)); - ASSERT_FALSE(my_wide_enum->consistent(*my_enum, consistencyQos)); - - // Now don't allow type widening - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_prevent_type_widening = true; - ASSERT_TRUE(my_enum->consistent(*my_wide_enum, consistencyQos)); - ASSERT_FALSE(my_wide_enum->consistent(*my_enum, consistencyQos)); -} - -TEST_F(XTypesTests, EnumCompleteCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - eprosima::fastdds::dds::TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* my_enum = GetCompleteMyEnumStructObject(); - const TypeObject* my_bad_enum = GetCompleteMyBadEnumStructObject(); - const TypeObject* my_wide_enum = GetCompleteMyEnumWideStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = eprosima::fastdds::dds::ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(my_enum->consistent(*my_enum, consistencyQos)); - ASSERT_TRUE(my_enum->consistent(*my_bad_enum, consistencyQos)); - ASSERT_TRUE(my_enum->consistent(*my_wide_enum, consistencyQos)); - ASSERT_TRUE(my_wide_enum->consistent(*my_enum, consistencyQos)); - - // Now don't ignore names - consistencyQos.m_ignore_member_names = false; - ASSERT_FALSE(my_enum->consistent(*my_bad_enum, consistencyQos)); - ASSERT_FALSE(my_enum->consistent(*my_wide_enum, consistencyQos)); - ASSERT_FALSE(my_wide_enum->consistent(*my_enum, consistencyQos)); - - // Now don't allow type widening - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_prevent_type_widening = true; - ASSERT_TRUE(my_enum->consistent(*my_wide_enum, consistencyQos)); - ASSERT_FALSE(my_wide_enum->consistent(*my_enum, consistencyQos)); -} - -TEST_F(XTypesTests, AliasMinimalCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - eprosima::fastdds::dds::TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* my_enum = GetMinimalMyEnumStructObject(); - const TypeObject* my_alias_enum = GetMinimalMyAliasEnumStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = eprosima::fastdds::dds::ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(my_enum->consistent(*my_alias_enum, consistencyQos)); - ASSERT_TRUE(my_alias_enum->consistent(*my_enum, consistencyQos)); - - // Don't ignoring member names - consistencyQos.m_ignore_member_names = false; - ASSERT_TRUE(my_enum->consistent(*my_alias_enum, consistencyQos)); - ASSERT_TRUE(my_alias_enum->consistent(*my_enum, consistencyQos)); -} - -TEST_F(XTypesTests, AliasCompleteCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - eprosima::fastdds::dds::TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* my_enum = GetCompleteMyEnumStructObject(); - const TypeObject* my_alias_enum = GetCompleteMyAliasEnumStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = eprosima::fastdds::dds::ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(my_enum->consistent(*my_alias_enum, consistencyQos)); - ASSERT_TRUE(my_alias_enum->consistent(*my_enum, consistencyQos)); - - // Don't ignoring member names - consistencyQos.m_ignore_member_names = false; - ASSERT_TRUE(my_enum->consistent(*my_alias_enum, consistencyQos)); - ASSERT_TRUE(my_alias_enum->consistent(*my_enum, consistencyQos)); -} - -TEST_F(XTypesTests, BasicStructMinimalCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - eprosima::fastdds::dds::TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* basic_struct = GetMinimalBasicStructObject(); - const TypeObject* basic_names_struct = GetMinimalBasicNamesStructObject(); - const TypeObject* basic_bad_struct = GetMinimalBasicBadStructObject(); - const TypeObject* basic_wide_struct = GetMinimalBasicWideStructObject(); - const TypeObject* basic_wide_bad_struct = GetMinimalBadBasicWideStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = eprosima::fastdds::dds::ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(basic_struct->consistent(*basic_names_struct, consistencyQos)); - ASSERT_FALSE(basic_struct->consistent(*basic_bad_struct, consistencyQos)); - ASSERT_TRUE(basic_struct->consistent(*basic_wide_struct, consistencyQos)); - ASSERT_TRUE(basic_wide_struct->consistent(*basic_struct, consistencyQos)); - ASSERT_FALSE(basic_struct->consistent(*basic_wide_bad_struct, consistencyQos)); - ASSERT_FALSE(basic_wide_bad_struct->consistent(*basic_struct, consistencyQos)); - - // Don't ignoring member names - consistencyQos.m_ignore_member_names = false; - ASSERT_FALSE(basic_struct->consistent(*basic_names_struct, consistencyQos)); - ASSERT_TRUE(basic_struct->consistent(*basic_wide_struct, consistencyQos)); - ASSERT_TRUE(basic_wide_struct->consistent(*basic_struct, consistencyQos)); - - // Don't allow type widening - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_prevent_type_widening = true; - ASSERT_TRUE(basic_struct->consistent(*basic_wide_struct, consistencyQos)); - ASSERT_FALSE(basic_wide_struct->consistent(*basic_struct, consistencyQos)); - ASSERT_FALSE(basic_struct->consistent(*basic_wide_bad_struct, consistencyQos)); - ASSERT_FALSE(basic_wide_bad_struct->consistent(*basic_struct, consistencyQos)); - - // DISALLOW coercion - consistencyQos.m_kind = eprosima::fastdds::dds::DISALLOW_TYPE_COERCION; - ASSERT_FALSE(basic_struct->consistent(*basic_wide_struct, consistencyQos)); - ASSERT_FALSE(basic_wide_struct->consistent(*basic_struct, consistencyQos)); -} - -TEST_F(XTypesTests, BasicStructCompleteCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - eprosima::fastdds::dds::TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* basic_struct = GetCompleteBasicStructObject(); - const TypeObject* basic_names_struct = GetCompleteBasicNamesStructObject(); - const TypeObject* basic_bad_struct = GetCompleteBasicBadStructObject(); - const TypeObject* basic_wide_struct = GetCompleteBasicWideStructObject(); - const TypeObject* basic_wide_bad_struct = GetCompleteBadBasicWideStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = eprosima::fastdds::dds::ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(basic_struct->consistent(*basic_names_struct, consistencyQos)); - ASSERT_FALSE(basic_struct->consistent(*basic_bad_struct, consistencyQos)); - ASSERT_TRUE(basic_struct->consistent(*basic_wide_struct, consistencyQos)); - ASSERT_TRUE(basic_wide_struct->consistent(*basic_struct, consistencyQos)); - ASSERT_FALSE(basic_struct->consistent(*basic_wide_bad_struct, consistencyQos)); - ASSERT_FALSE(basic_wide_bad_struct->consistent(*basic_struct, consistencyQos)); - - // Don't ignoring member names - consistencyQos.m_ignore_member_names = false; - ASSERT_FALSE(basic_struct->consistent(*basic_names_struct, consistencyQos)); - ASSERT_TRUE(basic_struct->consistent(*basic_wide_struct, consistencyQos)); - ASSERT_TRUE(basic_wide_struct->consistent(*basic_struct, consistencyQos)); - - // Don't allow type widening - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_prevent_type_widening = true; - ASSERT_TRUE(basic_struct->consistent(*basic_wide_struct, consistencyQos)); - ASSERT_FALSE(basic_wide_struct->consistent(*basic_struct, consistencyQos)); - ASSERT_FALSE(basic_struct->consistent(*basic_wide_bad_struct, consistencyQos)); - ASSERT_FALSE(basic_wide_bad_struct->consistent(*basic_struct, consistencyQos)); - - // DISALLOW coercion - consistencyQos.m_kind = eprosima::fastdds::dds::DISALLOW_TYPE_COERCION; - ASSERT_FALSE(basic_struct->consistent(*basic_wide_struct, consistencyQos)); - ASSERT_FALSE(basic_wide_struct->consistent(*basic_struct, consistencyQos)); -} - -TEST_F(XTypesTests, StringMinimalCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - eprosima::fastdds::dds::TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* my_string = GetMinimalStringStructObject(); - const TypeObject* my_lstring = GetMinimalLargeStringStructObject(); - const TypeObject* my_wstring = GetMinimalWStringStructObject(); - const TypeObject* my_lwstring = GetMinimalLargeWStringStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = eprosima::fastdds::dds::ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(my_string->consistent(*my_lstring, consistencyQos)); - ASSERT_TRUE(my_lstring->consistent(*my_string, consistencyQos)); - ASSERT_TRUE(my_wstring->consistent(*my_lwstring, consistencyQos)); - ASSERT_TRUE(my_lwstring->consistent(*my_wstring, consistencyQos)); - ASSERT_FALSE(my_string->consistent(*my_wstring, consistencyQos)); - ASSERT_FALSE(my_wstring->consistent(*my_string, consistencyQos)); - ASSERT_FALSE(my_lstring->consistent(*my_lwstring, consistencyQos)); - ASSERT_FALSE(my_lwstring->consistent(*my_lstring, consistencyQos)); - - // Don't ignoring member names - consistencyQos.m_ignore_member_names = false; - ASSERT_FALSE(my_string->consistent(*my_lstring, consistencyQos)); - ASSERT_FALSE(my_lstring->consistent(*my_string, consistencyQos)); - ASSERT_FALSE(my_wstring->consistent(*my_lwstring, consistencyQos)); - ASSERT_FALSE(my_lwstring->consistent(*my_wstring, consistencyQos)); - - // Don't ignoring string bounds - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_string_bounds = false; - ASSERT_FALSE(my_string->consistent(*my_lstring, consistencyQos)); - ASSERT_TRUE(my_lstring->consistent(*my_string, consistencyQos)); - ASSERT_FALSE(my_wstring->consistent(*my_lwstring, consistencyQos)); - ASSERT_TRUE(my_lwstring->consistent(*my_wstring, consistencyQos)); -} - -TEST_F(XTypesTests, StringCompleteCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - eprosima::fastdds::dds::TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* my_string = GetCompleteStringStructObject(); - const TypeObject* my_lstring = GetCompleteLargeStringStructObject(); - const TypeObject* my_wstring = GetCompleteWStringStructObject(); - const TypeObject* my_lwstring = GetCompleteLargeWStringStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = eprosima::fastdds::dds::ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(my_string->consistent(*my_lstring, consistencyQos)); - ASSERT_TRUE(my_lstring->consistent(*my_string, consistencyQos)); - ASSERT_TRUE(my_wstring->consistent(*my_lwstring, consistencyQos)); - ASSERT_TRUE(my_lwstring->consistent(*my_wstring, consistencyQos)); - ASSERT_FALSE(my_string->consistent(*my_wstring, consistencyQos)); - ASSERT_FALSE(my_wstring->consistent(*my_string, consistencyQos)); - ASSERT_FALSE(my_lstring->consistent(*my_lwstring, consistencyQos)); - ASSERT_FALSE(my_lwstring->consistent(*my_lstring, consistencyQos)); - - // Don't ignoring member names - consistencyQos.m_ignore_member_names = false; - ASSERT_FALSE(my_string->consistent(*my_lstring, consistencyQos)); - ASSERT_FALSE(my_lstring->consistent(*my_string, consistencyQos)); - ASSERT_FALSE(my_wstring->consistent(*my_lwstring, consistencyQos)); - ASSERT_FALSE(my_lwstring->consistent(*my_wstring, consistencyQos)); - - // Don't ignoring string bounds - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_string_bounds = false; - ASSERT_FALSE(my_string->consistent(*my_lstring, consistencyQos)); - ASSERT_TRUE(my_lstring->consistent(*my_string, consistencyQos)); - ASSERT_FALSE(my_wstring->consistent(*my_lwstring, consistencyQos)); - ASSERT_TRUE(my_lwstring->consistent(*my_wstring, consistencyQos)); -} - -TEST_F(XTypesTests, ArrayMinimalCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - eprosima::fastdds::dds::TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* my_array = GetMinimalArrayStructObject(); - const TypeObject* my_array_equal = GetMinimalArrayStructEqualObject(); - const TypeObject* my_array_bad = GetMinimalArrayBadStructObject(); - const TypeObject* my_array_dims = GetMinimalArrayDimensionsStructObject(); - const TypeObject* my_array_size = GetMinimalArraySizeStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = eprosima::fastdds::dds::ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(my_array->consistent(*my_array_equal, consistencyQos)); - ASSERT_FALSE(my_array->consistent(*my_array_bad, consistencyQos)); - ASSERT_FALSE(my_array->consistent(*my_array_dims, consistencyQos)); - ASSERT_FALSE(my_array->consistent(*my_array_size, consistencyQos)); - ASSERT_TRUE(my_array_equal->consistent(*my_array, consistencyQos)); - ASSERT_FALSE(my_array_bad->consistent(*my_array, consistencyQos)); - ASSERT_FALSE(my_array_dims->consistent(*my_array, consistencyQos)); - ASSERT_FALSE(my_array_size->consistent(*my_array, consistencyQos)); - - // Don't ignoring member names - consistencyQos.m_ignore_member_names = false; - ASSERT_FALSE(my_array->consistent(*my_array_equal, consistencyQos)); -} - -TEST_F(XTypesTests, ArrayCompleteCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - eprosima::fastdds::dds::TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* my_array = GetCompleteArrayStructObject(); - const TypeObject* my_array_equal = GetCompleteArrayStructEqualObject(); - const TypeObject* my_array_bad = GetCompleteArrayBadStructObject(); - const TypeObject* my_array_dims = GetCompleteArrayDimensionsStructObject(); - const TypeObject* my_array_size = GetCompleteArraySizeStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = eprosima::fastdds::dds::ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(my_array->consistent(*my_array_equal, consistencyQos)); - ASSERT_FALSE(my_array->consistent(*my_array_bad, consistencyQos)); - ASSERT_FALSE(my_array->consistent(*my_array_dims, consistencyQos)); - ASSERT_FALSE(my_array->consistent(*my_array_size, consistencyQos)); - ASSERT_TRUE(my_array_equal->consistent(*my_array, consistencyQos)); - ASSERT_FALSE(my_array_bad->consistent(*my_array, consistencyQos)); - ASSERT_FALSE(my_array_dims->consistent(*my_array, consistencyQos)); - ASSERT_FALSE(my_array_size->consistent(*my_array, consistencyQos)); - - // Don't ignoring member names - consistencyQos.m_ignore_member_names = false; - ASSERT_FALSE(my_array->consistent(*my_array_equal, consistencyQos)); -} - -TEST_F(XTypesTests, SequenceMinimalCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - eprosima::fastdds::dds::TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* my_sequence = GetMinimalSequenceStructObject(); - const TypeObject* my_sequence_equal = GetMinimalSequenceStructEqualObject(); - const TypeObject* my_sequence_bad = GetMinimalSequenceBadStructObject(); - const TypeObject* my_sequence_bound = GetMinimalSequenceBoundsStructObject(); - const TypeObject* my_sequence_sequence = GetMinimalSequenceSequenceStructObject(); - const TypeObject* my_sequence_sequence_bound = GetMinimalSequenceSequenceBoundsStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = eprosima::fastdds::dds::ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(my_sequence->consistent(*my_sequence_equal, consistencyQos)); - ASSERT_FALSE(my_sequence->consistent(*my_sequence_bad, consistencyQos)); - ASSERT_TRUE(my_sequence->consistent(*my_sequence_bound, consistencyQos)); - ASSERT_TRUE(my_sequence_equal->consistent(*my_sequence, consistencyQos)); - ASSERT_FALSE(my_sequence_bad->consistent(*my_sequence, consistencyQos)); - ASSERT_TRUE(my_sequence_bound->consistent(*my_sequence, consistencyQos)); - - ASSERT_TRUE(my_sequence_sequence->consistent(*my_sequence_sequence_bound, consistencyQos)); - ASSERT_TRUE(my_sequence_sequence_bound->consistent(*my_sequence_sequence, consistencyQos)); - - // Don't ignoring member names - consistencyQos.m_ignore_member_names = false; - ASSERT_FALSE(my_sequence->consistent(*my_sequence_equal, consistencyQos)); - ASSERT_FALSE(my_sequence_equal->consistent(*my_sequence, consistencyQos)); - ASSERT_TRUE(my_sequence->consistent(*my_sequence_bound, consistencyQos)); - ASSERT_TRUE(my_sequence_bound->consistent(*my_sequence, consistencyQos)); - - ASSERT_TRUE(my_sequence_sequence->consistent(*my_sequence_sequence_bound, consistencyQos)); - ASSERT_TRUE(my_sequence_sequence_bound->consistent(*my_sequence_sequence, consistencyQos)); - - // Don't ignoring sequence bounds - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = false; - ASSERT_TRUE(my_sequence->consistent(*my_sequence_equal, consistencyQos)); - ASSERT_TRUE(my_sequence_equal->consistent(*my_sequence, consistencyQos)); - ASSERT_FALSE(my_sequence->consistent(*my_sequence_bound, consistencyQos)); - ASSERT_TRUE(my_sequence_bound->consistent(*my_sequence, consistencyQos)); - - ASSERT_FALSE(my_sequence_sequence->consistent(*my_sequence_sequence_bound, consistencyQos)); - ASSERT_TRUE(my_sequence_sequence_bound->consistent(*my_sequence_sequence, consistencyQos)); -} - -TEST_F(XTypesTests, SequenceCompleteCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - eprosima::fastdds::dds::TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* my_sequence = GetCompleteSequenceStructObject(); - const TypeObject* my_sequence_equal = GetCompleteSequenceStructEqualObject(); - const TypeObject* my_sequence_bad = GetCompleteSequenceBadStructObject(); - const TypeObject* my_sequence_bound = GetCompleteSequenceBoundsStructObject(); - const TypeObject* my_sequence_sequence = GetCompleteSequenceSequenceStructObject(); - const TypeObject* my_sequence_sequence_bound = GetCompleteSequenceSequenceBoundsStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = eprosima::fastdds::dds::ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(my_sequence->consistent(*my_sequence_equal, consistencyQos)); - ASSERT_FALSE(my_sequence->consistent(*my_sequence_bad, consistencyQos)); - ASSERT_TRUE(my_sequence->consistent(*my_sequence_bound, consistencyQos)); - ASSERT_TRUE(my_sequence_equal->consistent(*my_sequence, consistencyQos)); - ASSERT_FALSE(my_sequence_bad->consistent(*my_sequence, consistencyQos)); - ASSERT_TRUE(my_sequence_bound->consistent(*my_sequence, consistencyQos)); - - ASSERT_TRUE(my_sequence_sequence->consistent(*my_sequence_sequence_bound, consistencyQos)); - ASSERT_TRUE(my_sequence_sequence_bound->consistent(*my_sequence_sequence, consistencyQos)); - - // Don't ignoring member names - consistencyQos.m_ignore_member_names = false; - ASSERT_FALSE(my_sequence->consistent(*my_sequence_equal, consistencyQos)); - ASSERT_FALSE(my_sequence_equal->consistent(*my_sequence, consistencyQos)); - ASSERT_TRUE(my_sequence->consistent(*my_sequence_bound, consistencyQos)); - ASSERT_TRUE(my_sequence_bound->consistent(*my_sequence, consistencyQos)); - - ASSERT_TRUE(my_sequence_sequence->consistent(*my_sequence_sequence_bound, consistencyQos)); - ASSERT_TRUE(my_sequence_sequence_bound->consistent(*my_sequence_sequence, consistencyQos)); - - // Don't ignoring sequence bounds - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = false; - ASSERT_TRUE(my_sequence->consistent(*my_sequence_equal, consistencyQos)); - ASSERT_TRUE(my_sequence_equal->consistent(*my_sequence, consistencyQos)); - ASSERT_FALSE(my_sequence->consistent(*my_sequence_bound, consistencyQos)); - ASSERT_TRUE(my_sequence_bound->consistent(*my_sequence, consistencyQos)); - - ASSERT_FALSE(my_sequence_sequence->consistent(*my_sequence_sequence_bound, consistencyQos)); - ASSERT_TRUE(my_sequence_sequence_bound->consistent(*my_sequence_sequence, consistencyQos)); -} - -TEST_F(XTypesTests, MapMinimalCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - eprosima::fastdds::dds::TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* my_map = GetMinimalMapStructObject(); - const TypeObject* my_map_equal = GetMinimalMapStructEqualObject(); - const TypeObject* my_map_bad_key = GetMinimalMapBadKeyStructObject(); - const TypeObject* my_map_bad_elem = GetMinimalMapBadElemStructObject(); - const TypeObject* my_map_bound = GetMinimalMapBoundsStructObject(); - const TypeObject* my_map_map = GetMinimalMapMapStructObject(); - const TypeObject* my_map_map_bound = GetMinimalMapMapBoundsStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = eprosima::fastdds::dds::ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(my_map->consistent(*my_map_equal, consistencyQos)); - ASSERT_FALSE(my_map->consistent(*my_map_bad_key, consistencyQos)); - ASSERT_FALSE(my_map->consistent(*my_map_bad_elem, consistencyQos)); - ASSERT_TRUE(my_map->consistent(*my_map_bound, consistencyQos)); - - ASSERT_TRUE(my_map_equal->consistent(*my_map, consistencyQos)); - ASSERT_FALSE(my_map_bad_key->consistent(*my_map, consistencyQos)); - ASSERT_FALSE(my_map_bad_elem->consistent(*my_map, consistencyQos)); - ASSERT_TRUE(my_map_bound->consistent(*my_map, consistencyQos)); - - ASSERT_TRUE(my_map_map->consistent(*my_map_map_bound, consistencyQos)); - ASSERT_TRUE(my_map_map_bound->consistent(*my_map_map, consistencyQos)); - - // Don't ignoring member names - consistencyQos.m_ignore_member_names = false; - ASSERT_FALSE(my_map->consistent(*my_map_equal, consistencyQos)); - ASSERT_FALSE(my_map_equal->consistent(*my_map, consistencyQos)); - ASSERT_TRUE(my_map->consistent(*my_map_bound, consistencyQos)); - ASSERT_TRUE(my_map_bound->consistent(*my_map, consistencyQos)); - - ASSERT_TRUE(my_map_map->consistent(*my_map_map_bound, consistencyQos)); - ASSERT_TRUE(my_map_map_bound->consistent(*my_map_map, consistencyQos)); - - // Don't ignoring map bounds, doesn't apply on maps - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = false; - ASSERT_TRUE(my_map->consistent(*my_map_equal, consistencyQos)); - ASSERT_TRUE(my_map_equal->consistent(*my_map, consistencyQos)); - ASSERT_FALSE(my_map->consistent(*my_map_bound, consistencyQos)); - ASSERT_FALSE(my_map_bound->consistent(*my_map, consistencyQos)); - - ASSERT_FALSE(my_map_map->consistent(*my_map_map_bound, consistencyQos)); - ASSERT_FALSE(my_map_map_bound->consistent(*my_map_map, consistencyQos)); -} - -TEST_F(XTypesTests, MapCompleteCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - eprosima::fastdds::dds::TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* my_map = GetCompleteMapStructObject(); - const TypeObject* my_map_equal = GetCompleteMapStructEqualObject(); - const TypeObject* my_map_bad_key = GetCompleteMapBadKeyStructObject(); - const TypeObject* my_map_bad_elem = GetCompleteMapBadElemStructObject(); - const TypeObject* my_map_bound = GetCompleteMapBoundsStructObject(); - const TypeObject* my_map_map = GetCompleteMapMapStructObject(); - const TypeObject* my_map_map_bound = GetCompleteMapMapBoundsStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = eprosima::fastdds::dds::ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(my_map->consistent(*my_map_equal, consistencyQos)); - ASSERT_FALSE(my_map->consistent(*my_map_bad_key, consistencyQos)); - ASSERT_FALSE(my_map->consistent(*my_map_bad_elem, consistencyQos)); - ASSERT_TRUE(my_map->consistent(*my_map_bound, consistencyQos)); - - ASSERT_TRUE(my_map_equal->consistent(*my_map, consistencyQos)); - ASSERT_FALSE(my_map_bad_key->consistent(*my_map, consistencyQos)); - ASSERT_FALSE(my_map_bad_elem->consistent(*my_map, consistencyQos)); - ASSERT_TRUE(my_map_bound->consistent(*my_map, consistencyQos)); - - ASSERT_TRUE(my_map_map->consistent(*my_map_map_bound, consistencyQos)); - ASSERT_TRUE(my_map_map_bound->consistent(*my_map_map, consistencyQos)); - - // Don't ignoring member names - consistencyQos.m_ignore_member_names = false; - ASSERT_FALSE(my_map->consistent(*my_map_equal, consistencyQos)); - ASSERT_FALSE(my_map_equal->consistent(*my_map, consistencyQos)); - ASSERT_TRUE(my_map->consistent(*my_map_bound, consistencyQos)); - ASSERT_TRUE(my_map_bound->consistent(*my_map, consistencyQos)); - - ASSERT_TRUE(my_map_map->consistent(*my_map_map_bound, consistencyQos)); - ASSERT_TRUE(my_map_map_bound->consistent(*my_map_map, consistencyQos)); - - // Don't ignoring map bounds, doesn't apply on maps - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = false; - ASSERT_TRUE(my_map->consistent(*my_map_equal, consistencyQos)); - ASSERT_TRUE(my_map_equal->consistent(*my_map, consistencyQos)); - ASSERT_FALSE(my_map->consistent(*my_map_bound, consistencyQos)); - ASSERT_FALSE(my_map_bound->consistent(*my_map, consistencyQos)); - - ASSERT_FALSE(my_map_map->consistent(*my_map_map_bound, consistencyQos)); - ASSERT_FALSE(my_map_map_bound->consistent(*my_map_map, consistencyQos)); -} - -TEST_F(XTypesTests, SimpleUnionMinimalCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - eprosima::fastdds::dds::TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* basic_union = GetMinimalSimpleUnionStructObject(); - const TypeObject* basic_union_equal = GetMinimalSimpleUnionStructEqualObject(); - const TypeObject* basic_union_names = GetMinimalSimpleUnionNamesStructObject(); - const TypeObject* basic_union_type = GetMinimalSimpleTypeUnionStructObject(); - const TypeObject* basic_bad_union = GetMinimalSimpleBadUnionStructObject(); - const TypeObject* basic_bad_union_disc = GetMinimalSimplBadDiscUnionStructObject(); - const TypeObject* basic_wide_union = GetMinimalSimpleWideUnionStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = eprosima::fastdds::dds::ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(basic_union->consistent(*basic_union_equal, consistencyQos)); - ASSERT_TRUE(basic_union->consistent(*basic_union_names, consistencyQos)); - ASSERT_FALSE(basic_union->consistent(*basic_union_type, consistencyQos)); - ASSERT_FALSE(basic_union->consistent(*basic_bad_union, consistencyQos)); - ASSERT_FALSE(basic_union->consistent(*basic_bad_union_disc, consistencyQos)); - ASSERT_TRUE(basic_union_equal->consistent(*basic_union, consistencyQos)); - ASSERT_TRUE(basic_union_names->consistent(*basic_union, consistencyQos)); - ASSERT_FALSE(basic_union_type->consistent(*basic_union, consistencyQos)); - ASSERT_FALSE(basic_bad_union->consistent(*basic_union, consistencyQos)); - ASSERT_FALSE(basic_bad_union_disc->consistent(*basic_union, consistencyQos)); - - - ASSERT_TRUE(basic_union->consistent(*basic_wide_union, consistencyQos)); - ASSERT_TRUE(basic_wide_union->consistent(*basic_union, consistencyQos)); - - // Don't ignoring member names - consistencyQos.m_ignore_member_names = false; - ASSERT_FALSE(basic_union->consistent(*basic_union_names, consistencyQos)); - ASSERT_FALSE(basic_union->consistent(*basic_union_equal, consistencyQos)); - ASSERT_FALSE(basic_union_equal->consistent(*basic_union, consistencyQos)); - ASSERT_TRUE(basic_union->consistent(*basic_wide_union, consistencyQos)); - - // Don't allow type widening - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_prevent_type_widening = true; - ASSERT_TRUE(basic_union->consistent(*basic_wide_union, consistencyQos)); - ASSERT_FALSE(basic_wide_union->consistent(*basic_union, consistencyQos)); - - // DISALLOW coercion - consistencyQos.m_kind = eprosima::fastdds::dds::DISALLOW_TYPE_COERCION; - ASSERT_FALSE(basic_union->consistent(*basic_wide_union, consistencyQos)); - ASSERT_FALSE(basic_wide_union->consistent(*basic_union, consistencyQos)); -} - -TEST_F(XTypesTests, SimpleUnionCompleteCoercion) -{ - // Get Struct TypeObjects (always test struct to test the aliases and types hierarchy) - eprosima::fastdds::dds::TypeConsistencyEnforcementQosPolicy consistencyQos; - const TypeObject* basic_union = GetCompleteSimpleUnionStructObject(); - const TypeObject* basic_union_equal = GetCompleteSimpleUnionStructEqualObject(); - const TypeObject* basic_union_names = GetCompleteSimpleUnionNamesStructObject(); - const TypeObject* basic_union_type = GetCompleteSimpleTypeUnionStructObject(); - const TypeObject* basic_bad_union = GetCompleteSimpleBadUnionStructObject(); - const TypeObject* basic_bad_union_disc = GetCompleteSimplBadDiscUnionStructObject(); - const TypeObject* basic_wide_union = GetCompleteSimpleWideUnionStructObject(); - - // Configure the TypeConsistencyEnforcementQos - consistencyQos.m_force_type_validation = true; - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_ignore_sequence_bounds = true; - consistencyQos.m_ignore_string_bounds = true; - consistencyQos.m_prevent_type_widening = false; - consistencyQos.m_kind = eprosima::fastdds::dds::ALLOW_TYPE_COERCION; - - // Check results - ASSERT_TRUE(basic_union->consistent(*basic_union_equal, consistencyQos)); - ASSERT_TRUE(basic_union->consistent(*basic_union_names, consistencyQos)); - ASSERT_FALSE(basic_union->consistent(*basic_union_type, consistencyQos)); - ASSERT_FALSE(basic_union->consistent(*basic_bad_union, consistencyQos)); - ASSERT_FALSE(basic_union->consistent(*basic_bad_union_disc, consistencyQos)); - ASSERT_TRUE(basic_union_equal->consistent(*basic_union, consistencyQos)); - ASSERT_TRUE(basic_union_names->consistent(*basic_union, consistencyQos)); - ASSERT_FALSE(basic_union_type->consistent(*basic_union, consistencyQos)); - ASSERT_FALSE(basic_bad_union->consistent(*basic_union, consistencyQos)); - ASSERT_FALSE(basic_bad_union_disc->consistent(*basic_union, consistencyQos)); - - - ASSERT_TRUE(basic_union->consistent(*basic_wide_union, consistencyQos)); - ASSERT_TRUE(basic_wide_union->consistent(*basic_union, consistencyQos)); - - // Don't ignoring member names - consistencyQos.m_ignore_member_names = false; - ASSERT_FALSE(basic_union->consistent(*basic_union_names, consistencyQos)); - ASSERT_FALSE(basic_union->consistent(*basic_union_equal, consistencyQos)); - ASSERT_FALSE(basic_union_equal->consistent(*basic_union, consistencyQos)); - ASSERT_TRUE(basic_union->consistent(*basic_wide_union, consistencyQos)); - - // Don't allow type widening - consistencyQos.m_ignore_member_names = true; - consistencyQos.m_prevent_type_widening = true; - ASSERT_TRUE(basic_union->consistent(*basic_wide_union, consistencyQos)); - ASSERT_FALSE(basic_wide_union->consistent(*basic_union, consistencyQos)); - - // DISALLOW coercion - consistencyQos.m_kind = eprosima::fastdds::dds::DISALLOW_TYPE_COERCION; - ASSERT_FALSE(basic_union->consistent(*basic_wide_union, consistencyQos)); - ASSERT_FALSE(basic_wide_union->consistent(*basic_union, consistencyQos)); -} - -TEST_F(XTypesTests, TypeDescriptorFullyQualifiedName) -{ - DynamicTypeBuilder_ptr my_builder(DynamicTypeBuilderFactory::get_instance()->create_struct_builder()); - my_builder->add_member(0, "x", DynamicTypeBuilderFactory::get_instance()->create_float32_type()); - my_builder->add_member(0, "y", DynamicTypeBuilderFactory::get_instance()->create_float32_type()); - my_builder->add_member(0, "z", DynamicTypeBuilderFactory::get_instance()->create_float32_type()); - const TypeDescriptor* my_descriptor = my_builder->get_type_descriptor(); - - my_builder->set_name("Position"); - ASSERT_TRUE(my_descriptor->is_consistent()); - my_builder->set_name("Position_"); - ASSERT_TRUE(my_descriptor->is_consistent()); - my_builder->set_name("Position123"); - ASSERT_TRUE(my_descriptor->is_consistent()); - my_builder->set_name("position_123"); - ASSERT_TRUE(my_descriptor->is_consistent()); - my_builder->set_name("_Position"); - ASSERT_FALSE(my_descriptor->is_consistent()); - my_builder->set_name("123Position"); - ASSERT_FALSE(my_descriptor->is_consistent()); - my_builder->set_name("Position&"); - ASSERT_FALSE(my_descriptor->is_consistent()); - - my_builder->set_name("my_interface::action::dds_::Position"); - ASSERT_TRUE(my_descriptor->is_consistent()); - my_builder->set_name("my_interface:action::dds_::Position"); - ASSERT_FALSE(my_descriptor->is_consistent()); - my_builder->set_name("my_interface:::action::dds_::Position"); - ASSERT_FALSE(my_descriptor->is_consistent()); - my_builder->set_name("_my_interface::action::dds_::Position"); - ASSERT_FALSE(my_descriptor->is_consistent()); - my_builder->set_name("1my_interface::action::dds_::Position"); - ASSERT_FALSE(my_descriptor->is_consistent()); - my_builder->set_name(":my_interface::action::dds_::Position"); - ASSERT_FALSE(my_descriptor->is_consistent()); - my_builder->set_name("::my_interface::action::dds_::Position"); - ASSERT_FALSE(my_descriptor->is_consistent()); - my_builder->set_name("$my_interface::action::dds_::Position"); - ASSERT_FALSE(my_descriptor->is_consistent()); - my_builder->set_name("my_interface::2action::dds_::Position"); - ASSERT_FALSE(my_descriptor->is_consistent()); - my_builder->set_name("my_interface::_action::dds_::Position"); - ASSERT_FALSE(my_descriptor->is_consistent()); - my_builder->set_name("my_interface::*action::dds_::Position"); - ASSERT_FALSE(my_descriptor->is_consistent()); - my_builder->set_name("my_interface::action*::dds_::Position"); - ASSERT_FALSE(my_descriptor->is_consistent()); -} - -TEST_F(XTypesTests, MemberDescriptorFullyQualifiedName) -{ - MemberId member_id = 0; - DynamicTypeBuilder_ptr my_builder(DynamicTypeBuilderFactory::get_instance()->create_struct_builder()); - my_builder->add_member(member_id++, "x", DynamicTypeBuilderFactory::get_instance()->create_float32_type()); - my_builder->add_member(member_id++, "y", DynamicTypeBuilderFactory::get_instance()->create_float32_type()); - my_builder->add_member(member_id, "z", DynamicTypeBuilderFactory::get_instance()->create_float32_type()); - - my_builder->set_name("Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, my_builder->add_member(member_id++, "t1", my_builder->build())); - my_builder->set_name("Position_"); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, my_builder->add_member(member_id++, "t2", my_builder->build())); - my_builder->set_name("Position123"); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, my_builder->add_member(member_id++, "t3", my_builder->build())); - my_builder->set_name("position_123"); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, my_builder->add_member(member_id++, "t4", my_builder->build())); - my_builder->set_name("_Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "t5", my_builder->build())); - my_builder->set_name("123Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "t6", my_builder->build())); - my_builder->set_name("Position&"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "t7", my_builder->build())); - - my_builder->set_name("my_interface::action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_OK, my_builder->add_member(member_id++, "t8", my_builder->build())); - my_builder->set_name("my_interface:action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "t9", my_builder->build())); - my_builder->set_name("my_interface:::action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "tA", my_builder->build())); - my_builder->set_name("_my_interface::action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "tB", my_builder->build())); - my_builder->set_name("1my_interface::action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "tC", my_builder->build())); - my_builder->set_name(":my_interface::action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "tD", my_builder->build())); - my_builder->set_name("::my_interface::action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "tE", my_builder->build())); - my_builder->set_name("$my_interface::action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "tF", my_builder->build())); - my_builder->set_name("my_interface::2action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "tG", my_builder->build())); - my_builder->set_name("my_interface::_action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "tH", my_builder->build())); - my_builder->set_name("my_interface::*action::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "tI", my_builder->build())); - my_builder->set_name("my_interface::action*::dds_::Position"); - EXPECT_EQ(ReturnCode_t::RETCODE_BAD_PARAMETER, my_builder->add_member(member_id++, "tJ", my_builder->build())); -} - -int main( - int argc, - char** argv) -{ - eprosima::fastdds::dds::Log::SetVerbosity(eprosima::fastdds::dds::Log::Info); - - testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -} diff --git a/test/unittest/xtypes/idl/Types.cxx b/test/unittest/xtypes/idl/Types.cxx deleted file mode 100644 index d0ee9153b8d..00000000000 --- a/test/unittest/xtypes/idl/Types.cxx +++ /dev/null @@ -1,5244 +0,0 @@ -// 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 Types.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Types.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include "TypesTypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -MyEnumStruct::MyEnumStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MyEnumStruct::~MyEnumStruct() -{ -} - -MyEnumStruct::MyEnumStruct( - const MyEnumStruct& x) -{ - m_my_enum = x.m_my_enum; -} - -MyEnumStruct::MyEnumStruct( - MyEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; -} - -MyEnumStruct& MyEnumStruct::operator =( - const MyEnumStruct& x) -{ - - m_my_enum = x.m_my_enum; - return *this; -} - -MyEnumStruct& MyEnumStruct::operator =( - MyEnumStruct&& x) noexcept -{ - - m_my_enum = x.m_my_enum; - return *this; -} - -bool MyEnumStruct::operator ==( - const MyEnumStruct& x) const -{ - return (m_my_enum == x.m_my_enum); -} - -bool MyEnumStruct::operator !=( - const MyEnumStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ -void MyEnumStruct::my_enum( - MyEnum _my_enum) -{ - m_my_enum = _my_enum; -} - -/*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ -MyEnum MyEnumStruct::my_enum() const -{ - return m_my_enum; -} - -/*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ -MyEnum& MyEnumStruct::my_enum() -{ - return m_my_enum; -} - - - - -MyBadEnumStruct::MyBadEnumStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MyBadEnumStruct::~MyBadEnumStruct() -{ -} - -MyBadEnumStruct::MyBadEnumStruct( - const MyBadEnumStruct& x) -{ - m_my_enum = x.m_my_enum; -} - -MyBadEnumStruct::MyBadEnumStruct( - MyBadEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; -} - -MyBadEnumStruct& MyBadEnumStruct::operator =( - const MyBadEnumStruct& x) -{ - - m_my_enum = x.m_my_enum; - return *this; -} - -MyBadEnumStruct& MyBadEnumStruct::operator =( - MyBadEnumStruct&& x) noexcept -{ - - m_my_enum = x.m_my_enum; - return *this; -} - -bool MyBadEnumStruct::operator ==( - const MyBadEnumStruct& x) const -{ - return (m_my_enum == x.m_my_enum); -} - -bool MyBadEnumStruct::operator !=( - const MyBadEnumStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ -void MyBadEnumStruct::my_enum( - MyBadEnum _my_enum) -{ - m_my_enum = _my_enum; -} - -/*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ -MyBadEnum MyBadEnumStruct::my_enum() const -{ - return m_my_enum; -} - -/*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ -MyBadEnum& MyBadEnumStruct::my_enum() -{ - return m_my_enum; -} - - - - - -MyAliasEnumStruct::MyAliasEnumStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MyAliasEnumStruct::~MyAliasEnumStruct() -{ -} - -MyAliasEnumStruct::MyAliasEnumStruct( - const MyAliasEnumStruct& x) -{ - m_my_enum = x.m_my_enum; -} - -MyAliasEnumStruct::MyAliasEnumStruct( - MyAliasEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; -} - -MyAliasEnumStruct& MyAliasEnumStruct::operator =( - const MyAliasEnumStruct& x) -{ - - m_my_enum = x.m_my_enum; - return *this; -} - -MyAliasEnumStruct& MyAliasEnumStruct::operator =( - MyAliasEnumStruct&& x) noexcept -{ - - m_my_enum = x.m_my_enum; - return *this; -} - -bool MyAliasEnumStruct::operator ==( - const MyAliasEnumStruct& x) const -{ - return (m_my_enum == x.m_my_enum); -} - -bool MyAliasEnumStruct::operator !=( - const MyAliasEnumStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ -void MyAliasEnumStruct::my_enum( - MyAliasEnum _my_enum) -{ - m_my_enum = _my_enum; -} - -/*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ -MyAliasEnum MyAliasEnumStruct::my_enum() const -{ - return m_my_enum; -} - -/*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ -MyAliasEnum& MyAliasEnumStruct::my_enum() -{ - return m_my_enum; -} - - - - -BasicStruct::BasicStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -BasicStruct::~BasicStruct() -{ -} - -BasicStruct::BasicStruct( - const BasicStruct& x) -{ - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; -} - -BasicStruct::BasicStruct( - BasicStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); -} - -BasicStruct& BasicStruct::operator =( - const BasicStruct& x) -{ - - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; - return *this; -} - -BasicStruct& BasicStruct::operator =( - BasicStruct&& x) noexcept -{ - - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); - return *this; -} - -bool BasicStruct::operator ==( - const BasicStruct& x) const -{ - return (m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string); -} - -bool BasicStruct::operator !=( - const BasicStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BasicStruct::my_bool( - bool _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -bool BasicStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -bool& BasicStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BasicStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BasicStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BasicStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BasicStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BasicStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BasicStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BasicStruct::my_string() -{ - return m_my_string; -} - - - - -BasicNamesStruct::BasicNamesStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -BasicNamesStruct::~BasicNamesStruct() -{ -} - -BasicNamesStruct::BasicNamesStruct( - const BasicNamesStruct& x) -{ - m_my_bool_name = x.m_my_bool_name; - m_my_int32_name = x.m_my_int32_name; - m_my_string_name = x.m_my_string_name; -} - -BasicNamesStruct::BasicNamesStruct( - BasicNamesStruct&& x) noexcept -{ - m_my_bool_name = x.m_my_bool_name; - m_my_int32_name = x.m_my_int32_name; - m_my_string_name = std::move(x.m_my_string_name); -} - -BasicNamesStruct& BasicNamesStruct::operator =( - const BasicNamesStruct& x) -{ - - m_my_bool_name = x.m_my_bool_name; - m_my_int32_name = x.m_my_int32_name; - m_my_string_name = x.m_my_string_name; - return *this; -} - -BasicNamesStruct& BasicNamesStruct::operator =( - BasicNamesStruct&& x) noexcept -{ - - m_my_bool_name = x.m_my_bool_name; - m_my_int32_name = x.m_my_int32_name; - m_my_string_name = std::move(x.m_my_string_name); - return *this; -} - -bool BasicNamesStruct::operator ==( - const BasicNamesStruct& x) const -{ - return (m_my_bool_name == x.m_my_bool_name && - m_my_int32_name == x.m_my_int32_name && - m_my_string_name == x.m_my_string_name); -} - -bool BasicNamesStruct::operator !=( - const BasicNamesStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_bool_name - * @param _my_bool_name New value for member my_bool_name - */ -void BasicNamesStruct::my_bool_name( - bool _my_bool_name) -{ - m_my_bool_name = _my_bool_name; -} - -/*! - * @brief This function returns the value of member my_bool_name - * @return Value of member my_bool_name - */ -bool BasicNamesStruct::my_bool_name() const -{ - return m_my_bool_name; -} - -/*! - * @brief This function returns a reference to member my_bool_name - * @return Reference to member my_bool_name - */ -bool& BasicNamesStruct::my_bool_name() -{ - return m_my_bool_name; -} - - -/*! - * @brief This function sets a value in member my_int32_name - * @param _my_int32_name New value for member my_int32_name - */ -void BasicNamesStruct::my_int32_name( - int32_t _my_int32_name) -{ - m_my_int32_name = _my_int32_name; -} - -/*! - * @brief This function returns the value of member my_int32_name - * @return Value of member my_int32_name - */ -int32_t BasicNamesStruct::my_int32_name() const -{ - return m_my_int32_name; -} - -/*! - * @brief This function returns a reference to member my_int32_name - * @return Reference to member my_int32_name - */ -int32_t& BasicNamesStruct::my_int32_name() -{ - return m_my_int32_name; -} - - -/*! - * @brief This function copies the value in member my_string_name - * @param _my_string_name New value to be copied in member my_string_name - */ -void BasicNamesStruct::my_string_name( - const std::string& _my_string_name) -{ - m_my_string_name = _my_string_name; -} - -/*! - * @brief This function moves the value in member my_string_name - * @param _my_string_name New value to be moved in member my_string_name - */ -void BasicNamesStruct::my_string_name( - std::string&& _my_string_name) -{ - m_my_string_name = std::move(_my_string_name); -} - -/*! - * @brief This function returns a constant reference to member my_string_name - * @return Constant reference to member my_string_name - */ -const std::string& BasicNamesStruct::my_string_name() const -{ - return m_my_string_name; -} - -/*! - * @brief This function returns a reference to member my_string_name - * @return Reference to member my_string_name - */ -std::string& BasicNamesStruct::my_string_name() -{ - return m_my_string_name; -} - - - - -BasicBadStruct::BasicBadStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -BasicBadStruct::~BasicBadStruct() -{ -} - -BasicBadStruct::BasicBadStruct( - const BasicBadStruct& x) -{ - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; -} - -BasicBadStruct::BasicBadStruct( - BasicBadStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); -} - -BasicBadStruct& BasicBadStruct::operator =( - const BasicBadStruct& x) -{ - - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; - return *this; -} - -BasicBadStruct& BasicBadStruct::operator =( - BasicBadStruct&& x) noexcept -{ - - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); - return *this; -} - -bool BasicBadStruct::operator ==( - const BasicBadStruct& x) const -{ - return (m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string); -} - -bool BasicBadStruct::operator !=( - const BasicBadStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BasicBadStruct::my_bool( - uint8_t _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -uint8_t BasicBadStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -uint8_t& BasicBadStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BasicBadStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BasicBadStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BasicBadStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BasicBadStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BasicBadStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BasicBadStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BasicBadStruct::my_string() -{ - return m_my_string; -} - - - - -BasicWideStruct::BasicWideStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -BasicWideStruct::~BasicWideStruct() -{ -} - -BasicWideStruct::BasicWideStruct( - const BasicWideStruct& x) -{ - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; - m_new_int32 = x.m_new_int32; - m_new_string = x.m_new_string; -} - -BasicWideStruct::BasicWideStruct( - BasicWideStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); - m_new_int32 = x.m_new_int32; - m_new_string = std::move(x.m_new_string); -} - -BasicWideStruct& BasicWideStruct::operator =( - const BasicWideStruct& x) -{ - - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; - m_new_int32 = x.m_new_int32; - m_new_string = x.m_new_string; - return *this; -} - -BasicWideStruct& BasicWideStruct::operator =( - BasicWideStruct&& x) noexcept -{ - - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); - m_new_int32 = x.m_new_int32; - m_new_string = std::move(x.m_new_string); - return *this; -} - -bool BasicWideStruct::operator ==( - const BasicWideStruct& x) const -{ - return (m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string && - m_new_int32 == x.m_new_int32 && - m_new_string == x.m_new_string); -} - -bool BasicWideStruct::operator !=( - const BasicWideStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BasicWideStruct::my_bool( - bool _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -bool BasicWideStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -bool& BasicWideStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BasicWideStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BasicWideStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BasicWideStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BasicWideStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BasicWideStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BasicWideStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BasicWideStruct::my_string() -{ - return m_my_string; -} - - -/*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ -void BasicWideStruct::new_int32( - int32_t _new_int32) -{ - m_new_int32 = _new_int32; -} - -/*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ -int32_t BasicWideStruct::new_int32() const -{ - return m_new_int32; -} - -/*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ -int32_t& BasicWideStruct::new_int32() -{ - return m_new_int32; -} - - -/*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ -void BasicWideStruct::new_string( - const std::string& _new_string) -{ - m_new_string = _new_string; -} - -/*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ -void BasicWideStruct::new_string( - std::string&& _new_string) -{ - m_new_string = std::move(_new_string); -} - -/*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ -const std::string& BasicWideStruct::new_string() const -{ - return m_new_string; -} - -/*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ -std::string& BasicWideStruct::new_string() -{ - return m_new_string; -} - - - - -BadBasicWideStruct::BadBasicWideStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -BadBasicWideStruct::~BadBasicWideStruct() -{ -} - -BadBasicWideStruct::BadBasicWideStruct( - const BadBasicWideStruct& x) -{ - m_new_int32 = x.m_new_int32; - m_new_string = x.m_new_string; - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; -} - -BadBasicWideStruct::BadBasicWideStruct( - BadBasicWideStruct&& x) noexcept -{ - m_new_int32 = x.m_new_int32; - m_new_string = std::move(x.m_new_string); - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); -} - -BadBasicWideStruct& BadBasicWideStruct::operator =( - const BadBasicWideStruct& x) -{ - - m_new_int32 = x.m_new_int32; - m_new_string = x.m_new_string; - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; - return *this; -} - -BadBasicWideStruct& BadBasicWideStruct::operator =( - BadBasicWideStruct&& x) noexcept -{ - - m_new_int32 = x.m_new_int32; - m_new_string = std::move(x.m_new_string); - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); - return *this; -} - -bool BadBasicWideStruct::operator ==( - const BadBasicWideStruct& x) const -{ - return (m_new_int32 == x.m_new_int32 && - m_new_string == x.m_new_string && - m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string); -} - -bool BadBasicWideStruct::operator !=( - const BadBasicWideStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ -void BadBasicWideStruct::new_int32( - int32_t _new_int32) -{ - m_new_int32 = _new_int32; -} - -/*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ -int32_t BadBasicWideStruct::new_int32() const -{ - return m_new_int32; -} - -/*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ -int32_t& BadBasicWideStruct::new_int32() -{ - return m_new_int32; -} - - -/*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ -void BadBasicWideStruct::new_string( - const std::string& _new_string) -{ - m_new_string = _new_string; -} - -/*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ -void BadBasicWideStruct::new_string( - std::string&& _new_string) -{ - m_new_string = std::move(_new_string); -} - -/*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ -const std::string& BadBasicWideStruct::new_string() const -{ - return m_new_string; -} - -/*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ -std::string& BadBasicWideStruct::new_string() -{ - return m_new_string; -} - - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BadBasicWideStruct::my_bool( - bool _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -bool BadBasicWideStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -bool& BadBasicWideStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BadBasicWideStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BadBasicWideStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BadBasicWideStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BadBasicWideStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BadBasicWideStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BadBasicWideStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BadBasicWideStruct::my_string() -{ - return m_my_string; -} - - - - -StringStruct::StringStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -StringStruct::~StringStruct() -{ -} - -StringStruct::StringStruct( - const StringStruct& x) -{ - m_my_string = x.m_my_string; -} - -StringStruct::StringStruct( - StringStruct&& x) noexcept -{ - m_my_string = std::move(x.m_my_string); -} - -StringStruct& StringStruct::operator =( - const StringStruct& x) -{ - - m_my_string = x.m_my_string; - return *this; -} - -StringStruct& StringStruct::operator =( - StringStruct&& x) noexcept -{ - - m_my_string = std::move(x.m_my_string); - return *this; -} - -bool StringStruct::operator ==( - const StringStruct& x) const -{ - return (m_my_string == x.m_my_string); -} - -bool StringStruct::operator !=( - const StringStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void StringStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void StringStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& StringStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& StringStruct::my_string() -{ - return m_my_string; -} - - - - -LargeStringStruct::LargeStringStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -LargeStringStruct::~LargeStringStruct() -{ -} - -LargeStringStruct::LargeStringStruct( - const LargeStringStruct& x) -{ - m_my_large_string = x.m_my_large_string; -} - -LargeStringStruct::LargeStringStruct( - LargeStringStruct&& x) noexcept -{ - m_my_large_string = std::move(x.m_my_large_string); -} - -LargeStringStruct& LargeStringStruct::operator =( - const LargeStringStruct& x) -{ - - m_my_large_string = x.m_my_large_string; - return *this; -} - -LargeStringStruct& LargeStringStruct::operator =( - LargeStringStruct&& x) noexcept -{ - - m_my_large_string = std::move(x.m_my_large_string); - return *this; -} - -bool LargeStringStruct::operator ==( - const LargeStringStruct& x) const -{ - return (m_my_large_string == x.m_my_large_string); -} - -bool LargeStringStruct::operator !=( - const LargeStringStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_large_string - * @param _my_large_string New value to be copied in member my_large_string - */ -void LargeStringStruct::my_large_string( - const eprosima::fastcdr::fixed_string<41925>& _my_large_string) -{ - m_my_large_string = _my_large_string; -} - -/*! - * @brief This function moves the value in member my_large_string - * @param _my_large_string New value to be moved in member my_large_string - */ -void LargeStringStruct::my_large_string( - eprosima::fastcdr::fixed_string<41925>&& _my_large_string) -{ - m_my_large_string = std::move(_my_large_string); -} - -/*! - * @brief This function returns a constant reference to member my_large_string - * @return Constant reference to member my_large_string - */ -const eprosima::fastcdr::fixed_string<41925>& LargeStringStruct::my_large_string() const -{ - return m_my_large_string; -} - -/*! - * @brief This function returns a reference to member my_large_string - * @return Reference to member my_large_string - */ -eprosima::fastcdr::fixed_string<41925>& LargeStringStruct::my_large_string() -{ - return m_my_large_string; -} - - - - -WStringStruct::WStringStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -WStringStruct::~WStringStruct() -{ -} - -WStringStruct::WStringStruct( - const WStringStruct& x) -{ - m_my_wstring = x.m_my_wstring; -} - -WStringStruct::WStringStruct( - WStringStruct&& x) noexcept -{ - m_my_wstring = std::move(x.m_my_wstring); -} - -WStringStruct& WStringStruct::operator =( - const WStringStruct& x) -{ - - m_my_wstring = x.m_my_wstring; - return *this; -} - -WStringStruct& WStringStruct::operator =( - WStringStruct&& x) noexcept -{ - - m_my_wstring = std::move(x.m_my_wstring); - return *this; -} - -bool WStringStruct::operator ==( - const WStringStruct& x) const -{ - return (m_my_wstring == x.m_my_wstring); -} - -bool WStringStruct::operator !=( - const WStringStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_wstring - * @param _my_wstring New value to be copied in member my_wstring - */ -void WStringStruct::my_wstring( - const std::wstring& _my_wstring) -{ - m_my_wstring = _my_wstring; -} - -/*! - * @brief This function moves the value in member my_wstring - * @param _my_wstring New value to be moved in member my_wstring - */ -void WStringStruct::my_wstring( - std::wstring&& _my_wstring) -{ - m_my_wstring = std::move(_my_wstring); -} - -/*! - * @brief This function returns a constant reference to member my_wstring - * @return Constant reference to member my_wstring - */ -const std::wstring& WStringStruct::my_wstring() const -{ - return m_my_wstring; -} - -/*! - * @brief This function returns a reference to member my_wstring - * @return Reference to member my_wstring - */ -std::wstring& WStringStruct::my_wstring() -{ - return m_my_wstring; -} - - - - -LargeWStringStruct::LargeWStringStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -LargeWStringStruct::~LargeWStringStruct() -{ -} - -LargeWStringStruct::LargeWStringStruct( - const LargeWStringStruct& x) -{ - m_my_large_wstring = x.m_my_large_wstring; -} - -LargeWStringStruct::LargeWStringStruct( - LargeWStringStruct&& x) noexcept -{ - m_my_large_wstring = std::move(x.m_my_large_wstring); -} - -LargeWStringStruct& LargeWStringStruct::operator =( - const LargeWStringStruct& x) -{ - - m_my_large_wstring = x.m_my_large_wstring; - return *this; -} - -LargeWStringStruct& LargeWStringStruct::operator =( - LargeWStringStruct&& x) noexcept -{ - - m_my_large_wstring = std::move(x.m_my_large_wstring); - return *this; -} - -bool LargeWStringStruct::operator ==( - const LargeWStringStruct& x) const -{ - return (m_my_large_wstring == x.m_my_large_wstring); -} - -bool LargeWStringStruct::operator !=( - const LargeWStringStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_large_wstring - * @param _my_large_wstring New value to be copied in member my_large_wstring - */ -void LargeWStringStruct::my_large_wstring( - const std::wstring& _my_large_wstring) -{ - m_my_large_wstring = _my_large_wstring; -} - -/*! - * @brief This function moves the value in member my_large_wstring - * @param _my_large_wstring New value to be moved in member my_large_wstring - */ -void LargeWStringStruct::my_large_wstring( - std::wstring&& _my_large_wstring) -{ - m_my_large_wstring = std::move(_my_large_wstring); -} - -/*! - * @brief This function returns a constant reference to member my_large_wstring - * @return Constant reference to member my_large_wstring - */ -const std::wstring& LargeWStringStruct::my_large_wstring() const -{ - return m_my_large_wstring; -} - -/*! - * @brief This function returns a reference to member my_large_wstring - * @return Reference to member my_large_wstring - */ -std::wstring& LargeWStringStruct::my_large_wstring() -{ - return m_my_large_wstring; -} - - - - -ArrayStruct::ArrayStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -ArrayStruct::~ArrayStruct() -{ -} - -ArrayStruct::ArrayStruct( - const ArrayStruct& x) -{ - m_my_array = x.m_my_array; -} - -ArrayStruct::ArrayStruct( - ArrayStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); -} - -ArrayStruct& ArrayStruct::operator =( - const ArrayStruct& x) -{ - - m_my_array = x.m_my_array; - return *this; -} - -ArrayStruct& ArrayStruct::operator =( - ArrayStruct&& x) noexcept -{ - - m_my_array = std::move(x.m_my_array); - return *this; -} - -bool ArrayStruct::operator ==( - const ArrayStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArrayStruct::operator !=( - const ArrayStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArrayStruct::my_array( - const std::array& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArrayStruct::my_array( - std::array&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array& ArrayStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array& ArrayStruct::my_array() -{ - return m_my_array; -} - - - - -ArrayStructEqual::ArrayStructEqual() -{ - // Just to register all known types - registerTypesTypes(); -} - -ArrayStructEqual::~ArrayStructEqual() -{ -} - -ArrayStructEqual::ArrayStructEqual( - const ArrayStructEqual& x) -{ - m_my_array_equal = x.m_my_array_equal; -} - -ArrayStructEqual::ArrayStructEqual( - ArrayStructEqual&& x) noexcept -{ - m_my_array_equal = std::move(x.m_my_array_equal); -} - -ArrayStructEqual& ArrayStructEqual::operator =( - const ArrayStructEqual& x) -{ - - m_my_array_equal = x.m_my_array_equal; - return *this; -} - -ArrayStructEqual& ArrayStructEqual::operator =( - ArrayStructEqual&& x) noexcept -{ - - m_my_array_equal = std::move(x.m_my_array_equal); - return *this; -} - -bool ArrayStructEqual::operator ==( - const ArrayStructEqual& x) const -{ - return (m_my_array_equal == x.m_my_array_equal); -} - -bool ArrayStructEqual::operator !=( - const ArrayStructEqual& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_array_equal - * @param _my_array_equal New value to be copied in member my_array_equal - */ -void ArrayStructEqual::my_array_equal( - const std::array& _my_array_equal) -{ - m_my_array_equal = _my_array_equal; -} - -/*! - * @brief This function moves the value in member my_array_equal - * @param _my_array_equal New value to be moved in member my_array_equal - */ -void ArrayStructEqual::my_array_equal( - std::array&& _my_array_equal) -{ - m_my_array_equal = std::move(_my_array_equal); -} - -/*! - * @brief This function returns a constant reference to member my_array_equal - * @return Constant reference to member my_array_equal - */ -const std::array& ArrayStructEqual::my_array_equal() const -{ - return m_my_array_equal; -} - -/*! - * @brief This function returns a reference to member my_array_equal - * @return Reference to member my_array_equal - */ -std::array& ArrayStructEqual::my_array_equal() -{ - return m_my_array_equal; -} - - - - -ArrayBadStruct::ArrayBadStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -ArrayBadStruct::~ArrayBadStruct() -{ -} - -ArrayBadStruct::ArrayBadStruct( - const ArrayBadStruct& x) -{ - m_my_array = x.m_my_array; -} - -ArrayBadStruct::ArrayBadStruct( - ArrayBadStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); -} - -ArrayBadStruct& ArrayBadStruct::operator =( - const ArrayBadStruct& x) -{ - - m_my_array = x.m_my_array; - return *this; -} - -ArrayBadStruct& ArrayBadStruct::operator =( - ArrayBadStruct&& x) noexcept -{ - - m_my_array = std::move(x.m_my_array); - return *this; -} - -bool ArrayBadStruct::operator ==( - const ArrayBadStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArrayBadStruct::operator !=( - const ArrayBadStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArrayBadStruct::my_array( - const std::array& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArrayBadStruct::my_array( - std::array&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array& ArrayBadStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array& ArrayBadStruct::my_array() -{ - return m_my_array; -} - - - - -ArrayDimensionsStruct::ArrayDimensionsStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -ArrayDimensionsStruct::~ArrayDimensionsStruct() -{ -} - -ArrayDimensionsStruct::ArrayDimensionsStruct( - const ArrayDimensionsStruct& x) -{ - m_my_array = x.m_my_array; -} - -ArrayDimensionsStruct::ArrayDimensionsStruct( - ArrayDimensionsStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); -} - -ArrayDimensionsStruct& ArrayDimensionsStruct::operator =( - const ArrayDimensionsStruct& x) -{ - - m_my_array = x.m_my_array; - return *this; -} - -ArrayDimensionsStruct& ArrayDimensionsStruct::operator =( - ArrayDimensionsStruct&& x) noexcept -{ - - m_my_array = std::move(x.m_my_array); - return *this; -} - -bool ArrayDimensionsStruct::operator ==( - const ArrayDimensionsStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArrayDimensionsStruct::operator !=( - const ArrayDimensionsStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArrayDimensionsStruct::my_array( - const std::array, 2>& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArrayDimensionsStruct::my_array( - std::array, 2>&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array, 2>& ArrayDimensionsStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array, 2>& ArrayDimensionsStruct::my_array() -{ - return m_my_array; -} - - - - -ArraySizeStruct::ArraySizeStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -ArraySizeStruct::~ArraySizeStruct() -{ -} - -ArraySizeStruct::ArraySizeStruct( - const ArraySizeStruct& x) -{ - m_my_array = x.m_my_array; -} - -ArraySizeStruct::ArraySizeStruct( - ArraySizeStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); -} - -ArraySizeStruct& ArraySizeStruct::operator =( - const ArraySizeStruct& x) -{ - - m_my_array = x.m_my_array; - return *this; -} - -ArraySizeStruct& ArraySizeStruct::operator =( - ArraySizeStruct&& x) noexcept -{ - - m_my_array = std::move(x.m_my_array); - return *this; -} - -bool ArraySizeStruct::operator ==( - const ArraySizeStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArraySizeStruct::operator !=( - const ArraySizeStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArraySizeStruct::my_array( - const std::array& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArraySizeStruct::my_array( - std::array&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array& ArraySizeStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array& ArraySizeStruct::my_array() -{ - return m_my_array; -} - - - - - - -SequenceStruct::SequenceStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SequenceStruct::~SequenceStruct() -{ -} - -SequenceStruct::SequenceStruct( - const SequenceStruct& x) -{ - m_my_sequence = x.m_my_sequence; -} - -SequenceStruct::SequenceStruct( - SequenceStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); -} - -SequenceStruct& SequenceStruct::operator =( - const SequenceStruct& x) -{ - - m_my_sequence = x.m_my_sequence; - return *this; -} - -SequenceStruct& SequenceStruct::operator =( - SequenceStruct&& x) noexcept -{ - - m_my_sequence = std::move(x.m_my_sequence); - return *this; -} - -bool SequenceStruct::operator ==( - const SequenceStruct& x) const -{ - return (m_my_sequence == x.m_my_sequence); -} - -bool SequenceStruct::operator !=( - const SequenceStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ -void SequenceStruct::my_sequence( - const std::vector& _my_sequence) -{ - m_my_sequence = _my_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ -void SequenceStruct::my_sequence( - std::vector&& _my_sequence) -{ - m_my_sequence = std::move(_my_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ -const std::vector& SequenceStruct::my_sequence() const -{ - return m_my_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ -std::vector& SequenceStruct::my_sequence() -{ - return m_my_sequence; -} - - - - - - -SequenceStructEqual::SequenceStructEqual() -{ - // Just to register all known types - registerTypesTypes(); -} - -SequenceStructEqual::~SequenceStructEqual() -{ -} - -SequenceStructEqual::SequenceStructEqual( - const SequenceStructEqual& x) -{ - m_my_sequence_equal = x.m_my_sequence_equal; -} - -SequenceStructEqual::SequenceStructEqual( - SequenceStructEqual&& x) noexcept -{ - m_my_sequence_equal = std::move(x.m_my_sequence_equal); -} - -SequenceStructEqual& SequenceStructEqual::operator =( - const SequenceStructEqual& x) -{ - - m_my_sequence_equal = x.m_my_sequence_equal; - return *this; -} - -SequenceStructEqual& SequenceStructEqual::operator =( - SequenceStructEqual&& x) noexcept -{ - - m_my_sequence_equal = std::move(x.m_my_sequence_equal); - return *this; -} - -bool SequenceStructEqual::operator ==( - const SequenceStructEqual& x) const -{ - return (m_my_sequence_equal == x.m_my_sequence_equal); -} - -bool SequenceStructEqual::operator !=( - const SequenceStructEqual& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_sequence_equal - * @param _my_sequence_equal New value to be copied in member my_sequence_equal - */ -void SequenceStructEqual::my_sequence_equal( - const std::vector& _my_sequence_equal) -{ - m_my_sequence_equal = _my_sequence_equal; -} - -/*! - * @brief This function moves the value in member my_sequence_equal - * @param _my_sequence_equal New value to be moved in member my_sequence_equal - */ -void SequenceStructEqual::my_sequence_equal( - std::vector&& _my_sequence_equal) -{ - m_my_sequence_equal = std::move(_my_sequence_equal); -} - -/*! - * @brief This function returns a constant reference to member my_sequence_equal - * @return Constant reference to member my_sequence_equal - */ -const std::vector& SequenceStructEqual::my_sequence_equal() const -{ - return m_my_sequence_equal; -} - -/*! - * @brief This function returns a reference to member my_sequence_equal - * @return Reference to member my_sequence_equal - */ -std::vector& SequenceStructEqual::my_sequence_equal() -{ - return m_my_sequence_equal; -} - - - - - - -SequenceBadStruct::SequenceBadStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SequenceBadStruct::~SequenceBadStruct() -{ -} - -SequenceBadStruct::SequenceBadStruct( - const SequenceBadStruct& x) -{ - m_my_sequence = x.m_my_sequence; -} - -SequenceBadStruct::SequenceBadStruct( - SequenceBadStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); -} - -SequenceBadStruct& SequenceBadStruct::operator =( - const SequenceBadStruct& x) -{ - - m_my_sequence = x.m_my_sequence; - return *this; -} - -SequenceBadStruct& SequenceBadStruct::operator =( - SequenceBadStruct&& x) noexcept -{ - - m_my_sequence = std::move(x.m_my_sequence); - return *this; -} - -bool SequenceBadStruct::operator ==( - const SequenceBadStruct& x) const -{ - return (m_my_sequence == x.m_my_sequence); -} - -bool SequenceBadStruct::operator !=( - const SequenceBadStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ -void SequenceBadStruct::my_sequence( - const std::vector& _my_sequence) -{ - m_my_sequence = _my_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ -void SequenceBadStruct::my_sequence( - std::vector&& _my_sequence) -{ - m_my_sequence = std::move(_my_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ -const std::vector& SequenceBadStruct::my_sequence() const -{ - return m_my_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ -std::vector& SequenceBadStruct::my_sequence() -{ - return m_my_sequence; -} - - - - - - -SequenceBoundsStruct::SequenceBoundsStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SequenceBoundsStruct::~SequenceBoundsStruct() -{ -} - -SequenceBoundsStruct::SequenceBoundsStruct( - const SequenceBoundsStruct& x) -{ - m_my_sequence = x.m_my_sequence; -} - -SequenceBoundsStruct::SequenceBoundsStruct( - SequenceBoundsStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); -} - -SequenceBoundsStruct& SequenceBoundsStruct::operator =( - const SequenceBoundsStruct& x) -{ - - m_my_sequence = x.m_my_sequence; - return *this; -} - -SequenceBoundsStruct& SequenceBoundsStruct::operator =( - SequenceBoundsStruct&& x) noexcept -{ - - m_my_sequence = std::move(x.m_my_sequence); - return *this; -} - -bool SequenceBoundsStruct::operator ==( - const SequenceBoundsStruct& x) const -{ - return (m_my_sequence == x.m_my_sequence); -} - -bool SequenceBoundsStruct::operator !=( - const SequenceBoundsStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ -void SequenceBoundsStruct::my_sequence( - const std::vector& _my_sequence) -{ - m_my_sequence = _my_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ -void SequenceBoundsStruct::my_sequence( - std::vector&& _my_sequence) -{ - m_my_sequence = std::move(_my_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ -const std::vector& SequenceBoundsStruct::my_sequence() const -{ - return m_my_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ -std::vector& SequenceBoundsStruct::my_sequence() -{ - return m_my_sequence; -} - - - - - - - - -SequenceSequenceStruct::SequenceSequenceStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SequenceSequenceStruct::~SequenceSequenceStruct() -{ -} - -SequenceSequenceStruct::SequenceSequenceStruct( - const SequenceSequenceStruct& x) -{ - m_my_sequence_sequence = x.m_my_sequence_sequence; -} - -SequenceSequenceStruct::SequenceSequenceStruct( - SequenceSequenceStruct&& x) noexcept -{ - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); -} - -SequenceSequenceStruct& SequenceSequenceStruct::operator =( - const SequenceSequenceStruct& x) -{ - - m_my_sequence_sequence = x.m_my_sequence_sequence; - return *this; -} - -SequenceSequenceStruct& SequenceSequenceStruct::operator =( - SequenceSequenceStruct&& x) noexcept -{ - - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - return *this; -} - -bool SequenceSequenceStruct::operator ==( - const SequenceSequenceStruct& x) const -{ - return (m_my_sequence_sequence == x.m_my_sequence_sequence); -} - -bool SequenceSequenceStruct::operator !=( - const SequenceSequenceStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ -void SequenceSequenceStruct::my_sequence_sequence( - const std::vector>& _my_sequence_sequence) -{ - m_my_sequence_sequence = _my_sequence_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ -void SequenceSequenceStruct::my_sequence_sequence( - std::vector>&& _my_sequence_sequence) -{ - m_my_sequence_sequence = std::move(_my_sequence_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ -const std::vector>& SequenceSequenceStruct::my_sequence_sequence() const -{ - return m_my_sequence_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ -std::vector>& SequenceSequenceStruct::my_sequence_sequence() -{ - return m_my_sequence_sequence; -} - - - - - - - - -SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SequenceSequenceBoundsStruct::~SequenceSequenceBoundsStruct() -{ -} - -SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct( - const SequenceSequenceBoundsStruct& x) -{ - m_my_sequence_sequence = x.m_my_sequence_sequence; -} - -SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct( - SequenceSequenceBoundsStruct&& x) noexcept -{ - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); -} - -SequenceSequenceBoundsStruct& SequenceSequenceBoundsStruct::operator =( - const SequenceSequenceBoundsStruct& x) -{ - - m_my_sequence_sequence = x.m_my_sequence_sequence; - return *this; -} - -SequenceSequenceBoundsStruct& SequenceSequenceBoundsStruct::operator =( - SequenceSequenceBoundsStruct&& x) noexcept -{ - - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - return *this; -} - -bool SequenceSequenceBoundsStruct::operator ==( - const SequenceSequenceBoundsStruct& x) const -{ - return (m_my_sequence_sequence == x.m_my_sequence_sequence); -} - -bool SequenceSequenceBoundsStruct::operator !=( - const SequenceSequenceBoundsStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ -void SequenceSequenceBoundsStruct::my_sequence_sequence( - const std::vector>& _my_sequence_sequence) -{ - m_my_sequence_sequence = _my_sequence_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ -void SequenceSequenceBoundsStruct::my_sequence_sequence( - std::vector>&& _my_sequence_sequence) -{ - m_my_sequence_sequence = std::move(_my_sequence_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ -const std::vector>& SequenceSequenceBoundsStruct::my_sequence_sequence() const -{ - return m_my_sequence_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ -std::vector>& SequenceSequenceBoundsStruct::my_sequence_sequence() -{ - return m_my_sequence_sequence; -} - - - - - - -MapStruct::MapStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MapStruct::~MapStruct() -{ -} - -MapStruct::MapStruct( - const MapStruct& x) -{ - m_my_map = x.m_my_map; -} - -MapStruct::MapStruct( - MapStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); -} - -MapStruct& MapStruct::operator =( - const MapStruct& x) -{ - - m_my_map = x.m_my_map; - return *this; -} - -MapStruct& MapStruct::operator =( - MapStruct&& x) noexcept -{ - - m_my_map = std::move(x.m_my_map); - return *this; -} - -bool MapStruct::operator ==( - const MapStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapStruct::operator !=( - const MapStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapStruct::my_map() -{ - return m_my_map; -} - - - - - - -MapStructEqual::MapStructEqual() -{ - // Just to register all known types - registerTypesTypes(); -} - -MapStructEqual::~MapStructEqual() -{ -} - -MapStructEqual::MapStructEqual( - const MapStructEqual& x) -{ - m_my_map_equal = x.m_my_map_equal; -} - -MapStructEqual::MapStructEqual( - MapStructEqual&& x) noexcept -{ - m_my_map_equal = std::move(x.m_my_map_equal); -} - -MapStructEqual& MapStructEqual::operator =( - const MapStructEqual& x) -{ - - m_my_map_equal = x.m_my_map_equal; - return *this; -} - -MapStructEqual& MapStructEqual::operator =( - MapStructEqual&& x) noexcept -{ - - m_my_map_equal = std::move(x.m_my_map_equal); - return *this; -} - -bool MapStructEqual::operator ==( - const MapStructEqual& x) const -{ - return (m_my_map_equal == x.m_my_map_equal); -} - -bool MapStructEqual::operator !=( - const MapStructEqual& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_map_equal - * @param _my_map_equal New value to be copied in member my_map_equal - */ -void MapStructEqual::my_map_equal( - const std::map& _my_map_equal) -{ - m_my_map_equal = _my_map_equal; -} - -/*! - * @brief This function moves the value in member my_map_equal - * @param _my_map_equal New value to be moved in member my_map_equal - */ -void MapStructEqual::my_map_equal( - std::map&& _my_map_equal) -{ - m_my_map_equal = std::move(_my_map_equal); -} - -/*! - * @brief This function returns a constant reference to member my_map_equal - * @return Constant reference to member my_map_equal - */ -const std::map& MapStructEqual::my_map_equal() const -{ - return m_my_map_equal; -} - -/*! - * @brief This function returns a reference to member my_map_equal - * @return Reference to member my_map_equal - */ -std::map& MapStructEqual::my_map_equal() -{ - return m_my_map_equal; -} - - - - - - -MapBadKeyStruct::MapBadKeyStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MapBadKeyStruct::~MapBadKeyStruct() -{ -} - -MapBadKeyStruct::MapBadKeyStruct( - const MapBadKeyStruct& x) -{ - m_my_map = x.m_my_map; -} - -MapBadKeyStruct::MapBadKeyStruct( - MapBadKeyStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); -} - -MapBadKeyStruct& MapBadKeyStruct::operator =( - const MapBadKeyStruct& x) -{ - - m_my_map = x.m_my_map; - return *this; -} - -MapBadKeyStruct& MapBadKeyStruct::operator =( - MapBadKeyStruct&& x) noexcept -{ - - m_my_map = std::move(x.m_my_map); - return *this; -} - -bool MapBadKeyStruct::operator ==( - const MapBadKeyStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapBadKeyStruct::operator !=( - const MapBadKeyStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapBadKeyStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapBadKeyStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapBadKeyStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapBadKeyStruct::my_map() -{ - return m_my_map; -} - - - - - - -MapBadElemStruct::MapBadElemStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MapBadElemStruct::~MapBadElemStruct() -{ -} - -MapBadElemStruct::MapBadElemStruct( - const MapBadElemStruct& x) -{ - m_my_map = x.m_my_map; -} - -MapBadElemStruct::MapBadElemStruct( - MapBadElemStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); -} - -MapBadElemStruct& MapBadElemStruct::operator =( - const MapBadElemStruct& x) -{ - - m_my_map = x.m_my_map; - return *this; -} - -MapBadElemStruct& MapBadElemStruct::operator =( - MapBadElemStruct&& x) noexcept -{ - - m_my_map = std::move(x.m_my_map); - return *this; -} - -bool MapBadElemStruct::operator ==( - const MapBadElemStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapBadElemStruct::operator !=( - const MapBadElemStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapBadElemStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapBadElemStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapBadElemStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapBadElemStruct::my_map() -{ - return m_my_map; -} - - - - - - -MapBoundsStruct::MapBoundsStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MapBoundsStruct::~MapBoundsStruct() -{ -} - -MapBoundsStruct::MapBoundsStruct( - const MapBoundsStruct& x) -{ - m_my_map = x.m_my_map; -} - -MapBoundsStruct::MapBoundsStruct( - MapBoundsStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); -} - -MapBoundsStruct& MapBoundsStruct::operator =( - const MapBoundsStruct& x) -{ - - m_my_map = x.m_my_map; - return *this; -} - -MapBoundsStruct& MapBoundsStruct::operator =( - MapBoundsStruct&& x) noexcept -{ - - m_my_map = std::move(x.m_my_map); - return *this; -} - -bool MapBoundsStruct::operator ==( - const MapBoundsStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapBoundsStruct::operator !=( - const MapBoundsStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapBoundsStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapBoundsStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapBoundsStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapBoundsStruct::my_map() -{ - return m_my_map; -} - - - - - - - - -MapMapStruct::MapMapStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MapMapStruct::~MapMapStruct() -{ -} - -MapMapStruct::MapMapStruct( - const MapMapStruct& x) -{ - m_my_map_map = x.m_my_map_map; -} - -MapMapStruct::MapMapStruct( - MapMapStruct&& x) noexcept -{ - m_my_map_map = std::move(x.m_my_map_map); -} - -MapMapStruct& MapMapStruct::operator =( - const MapMapStruct& x) -{ - - m_my_map_map = x.m_my_map_map; - return *this; -} - -MapMapStruct& MapMapStruct::operator =( - MapMapStruct&& x) noexcept -{ - - m_my_map_map = std::move(x.m_my_map_map); - return *this; -} - -bool MapMapStruct::operator ==( - const MapMapStruct& x) const -{ - return (m_my_map_map == x.m_my_map_map); -} - -bool MapMapStruct::operator !=( - const MapMapStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ -void MapMapStruct::my_map_map( - const std::map>& _my_map_map) -{ - m_my_map_map = _my_map_map; -} - -/*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ -void MapMapStruct::my_map_map( - std::map>&& _my_map_map) -{ - m_my_map_map = std::move(_my_map_map); -} - -/*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ -const std::map>& MapMapStruct::my_map_map() const -{ - return m_my_map_map; -} - -/*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ -std::map>& MapMapStruct::my_map_map() -{ - return m_my_map_map; -} - - - - - - - - -MapMapBoundsStruct::MapMapBoundsStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MapMapBoundsStruct::~MapMapBoundsStruct() -{ -} - -MapMapBoundsStruct::MapMapBoundsStruct( - const MapMapBoundsStruct& x) -{ - m_my_map_map = x.m_my_map_map; -} - -MapMapBoundsStruct::MapMapBoundsStruct( - MapMapBoundsStruct&& x) noexcept -{ - m_my_map_map = std::move(x.m_my_map_map); -} - -MapMapBoundsStruct& MapMapBoundsStruct::operator =( - const MapMapBoundsStruct& x) -{ - - m_my_map_map = x.m_my_map_map; - return *this; -} - -MapMapBoundsStruct& MapMapBoundsStruct::operator =( - MapMapBoundsStruct&& x) noexcept -{ - - m_my_map_map = std::move(x.m_my_map_map); - return *this; -} - -bool MapMapBoundsStruct::operator ==( - const MapMapBoundsStruct& x) const -{ - return (m_my_map_map == x.m_my_map_map); -} - -bool MapMapBoundsStruct::operator !=( - const MapMapBoundsStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ -void MapMapBoundsStruct::my_map_map( - const std::map>& _my_map_map) -{ - m_my_map_map = _my_map_map; -} - -/*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ -void MapMapBoundsStruct::my_map_map( - std::map>&& _my_map_map) -{ - m_my_map_map = std::move(_my_map_map); -} - -/*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ -const std::map>& MapMapBoundsStruct::my_map_map() const -{ - return m_my_map_map; -} - -/*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ -std::map>& MapMapBoundsStruct::my_map_map() -{ - return m_my_map_map; -} - - - - -SimpleUnion::SimpleUnion() -{ - m__d = A; -} - -SimpleUnion::~SimpleUnion() -{ -} - -SimpleUnion::SimpleUnion( - const SimpleUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleUnion::SimpleUnion( - SimpleUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleUnion& SimpleUnion::operator =( - const SimpleUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleUnion& SimpleUnion::operator =( - SimpleUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleUnion::operator ==( - const SimpleUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case B: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleUnion::operator !=( - const SimpleUnion& x) const -{ - return !(*this == x); -} - -void SimpleUnion::_d( - int32_t __d) -{ - bool b = false; - - switch (m__d) - { - case A: - switch (__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch (__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleUnion::_d() const -{ - return m__d; -} - -int32_t& SimpleUnion::_d() -{ - return m__d; -} - -void SimpleUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = A; - -} - -int32_t SimpleUnion::first() const -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& SimpleUnion::first() -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = B; - -} - -int64_t SimpleUnion::second() const -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleUnion::second() -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - - - -SimpleUnionNames::SimpleUnionNames() -{ - m__d = A; -} - -SimpleUnionNames::~SimpleUnionNames() -{ -} - -SimpleUnionNames::SimpleUnionNames( - const SimpleUnionNames& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } -} - -SimpleUnionNames::SimpleUnionNames( - SimpleUnionNames&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } -} - -SimpleUnionNames& SimpleUnionNames::operator =( - const SimpleUnionNames& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } - - return *this; -} - -SimpleUnionNames& SimpleUnionNames::operator =( - SimpleUnionNames&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } - - return *this; -} - -bool SimpleUnionNames::operator ==( - const SimpleUnionNames& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case A: - return (m_first_case == x.m_first_case); - break; - - - case B: - return (m_second_case == x.m_second_case); - break; - - default: - break; - } - return false; -} - -bool SimpleUnionNames::operator !=( - const SimpleUnionNames& x) const -{ - return !(*this == x); -} - -void SimpleUnionNames::_d( - int32_t __d) -{ - bool b = false; - - switch (m__d) - { - case A: - switch (__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch (__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleUnionNames::_d() const -{ - return m__d; -} - -int32_t& SimpleUnionNames::_d() -{ - return m__d; -} - -void SimpleUnionNames::first_case( - int32_t _first_case) -{ - m_first_case = _first_case; - m__d = A; - -} - -int32_t SimpleUnionNames::first_case() const -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first_case; -} - -int32_t& SimpleUnionNames::first_case() -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first_case; -} - - -void SimpleUnionNames::second_case( - int64_t _second_case) -{ - m_second_case = _second_case; - m__d = B; - -} - -int64_t SimpleUnionNames::second_case() const -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second_case; -} - -int64_t& SimpleUnionNames::second_case() -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second_case; -} - - - - -SimpleTypeUnion::SimpleTypeUnion() -{ - m__d = A; -} - -SimpleTypeUnion::~SimpleTypeUnion() -{ -} - -SimpleTypeUnion::SimpleTypeUnion( - const SimpleTypeUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleTypeUnion::SimpleTypeUnion( - SimpleTypeUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleTypeUnion& SimpleTypeUnion::operator =( - const SimpleTypeUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleTypeUnion& SimpleTypeUnion::operator =( - SimpleTypeUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleTypeUnion::operator ==( - const SimpleTypeUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case B: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleTypeUnion::operator !=( - const SimpleTypeUnion& x) const -{ - return !(*this == x); -} - -void SimpleTypeUnion::_d( - int32_t __d) -{ - bool b = false; - - switch (m__d) - { - case A: - switch (__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch (__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleTypeUnion::_d() const -{ - return m__d; -} - -int32_t& SimpleTypeUnion::_d() -{ - return m__d; -} - -void SimpleTypeUnion::first( - uint8_t _first) -{ - m_first = _first; - m__d = A; - -} - -uint8_t SimpleTypeUnion::first() const -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -uint8_t& SimpleTypeUnion::first() -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleTypeUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = B; - -} - -int64_t SimpleTypeUnion::second() const -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleTypeUnion::second() -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - - - -SimpleBadUnion::SimpleBadUnion() -{ - m__d = A; -} - -SimpleBadUnion::~SimpleBadUnion() -{ -} - -SimpleBadUnion::SimpleBadUnion( - const SimpleBadUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadUnion::SimpleBadUnion( - SimpleBadUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadUnion& SimpleBadUnion::operator =( - const SimpleBadUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleBadUnion& SimpleBadUnion::operator =( - SimpleBadUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleBadUnion::operator ==( - const SimpleBadUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case C: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleBadUnion::operator !=( - const SimpleBadUnion& x) const -{ - return !(*this == x); -} - -void SimpleBadUnion::_d( - int32_t __d) -{ - bool b = false; - - switch (m__d) - { - case A: - switch (__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case C: - switch (__d) - { - case C: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleBadUnion::_d() const -{ - return m__d; -} - -int32_t& SimpleBadUnion::_d() -{ - return m__d; -} - -void SimpleBadUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = A; - -} - -int32_t SimpleBadUnion::first() const -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& SimpleBadUnion::first() -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleBadUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = C; - -} - -int64_t SimpleBadUnion::second() const -{ - bool b = false; - - switch (m__d) - { - case C: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleBadUnion::second() -{ - bool b = false; - - switch (m__d) - { - case C: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - - - -SimpleBadDiscUnion::SimpleBadDiscUnion() -{ - m__d = 0; -} - -SimpleBadDiscUnion::~SimpleBadDiscUnion() -{ -} - -SimpleBadDiscUnion::SimpleBadDiscUnion( - const SimpleBadDiscUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadDiscUnion::SimpleBadDiscUnion( - SimpleBadDiscUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadDiscUnion& SimpleBadDiscUnion::operator =( - const SimpleBadDiscUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleBadDiscUnion& SimpleBadDiscUnion::operator =( - SimpleBadDiscUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleBadDiscUnion::operator ==( - const SimpleBadDiscUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case 0: - return (m_first == x.m_first); - break; - - - case 1: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleBadDiscUnion::operator !=( - const SimpleBadDiscUnion& x) const -{ - return !(*this == x); -} - -void SimpleBadDiscUnion::_d( - uint8_t __d) -{ - bool b = false; - - switch (m__d) - { - case 0: - switch (__d) - { - case 0: - b = true; - break; - default: - break; - } - break; - - - case 1: - switch (__d) - { - case 1: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -uint8_t SimpleBadDiscUnion::_d() const -{ - return m__d; -} - -uint8_t& SimpleBadDiscUnion::_d() -{ - return m__d; -} - -void SimpleBadDiscUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = 0; - -} - -int32_t SimpleBadDiscUnion::first() const -{ - bool b = false; - - switch (m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& SimpleBadDiscUnion::first() -{ - bool b = false; - - switch (m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleBadDiscUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = 1; - -} - -int64_t SimpleBadDiscUnion::second() const -{ - bool b = false; - - switch (m__d) - { - case 1: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleBadDiscUnion::second() -{ - bool b = false; - - switch (m__d) - { - case 1: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - - - -SimpleUnionStruct::SimpleUnionStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SimpleUnionStruct::~SimpleUnionStruct() -{ -} - -SimpleUnionStruct::SimpleUnionStruct( - const SimpleUnionStruct& x) -{ - m_my_union = x.m_my_union; -} - -SimpleUnionStruct::SimpleUnionStruct( - SimpleUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); -} - -SimpleUnionStruct& SimpleUnionStruct::operator =( - const SimpleUnionStruct& x) -{ - - m_my_union = x.m_my_union; - return *this; -} - -SimpleUnionStruct& SimpleUnionStruct::operator =( - SimpleUnionStruct&& x) noexcept -{ - - m_my_union = std::move(x.m_my_union); - return *this; -} - -bool SimpleUnionStruct::operator ==( - const SimpleUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleUnionStruct::operator !=( - const SimpleUnionStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleUnionStruct::my_union( - const SimpleUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleUnionStruct::my_union( - SimpleUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleUnion& SimpleUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleUnion& SimpleUnionStruct::my_union() -{ - return m_my_union; -} - - - - -SimpleUnionStructEqual::SimpleUnionStructEqual() -{ - // Just to register all known types - registerTypesTypes(); -} - -SimpleUnionStructEqual::~SimpleUnionStructEqual() -{ -} - -SimpleUnionStructEqual::SimpleUnionStructEqual( - const SimpleUnionStructEqual& x) -{ - m_my_union_equal = x.m_my_union_equal; -} - -SimpleUnionStructEqual::SimpleUnionStructEqual( - SimpleUnionStructEqual&& x) noexcept -{ - m_my_union_equal = std::move(x.m_my_union_equal); -} - -SimpleUnionStructEqual& SimpleUnionStructEqual::operator =( - const SimpleUnionStructEqual& x) -{ - - m_my_union_equal = x.m_my_union_equal; - return *this; -} - -SimpleUnionStructEqual& SimpleUnionStructEqual::operator =( - SimpleUnionStructEqual&& x) noexcept -{ - - m_my_union_equal = std::move(x.m_my_union_equal); - return *this; -} - -bool SimpleUnionStructEqual::operator ==( - const SimpleUnionStructEqual& x) const -{ - return (m_my_union_equal == x.m_my_union_equal); -} - -bool SimpleUnionStructEqual::operator !=( - const SimpleUnionStructEqual& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_union_equal - * @param _my_union_equal New value to be copied in member my_union_equal - */ -void SimpleUnionStructEqual::my_union_equal( - const SimpleUnion& _my_union_equal) -{ - m_my_union_equal = _my_union_equal; -} - -/*! - * @brief This function moves the value in member my_union_equal - * @param _my_union_equal New value to be moved in member my_union_equal - */ -void SimpleUnionStructEqual::my_union_equal( - SimpleUnion&& _my_union_equal) -{ - m_my_union_equal = std::move(_my_union_equal); -} - -/*! - * @brief This function returns a constant reference to member my_union_equal - * @return Constant reference to member my_union_equal - */ -const SimpleUnion& SimpleUnionStructEqual::my_union_equal() const -{ - return m_my_union_equal; -} - -/*! - * @brief This function returns a reference to member my_union_equal - * @return Reference to member my_union_equal - */ -SimpleUnion& SimpleUnionStructEqual::my_union_equal() -{ - return m_my_union_equal; -} - - - - -SimpleUnionNamesStruct::SimpleUnionNamesStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SimpleUnionNamesStruct::~SimpleUnionNamesStruct() -{ -} - -SimpleUnionNamesStruct::SimpleUnionNamesStruct( - const SimpleUnionNamesStruct& x) -{ - m_my_union = x.m_my_union; -} - -SimpleUnionNamesStruct::SimpleUnionNamesStruct( - SimpleUnionNamesStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); -} - -SimpleUnionNamesStruct& SimpleUnionNamesStruct::operator =( - const SimpleUnionNamesStruct& x) -{ - - m_my_union = x.m_my_union; - return *this; -} - -SimpleUnionNamesStruct& SimpleUnionNamesStruct::operator =( - SimpleUnionNamesStruct&& x) noexcept -{ - - m_my_union = std::move(x.m_my_union); - return *this; -} - -bool SimpleUnionNamesStruct::operator ==( - const SimpleUnionNamesStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleUnionNamesStruct::operator !=( - const SimpleUnionNamesStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleUnionNamesStruct::my_union( - const SimpleUnionNames& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleUnionNamesStruct::my_union( - SimpleUnionNames&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleUnionNames& SimpleUnionNamesStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleUnionNames& SimpleUnionNamesStruct::my_union() -{ - return m_my_union; -} - - - - -SimpleTypeUnionStruct::SimpleTypeUnionStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SimpleTypeUnionStruct::~SimpleTypeUnionStruct() -{ -} - -SimpleTypeUnionStruct::SimpleTypeUnionStruct( - const SimpleTypeUnionStruct& x) -{ - m_my_union = x.m_my_union; -} - -SimpleTypeUnionStruct::SimpleTypeUnionStruct( - SimpleTypeUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); -} - -SimpleTypeUnionStruct& SimpleTypeUnionStruct::operator =( - const SimpleTypeUnionStruct& x) -{ - - m_my_union = x.m_my_union; - return *this; -} - -SimpleTypeUnionStruct& SimpleTypeUnionStruct::operator =( - SimpleTypeUnionStruct&& x) noexcept -{ - - m_my_union = std::move(x.m_my_union); - return *this; -} - -bool SimpleTypeUnionStruct::operator ==( - const SimpleTypeUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleTypeUnionStruct::operator !=( - const SimpleTypeUnionStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleTypeUnionStruct::my_union( - const SimpleTypeUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleTypeUnionStruct::my_union( - SimpleTypeUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleTypeUnion& SimpleTypeUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleTypeUnion& SimpleTypeUnionStruct::my_union() -{ - return m_my_union; -} - - - - -SimpleBadUnionStruct::SimpleBadUnionStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SimpleBadUnionStruct::~SimpleBadUnionStruct() -{ -} - -SimpleBadUnionStruct::SimpleBadUnionStruct( - const SimpleBadUnionStruct& x) -{ - m_my_union = x.m_my_union; -} - -SimpleBadUnionStruct::SimpleBadUnionStruct( - SimpleBadUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); -} - -SimpleBadUnionStruct& SimpleBadUnionStruct::operator =( - const SimpleBadUnionStruct& x) -{ - - m_my_union = x.m_my_union; - return *this; -} - -SimpleBadUnionStruct& SimpleBadUnionStruct::operator =( - SimpleBadUnionStruct&& x) noexcept -{ - - m_my_union = std::move(x.m_my_union); - return *this; -} - -bool SimpleBadUnionStruct::operator ==( - const SimpleBadUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleBadUnionStruct::operator !=( - const SimpleBadUnionStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleBadUnionStruct::my_union( - const SimpleBadUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleBadUnionStruct::my_union( - SimpleBadUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleBadUnion& SimpleBadUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleBadUnion& SimpleBadUnionStruct::my_union() -{ - return m_my_union; -} - - - - -SimplBadDiscUnionStruct::SimplBadDiscUnionStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SimplBadDiscUnionStruct::~SimplBadDiscUnionStruct() -{ -} - -SimplBadDiscUnionStruct::SimplBadDiscUnionStruct( - const SimplBadDiscUnionStruct& x) -{ - m_my_union = x.m_my_union; -} - -SimplBadDiscUnionStruct::SimplBadDiscUnionStruct( - SimplBadDiscUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); -} - -SimplBadDiscUnionStruct& SimplBadDiscUnionStruct::operator =( - const SimplBadDiscUnionStruct& x) -{ - - m_my_union = x.m_my_union; - return *this; -} - -SimplBadDiscUnionStruct& SimplBadDiscUnionStruct::operator =( - SimplBadDiscUnionStruct&& x) noexcept -{ - - m_my_union = std::move(x.m_my_union); - return *this; -} - -bool SimplBadDiscUnionStruct::operator ==( - const SimplBadDiscUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimplBadDiscUnionStruct::operator !=( - const SimplBadDiscUnionStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimplBadDiscUnionStruct::my_union( - const SimpleBadDiscUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimplBadDiscUnionStruct::my_union( - SimpleBadDiscUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleBadDiscUnion& SimplBadDiscUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleBadDiscUnion& SimplBadDiscUnionStruct::my_union() -{ - return m_my_union; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "TypesCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/unittest/xtypes/idl/Types.h b/test/unittest/xtypes/idl/Types.h deleted file mode 100644 index e482676e515..00000000000 --- a/test/unittest/xtypes/idl/Types.h +++ /dev/null @@ -1,4432 +0,0 @@ -// 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 Types.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "Typesv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_TYPES_H_ -#define _FAST_DDS_GENERATED_TYPES_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TYPES_SOURCE) -#define TYPES_DllAPI __declspec( dllexport ) -#else -#define TYPES_DllAPI __declspec( dllimport ) -#endif // TYPES_SOURCE -#else -#define TYPES_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TYPES_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - -/*! - * @brief This class represents the enumeration MyEnum defined by the user in the IDL file. - * @ingroup Types - */ -enum MyEnum : uint32_t -{ - A, - B, - C -}; -/*! - * @brief This class represents the enumeration MyBadEnum defined by the user in the IDL file. - * @ingroup Types - */ -enum MyBadEnum : uint32_t -{ - A1, - B1, - C1 -}; - - -/*! - * @brief This class represents the structure MyEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyEnumStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyEnumStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyEnumStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct( - const MyEnumStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct( - MyEnumStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct& operator =( - const MyEnumStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct& operator =( - MyEnumStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyEnumStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MyEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyEnumStruct& x) const; - - /*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ - eProsima_user_DllExport void my_enum( - MyEnum _my_enum); - - /*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ - eProsima_user_DllExport MyEnum my_enum() const; - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyEnum& my_enum(); - -private: - - MyEnum m_my_enum{::A}; - -}; - - -/*! - * @brief This class represents the structure MyBadEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyBadEnumStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyBadEnumStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyBadEnumStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct( - const MyBadEnumStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct( - MyBadEnumStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct& operator =( - const MyBadEnumStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct& operator =( - MyBadEnumStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyBadEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyBadEnumStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MyBadEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyBadEnumStruct& x) const; - - /*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ - eProsima_user_DllExport void my_enum( - MyBadEnum _my_enum); - - /*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ - eProsima_user_DllExport MyBadEnum my_enum() const; - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyBadEnum& my_enum(); - -private: - - MyBadEnum m_my_enum{::A1}; - -}; -typedef MyEnum MyAliasEnum; - - - -/*! - * @brief This class represents the structure MyAliasEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyAliasEnumStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyAliasEnumStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyAliasEnumStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct( - const MyAliasEnumStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct( - MyAliasEnumStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct& operator =( - const MyAliasEnumStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct& operator =( - MyAliasEnumStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyAliasEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyAliasEnumStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MyAliasEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyAliasEnumStruct& x) const; - - /*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ - eProsima_user_DllExport void my_enum( - MyAliasEnum _my_enum); - - /*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ - eProsima_user_DllExport MyAliasEnum my_enum() const; - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyAliasEnum& my_enum(); - -private: - - MyAliasEnum m_my_enum{::A}; - -}; - - -/*! - * @brief This class represents the structure BasicStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct( - const BasicStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct( - BasicStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct& operator =( - const BasicStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct& operator =( - BasicStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - bool _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport bool my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - -private: - - bool m_my_bool{false}; - int32_t m_my_int32{0}; - std::string m_my_string; - -}; - - -/*! - * @brief This class represents the structure BasicNamesStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicNamesStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicNamesStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicNamesStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct( - const BasicNamesStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct( - BasicNamesStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct& operator =( - const BasicNamesStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct& operator =( - BasicNamesStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicNamesStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicNamesStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool_name - * @param _my_bool_name New value for member my_bool_name - */ - eProsima_user_DllExport void my_bool_name( - bool _my_bool_name); - - /*! - * @brief This function returns the value of member my_bool_name - * @return Value of member my_bool_name - */ - eProsima_user_DllExport bool my_bool_name() const; - - /*! - * @brief This function returns a reference to member my_bool_name - * @return Reference to member my_bool_name - */ - eProsima_user_DllExport bool& my_bool_name(); - - - /*! - * @brief This function sets a value in member my_int32_name - * @param _my_int32_name New value for member my_int32_name - */ - eProsima_user_DllExport void my_int32_name( - int32_t _my_int32_name); - - /*! - * @brief This function returns the value of member my_int32_name - * @return Value of member my_int32_name - */ - eProsima_user_DllExport int32_t my_int32_name() const; - - /*! - * @brief This function returns a reference to member my_int32_name - * @return Reference to member my_int32_name - */ - eProsima_user_DllExport int32_t& my_int32_name(); - - - /*! - * @brief This function copies the value in member my_string_name - * @param _my_string_name New value to be copied in member my_string_name - */ - eProsima_user_DllExport void my_string_name( - const std::string& _my_string_name); - - /*! - * @brief This function moves the value in member my_string_name - * @param _my_string_name New value to be moved in member my_string_name - */ - eProsima_user_DllExport void my_string_name( - std::string&& _my_string_name); - - /*! - * @brief This function returns a constant reference to member my_string_name - * @return Constant reference to member my_string_name - */ - eProsima_user_DllExport const std::string& my_string_name() const; - - /*! - * @brief This function returns a reference to member my_string_name - * @return Reference to member my_string_name - */ - eProsima_user_DllExport std::string& my_string_name(); - -private: - - bool m_my_bool_name{false}; - int32_t m_my_int32_name{0}; - std::string m_my_string_name; - -}; - - -/*! - * @brief This class represents the structure BasicBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicBadStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicBadStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicBadStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct( - const BasicBadStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct( - BasicBadStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct& operator =( - const BasicBadStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct& operator =( - BasicBadStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicBadStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicBadStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicBadStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicBadStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - uint8_t _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport uint8_t my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport uint8_t& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - -private: - - uint8_t m_my_bool{0}; - int32_t m_my_int32{0}; - std::string m_my_string; - -}; - - -/*! - * @brief This class represents the structure BasicWideStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicWideStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicWideStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicWideStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct( - const BasicWideStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct( - BasicWideStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct& operator =( - const BasicWideStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct& operator =( - BasicWideStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicWideStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicWideStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - bool _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport bool my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - - - /*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ - eProsima_user_DllExport void new_int32( - int32_t _new_int32); - - /*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ - eProsima_user_DllExport int32_t new_int32() const; - - /*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ - eProsima_user_DllExport int32_t& new_int32(); - - - /*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ - eProsima_user_DllExport void new_string( - const std::string& _new_string); - - /*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ - eProsima_user_DllExport void new_string( - std::string&& _new_string); - - /*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ - eProsima_user_DllExport const std::string& new_string() const; - - /*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ - eProsima_user_DllExport std::string& new_string(); - -private: - - bool m_my_bool{false}; - int32_t m_my_int32{0}; - std::string m_my_string; - int32_t m_new_int32{0}; - std::string m_new_string; - -}; - - -/*! - * @brief This class represents the structure BadBasicWideStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BadBasicWideStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BadBasicWideStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BadBasicWideStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct( - const BadBasicWideStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct( - BadBasicWideStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct& operator =( - const BadBasicWideStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct& operator =( - BadBasicWideStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BadBasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BadBasicWideStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BadBasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BadBasicWideStruct& x) const; - - /*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ - eProsima_user_DllExport void new_int32( - int32_t _new_int32); - - /*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ - eProsima_user_DllExport int32_t new_int32() const; - - /*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ - eProsima_user_DllExport int32_t& new_int32(); - - - /*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ - eProsima_user_DllExport void new_string( - const std::string& _new_string); - - /*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ - eProsima_user_DllExport void new_string( - std::string&& _new_string); - - /*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ - eProsima_user_DllExport const std::string& new_string() const; - - /*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ - eProsima_user_DllExport std::string& new_string(); - - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - bool _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport bool my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - -private: - - int32_t m_new_int32{0}; - std::string m_new_string; - bool m_my_bool{false}; - int32_t m_my_int32{0}; - std::string m_my_string; - -}; - - -/*! - * @brief This class represents the structure StringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class StringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport StringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~StringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct( - const StringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct( - StringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct& operator =( - const StringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct& operator =( - StringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x StringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const StringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x StringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const StringStruct& x) const; - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - -private: - - std::string m_my_string; - -}; - - -/*! - * @brief This class represents the structure LargeStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class LargeStringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LargeStringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LargeStringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct( - const LargeStringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct( - LargeStringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct& operator =( - const LargeStringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct& operator =( - LargeStringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LargeStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LargeStringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x LargeStringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LargeStringStruct& x) const; - - /*! - * @brief This function copies the value in member my_large_string - * @param _my_large_string New value to be copied in member my_large_string - */ - eProsima_user_DllExport void my_large_string( - const eprosima::fastcdr::fixed_string<41925>& _my_large_string); - - /*! - * @brief This function moves the value in member my_large_string - * @param _my_large_string New value to be moved in member my_large_string - */ - eProsima_user_DllExport void my_large_string( - eprosima::fastcdr::fixed_string<41925>&& _my_large_string); - - /*! - * @brief This function returns a constant reference to member my_large_string - * @return Constant reference to member my_large_string - */ - eProsima_user_DllExport const eprosima::fastcdr::fixed_string<41925>& my_large_string() const; - - /*! - * @brief This function returns a reference to member my_large_string - * @return Reference to member my_large_string - */ - eProsima_user_DllExport eprosima::fastcdr::fixed_string<41925>& my_large_string(); - -private: - - eprosima::fastcdr::fixed_string<41925> m_my_large_string; - -}; - - -/*! - * @brief This class represents the structure WStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class WStringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport WStringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~WStringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct( - const WStringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct( - WStringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct& operator =( - const WStringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct& operator =( - WStringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x WStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const WStringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x WStringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const WStringStruct& x) const; - - /*! - * @brief This function copies the value in member my_wstring - * @param _my_wstring New value to be copied in member my_wstring - */ - eProsima_user_DllExport void my_wstring( - const std::wstring& _my_wstring); - - /*! - * @brief This function moves the value in member my_wstring - * @param _my_wstring New value to be moved in member my_wstring - */ - eProsima_user_DllExport void my_wstring( - std::wstring&& _my_wstring); - - /*! - * @brief This function returns a constant reference to member my_wstring - * @return Constant reference to member my_wstring - */ - eProsima_user_DllExport const std::wstring& my_wstring() const; - - /*! - * @brief This function returns a reference to member my_wstring - * @return Reference to member my_wstring - */ - eProsima_user_DllExport std::wstring& my_wstring(); - -private: - - std::wstring m_my_wstring; - -}; - - -/*! - * @brief This class represents the structure LargeWStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class LargeWStringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LargeWStringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LargeWStringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct( - const LargeWStringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct( - LargeWStringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct& operator =( - const LargeWStringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct& operator =( - LargeWStringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LargeWStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LargeWStringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x LargeWStringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LargeWStringStruct& x) const; - - /*! - * @brief This function copies the value in member my_large_wstring - * @param _my_large_wstring New value to be copied in member my_large_wstring - */ - eProsima_user_DllExport void my_large_wstring( - const std::wstring& _my_large_wstring); - - /*! - * @brief This function moves the value in member my_large_wstring - * @param _my_large_wstring New value to be moved in member my_large_wstring - */ - eProsima_user_DllExport void my_large_wstring( - std::wstring&& _my_large_wstring); - - /*! - * @brief This function returns a constant reference to member my_large_wstring - * @return Constant reference to member my_large_wstring - */ - eProsima_user_DllExport const std::wstring& my_large_wstring() const; - - /*! - * @brief This function returns a reference to member my_large_wstring - * @return Reference to member my_large_wstring - */ - eProsima_user_DllExport std::wstring& my_large_wstring(); - -private: - - std::wstring m_my_large_wstring; - -}; - - -/*! - * @brief This class represents the structure ArrayStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct( - const ArrayStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct( - ArrayStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct& operator =( - const ArrayStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct& operator =( - ArrayStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array& my_array(); - -private: - - std::array m_my_array{0}; - -}; - - -/*! - * @brief This class represents the structure ArrayStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual( - const ArrayStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual( - ArrayStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual& operator =( - const ArrayStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual& operator =( - ArrayStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_array_equal - * @param _my_array_equal New value to be copied in member my_array_equal - */ - eProsima_user_DllExport void my_array_equal( - const std::array& _my_array_equal); - - /*! - * @brief This function moves the value in member my_array_equal - * @param _my_array_equal New value to be moved in member my_array_equal - */ - eProsima_user_DllExport void my_array_equal( - std::array&& _my_array_equal); - - /*! - * @brief This function returns a constant reference to member my_array_equal - * @return Constant reference to member my_array_equal - */ - eProsima_user_DllExport const std::array& my_array_equal() const; - - /*! - * @brief This function returns a reference to member my_array_equal - * @return Reference to member my_array_equal - */ - eProsima_user_DllExport std::array& my_array_equal(); - -private: - - std::array m_my_array_equal{0}; - -}; - - -/*! - * @brief This class represents the structure ArrayBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayBadStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayBadStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayBadStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct( - const ArrayBadStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct( - ArrayBadStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct& operator =( - const ArrayBadStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct& operator =( - ArrayBadStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayBadStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayBadStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayBadStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayBadStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array& my_array(); - -private: - - std::array m_my_array{0}; - -}; - - -/*! - * @brief This class represents the structure ArrayDimensionsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayDimensionsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayDimensionsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayDimensionsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct( - const ArrayDimensionsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct( - ArrayDimensionsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct& operator =( - const ArrayDimensionsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct& operator =( - ArrayDimensionsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayDimensionsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayDimensionsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayDimensionsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayDimensionsStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array, 2>& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array, 2>&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array, 2>& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array, 2>& my_array(); - -private: - - std::array, 2> m_my_array{ {{0}} }; - -}; - - -/*! - * @brief This class represents the structure ArraySizeStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArraySizeStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArraySizeStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArraySizeStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct( - const ArraySizeStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct( - ArraySizeStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct& operator =( - const ArraySizeStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct& operator =( - ArraySizeStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArraySizeStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArraySizeStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArraySizeStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArraySizeStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array& my_array(); - -private: - - std::array m_my_array{0}; - -}; - - - - -/*! - * @brief This class represents the structure SequenceStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct( - const SequenceStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct( - SequenceStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct& operator =( - const SequenceStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct& operator =( - SequenceStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - const std::vector& _my_sequence); - - /*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - std::vector&& _my_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ - eProsima_user_DllExport const std::vector& my_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ - eProsima_user_DllExport std::vector& my_sequence(); - -private: - - std::vector m_my_sequence; - -}; - - - - -/*! - * @brief This class represents the structure SequenceStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual( - const SequenceStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual( - SequenceStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual& operator =( - const SequenceStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual& operator =( - SequenceStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_sequence_equal - * @param _my_sequence_equal New value to be copied in member my_sequence_equal - */ - eProsima_user_DllExport void my_sequence_equal( - const std::vector& _my_sequence_equal); - - /*! - * @brief This function moves the value in member my_sequence_equal - * @param _my_sequence_equal New value to be moved in member my_sequence_equal - */ - eProsima_user_DllExport void my_sequence_equal( - std::vector&& _my_sequence_equal); - - /*! - * @brief This function returns a constant reference to member my_sequence_equal - * @return Constant reference to member my_sequence_equal - */ - eProsima_user_DllExport const std::vector& my_sequence_equal() const; - - /*! - * @brief This function returns a reference to member my_sequence_equal - * @return Reference to member my_sequence_equal - */ - eProsima_user_DllExport std::vector& my_sequence_equal(); - -private: - - std::vector m_my_sequence_equal; - -}; - - - - -/*! - * @brief This class represents the structure SequenceBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceBadStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceBadStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceBadStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct( - const SequenceBadStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct( - SequenceBadStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct& operator =( - const SequenceBadStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct& operator =( - SequenceBadStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceBadStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceBadStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceBadStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceBadStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - const std::vector& _my_sequence); - - /*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - std::vector&& _my_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ - eProsima_user_DllExport const std::vector& my_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ - eProsima_user_DllExport std::vector& my_sequence(); - -private: - - std::vector m_my_sequence; - -}; - - - - -/*! - * @brief This class represents the structure SequenceBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct( - const SequenceBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct( - SequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct& operator =( - const SequenceBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct& operator =( - SequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - const std::vector& _my_sequence); - - /*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - std::vector&& _my_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ - eProsima_user_DllExport const std::vector& my_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ - eProsima_user_DllExport std::vector& my_sequence(); - -private: - - std::vector m_my_sequence; - -}; - - - - - - -/*! - * @brief This class represents the structure SequenceSequenceStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceSequenceStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceSequenceStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceSequenceStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct( - const SequenceSequenceStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct( - SequenceSequenceStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct& operator =( - const SequenceSequenceStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct& operator =( - SequenceSequenceStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceSequenceStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceSequenceStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - const std::vector>& _my_sequence_sequence); - - /*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - std::vector>&& _my_sequence_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ - eProsima_user_DllExport const std::vector>& my_sequence_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ - eProsima_user_DllExport std::vector>& my_sequence_sequence(); - -private: - - std::vector> m_my_sequence_sequence; - -}; - - - - - - -/*! - * @brief This class represents the structure SequenceSequenceBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceSequenceBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceSequenceBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct( - const SequenceSequenceBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct( - SequenceSequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct& operator =( - const SequenceSequenceBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct& operator =( - SequenceSequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceSequenceBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceSequenceBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - const std::vector>& _my_sequence_sequence); - - /*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - std::vector>&& _my_sequence_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ - eProsima_user_DllExport const std::vector>& my_sequence_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ - eProsima_user_DllExport std::vector>& my_sequence_sequence(); - -private: - - std::vector> m_my_sequence_sequence; - -}; - - - - -/*! - * @brief This class represents the structure MapStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct( - const MapStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct( - MapStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct& operator =( - const MapStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct& operator =( - MapStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - -private: - - std::map m_my_map; - -}; - - - - -/*! - * @brief This class represents the structure MapStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class MapStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual( - const MapStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual( - MapStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual& operator =( - const MapStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual& operator =( - MapStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x MapStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_map_equal - * @param _my_map_equal New value to be copied in member my_map_equal - */ - eProsima_user_DllExport void my_map_equal( - const std::map& _my_map_equal); - - /*! - * @brief This function moves the value in member my_map_equal - * @param _my_map_equal New value to be moved in member my_map_equal - */ - eProsima_user_DllExport void my_map_equal( - std::map&& _my_map_equal); - - /*! - * @brief This function returns a constant reference to member my_map_equal - * @return Constant reference to member my_map_equal - */ - eProsima_user_DllExport const std::map& my_map_equal() const; - - /*! - * @brief This function returns a reference to member my_map_equal - * @return Reference to member my_map_equal - */ - eProsima_user_DllExport std::map& my_map_equal(); - -private: - - std::map m_my_map_equal; - -}; - - - - -/*! - * @brief This class represents the structure MapBadKeyStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBadKeyStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapBadKeyStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapBadKeyStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct( - const MapBadKeyStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct( - MapBadKeyStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct& operator =( - const MapBadKeyStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct& operator =( - MapBadKeyStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapBadKeyStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapBadKeyStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapBadKeyStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapBadKeyStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - -private: - - std::map m_my_map; - -}; - - - - -/*! - * @brief This class represents the structure MapBadElemStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBadElemStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapBadElemStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapBadElemStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct( - const MapBadElemStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct( - MapBadElemStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct& operator =( - const MapBadElemStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct& operator =( - MapBadElemStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapBadElemStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapBadElemStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapBadElemStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapBadElemStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - -private: - - std::map m_my_map; - -}; - - - - -/*! - * @brief This class represents the structure MapBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct( - const MapBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct( - MapBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct& operator =( - const MapBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct& operator =( - MapBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - -private: - - std::map m_my_map; - -}; - - - - - - -/*! - * @brief This class represents the structure MapMapStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapMapStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapMapStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapMapStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct( - const MapMapStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct( - MapMapStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct& operator =( - const MapMapStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct& operator =( - MapMapStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapMapStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapMapStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapMapStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapMapStruct& x) const; - - /*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - const std::map>& _my_map_map); - - /*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - std::map>&& _my_map_map); - - /*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ - eProsima_user_DllExport const std::map>& my_map_map() const; - - /*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ - eProsima_user_DllExport std::map>& my_map_map(); - -private: - - std::map> m_my_map_map; - -}; - - - - - - -/*! - * @brief This class represents the structure MapMapBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapMapBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapMapBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapMapBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct( - const MapMapBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct( - MapMapBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct& operator =( - const MapMapBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct& operator =( - MapMapBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapMapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapMapBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapMapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapMapBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - const std::map>& _my_map_map); - - /*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - std::map>&& _my_map_map); - - /*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ - eProsima_user_DllExport const std::map>& my_map_map() const; - - /*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ - eProsima_user_DllExport std::map>& my_map_map(); - -private: - - std::map> m_my_map_map; - -}; - - -/*! - * @brief This class represents the union SimpleUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion( - const SimpleUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion( - SimpleUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion& operator =( - const SimpleUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion& operator =( - SimpleUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - -private: - - int32_t m__d; - - int32_t m_first{0}; - int64_t m_second{0}; -}; - - -/*! - * @brief This class represents the union SimpleUnionNames defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionNames -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionNames(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionNames(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames( - const SimpleUnionNames& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames( - SimpleUnionNames&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames& operator =( - const SimpleUnionNames& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames& operator =( - SimpleUnionNames&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNames object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionNames& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNames object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionNames& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first_case - * @param _first_case New value for member first_case - */ - eProsima_user_DllExport void first_case( - int32_t _first_case); - - /*! - * @brief This function returns the value of member first_case - * @return Value of member first_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first_case() const; - - /*! - * @brief This function returns a reference to member first_case - * @return Reference to member first_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first_case(); - - - /*! - * @brief This function sets a value in member second_case - * @param _second_case New value for member second_case - */ - eProsima_user_DllExport void second_case( - int64_t _second_case); - - /*! - * @brief This function returns the value of member second_case - * @return Value of member second_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second_case() const; - - /*! - * @brief This function returns a reference to member second_case - * @return Reference to member second_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second_case(); - -private: - - int32_t m__d; - - int32_t m_first_case{0}; - int64_t m_second_case{0}; -}; - - -/*! - * @brief This class represents the union SimpleTypeUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleTypeUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleTypeUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleTypeUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion( - const SimpleTypeUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion( - SimpleTypeUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion& operator =( - const SimpleTypeUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion& operator =( - SimpleTypeUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleTypeUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleTypeUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - uint8_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - -private: - - int32_t m__d; - - uint8_t m_first{0}; - int64_t m_second{0}; -}; - - -/*! - * @brief This class represents the union SimpleBadUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleBadUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleBadUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleBadUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion( - const SimpleBadUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion( - SimpleBadUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion& operator =( - const SimpleBadUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion& operator =( - SimpleBadUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleBadUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleBadUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - -private: - - int32_t m__d; - - int32_t m_first{0}; - int64_t m_second{0}; -}; - - -/*! - * @brief This class represents the union SimpleBadDiscUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleBadDiscUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleBadDiscUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleBadDiscUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion( - const SimpleBadDiscUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion( - SimpleBadDiscUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion& operator =( - const SimpleBadDiscUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion& operator =( - SimpleBadDiscUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleBadDiscUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleBadDiscUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleBadDiscUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleBadDiscUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - uint8_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport uint8_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport uint8_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - -private: - - uint8_t m__d; - - int32_t m_first{0}; - int64_t m_second{0}; -}; - - -/*! - * @brief This class represents the structure SimpleUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct( - const SimpleUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct( - SimpleUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct& operator =( - const SimpleUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct& operator =( - SimpleUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleUnion& my_union(); - -private: - - SimpleUnion m_my_union; - -}; - - -/*! - * @brief This class represents the structure SimpleUnionStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual( - const SimpleUnionStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual( - SimpleUnionStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual& operator =( - const SimpleUnionStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual& operator =( - SimpleUnionStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_union_equal - * @param _my_union_equal New value to be copied in member my_union_equal - */ - eProsima_user_DllExport void my_union_equal( - const SimpleUnion& _my_union_equal); - - /*! - * @brief This function moves the value in member my_union_equal - * @param _my_union_equal New value to be moved in member my_union_equal - */ - eProsima_user_DllExport void my_union_equal( - SimpleUnion&& _my_union_equal); - - /*! - * @brief This function returns a constant reference to member my_union_equal - * @return Constant reference to member my_union_equal - */ - eProsima_user_DllExport const SimpleUnion& my_union_equal() const; - - /*! - * @brief This function returns a reference to member my_union_equal - * @return Reference to member my_union_equal - */ - eProsima_user_DllExport SimpleUnion& my_union_equal(); - -private: - - SimpleUnion m_my_union_equal; - -}; - - -/*! - * @brief This class represents the structure SimpleUnionNamesStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionNamesStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionNamesStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionNamesStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct( - const SimpleUnionNamesStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct( - SimpleUnionNamesStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct& operator =( - const SimpleUnionNamesStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct& operator =( - SimpleUnionNamesStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionNamesStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionNamesStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleUnionNames& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleUnionNames&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleUnionNames& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleUnionNames& my_union(); - -private: - - SimpleUnionNames m_my_union; - -}; - - -/*! - * @brief This class represents the structure SimpleTypeUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleTypeUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleTypeUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleTypeUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct( - const SimpleTypeUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct( - SimpleTypeUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct& operator =( - const SimpleTypeUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct& operator =( - SimpleTypeUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleTypeUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleTypeUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleTypeUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleTypeUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleTypeUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleTypeUnion& my_union(); - -private: - - SimpleTypeUnion m_my_union; - -}; - - -/*! - * @brief This class represents the structure SimpleBadUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleBadUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleBadUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleBadUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct( - const SimpleBadUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct( - SimpleBadUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct& operator =( - const SimpleBadUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct& operator =( - SimpleBadUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleBadUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleBadUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleBadUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleBadUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleBadUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleBadUnion& my_union(); - -private: - - SimpleBadUnion m_my_union; - -}; - - -/*! - * @brief This class represents the structure SimplBadDiscUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimplBadDiscUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimplBadDiscUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct( - const SimplBadDiscUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct( - SimplBadDiscUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct& operator =( - const SimplBadDiscUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct& operator =( - SimplBadDiscUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimplBadDiscUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimplBadDiscUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimplBadDiscUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimplBadDiscUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleBadDiscUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleBadDiscUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleBadDiscUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleBadDiscUnion& my_union(); - -private: - - SimpleBadDiscUnion m_my_union; - -}; - -#endif // _FAST_DDS_GENERATED_TYPES_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/unittest/xtypes/idl/Types.idl b/test/unittest/xtypes/idl/Types.idl deleted file mode 100644 index fea3438ed82..00000000000 --- a/test/unittest/xtypes/idl/Types.idl +++ /dev/null @@ -1,271 +0,0 @@ -// Enum - -enum MyEnum -{ - A, - B, - C -}; - -enum MyBadEnum -{ - A1, - B1, - C1 -}; - -struct MyEnumStruct -{ - MyEnum my_enum; -}; - -struct MyBadEnumStruct -{ - MyBadEnum my_enum; -}; - -// Alias - -typedef MyEnum MyAliasEnum; - -struct MyAliasEnumStruct -{ - MyAliasEnum my_enum; // Keep same name -}; - -// All basic types - -struct BasicStruct -{ - boolean my_bool; - long my_int32; - string my_string; -}; - -struct BasicNamesStruct -{ - boolean my_bool_name; - long my_int32_name; - string my_string_name; -}; - -struct BasicBadStruct -{ - octet my_bool; - long my_int32; - string my_string; -}; - -// Wide Struct - -struct BasicWideStruct -{ - boolean my_bool; - long my_int32; - string my_string; - long new_int32; - string new_string; -}; - -// Bad Wide Struct - -struct BadBasicWideStruct -{ - long new_int32; - string new_string; - boolean my_bool; - long my_int32; - string my_string; -}; - -// String bounds - -struct StringStruct -{ - string my_string; -}; - -struct LargeStringStruct -{ - string<41925> my_large_string; -}; - -// WString bounds - -struct WStringStruct -{ - wstring my_wstring; -}; - -struct LargeWStringStruct -{ - wstring<41925> my_large_wstring; -}; - -// Array dimensions and size - -struct ArrayStruct -{ - long my_array[2]; -}; - -struct ArrayStructEqual -{ - long my_array_equal[2]; -}; - -struct ArrayBadStruct -{ - octet my_array[2]; -}; - -struct ArrayDimensionsStruct -{ - long my_array[2][2]; -}; - -struct ArraySizeStruct -{ - long my_array[5]; -}; - -// Sequence bounds - -struct SequenceStruct -{ - sequence my_sequence; -}; - -struct SequenceStructEqual -{ - sequence my_sequence_equal; -}; - -struct SequenceBadStruct -{ - sequence my_sequence; -}; - -struct SequenceBoundsStruct -{ - sequence my_sequence; -}; - -struct SequenceSequenceStruct -{ - sequence, 3> my_sequence_sequence; -}; - -struct SequenceSequenceBoundsStruct -{ - sequence, 5> my_sequence_sequence; -}; - -// Map bounds - -struct MapStruct -{ - map my_map; -}; - -struct MapStructEqual -{ - map my_map_equal; -}; - -struct MapBadKeyStruct -{ - map my_map; -}; - -struct MapBadElemStruct -{ - map my_map; -}; - -struct MapBoundsStruct -{ - map my_map; -}; - -struct MapMapStruct -{ - map , 2> my_map_map; -}; - -struct MapMapBoundsStruct -{ - map , 3> my_map_map; -}; - -// Unions - -union SimpleUnion switch (long) -{ - case A: - long first; - case B: - long long second; -}; - -union SimpleUnionNames switch (long) -{ - case A: - long first_case; - case B: - long long second_case; -}; - -union SimpleTypeUnion switch (long) -{ - case A: - octet first; - case B: - long long second; -}; - -union SimpleBadUnion switch (long) -{ - case A: - long first; - case C: - long long second; -}; - -union SimpleBadDiscUnion switch (octet) -{ - case 0: - long first; - case 1: - long long second; -}; - -struct SimpleUnionStruct -{ - SimpleUnion my_union; -}; - -struct SimpleUnionStructEqual -{ - SimpleUnion my_union_equal; -}; - -struct SimpleUnionNamesStruct -{ - SimpleUnionNames my_union; -}; - -struct SimpleTypeUnionStruct -{ - SimpleTypeUnion my_union; -}; - -struct SimpleBadUnionStruct -{ - SimpleBadUnion my_union; -}; - -struct SimplBadDiscUnionStruct -{ - SimpleBadDiscUnion my_union; -}; \ No newline at end of file diff --git a/test/unittest/xtypes/idl/TypesCdrAux.hpp b/test/unittest/xtypes/idl/TypesCdrAux.hpp deleted file mode 100644 index 14992724933..00000000000 --- a/test/unittest/xtypes/idl/TypesCdrAux.hpp +++ /dev/null @@ -1,427 +0,0 @@ -// 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_TYPESCDRAUX_HPP_ -#define _FAST_DDS_GENERATED_TYPESCDRAUX_HPP_ - -#include "Types.h" - -constexpr uint32_t SimpleUnionStruct_max_cdr_typesize {24UL}; -constexpr uint32_t SimpleUnionStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SequenceSequenceBoundsStruct_max_cdr_typesize {132UL}; -constexpr uint32_t SequenceSequenceBoundsStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t MyAliasEnumStruct_max_cdr_typesize {8UL}; -constexpr uint32_t MyAliasEnumStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t ArrayBadStruct_max_cdr_typesize {6UL}; -constexpr uint32_t ArrayBadStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t MapBadKeyStruct_max_cdr_typesize {24UL}; -constexpr uint32_t MapBadKeyStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SimpleBadUnionStruct_max_cdr_typesize {24UL}; -constexpr uint32_t SimpleBadUnionStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t MyEnumStruct_max_cdr_typesize {8UL}; -constexpr uint32_t MyEnumStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t ArrayStructEqual_max_cdr_typesize {12UL}; -constexpr uint32_t ArrayStructEqual_max_key_cdr_typesize {0UL}; - -constexpr uint32_t LargeWStringStruct_max_cdr_typesize {83858UL}; -constexpr uint32_t LargeWStringStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t WStringStruct_max_cdr_typesize {518UL}; -constexpr uint32_t WStringStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SequenceStruct_max_cdr_typesize {16UL}; -constexpr uint32_t SequenceStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SimpleTypeUnionStruct_max_cdr_typesize {24UL}; -constexpr uint32_t SimpleTypeUnionStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t ArrayDimensionsStruct_max_cdr_typesize {20UL}; -constexpr uint32_t ArrayDimensionsStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SequenceSequenceStruct_max_cdr_typesize {48UL}; -constexpr uint32_t SequenceSequenceStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t MapBoundsStruct_max_cdr_typesize {40UL}; -constexpr uint32_t MapBoundsStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SequenceStructEqual_max_cdr_typesize {16UL}; -constexpr uint32_t SequenceStructEqual_max_key_cdr_typesize {0UL}; - -constexpr uint32_t MapStructEqual_max_cdr_typesize {24UL}; -constexpr uint32_t MapStructEqual_max_key_cdr_typesize {0UL}; - -constexpr uint32_t BasicStruct_max_cdr_typesize {272UL}; -constexpr uint32_t BasicStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SequenceBoundsStruct_max_cdr_typesize {24UL}; -constexpr uint32_t SequenceBoundsStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t MapMapStruct_max_cdr_typesize {60UL}; -constexpr uint32_t MapMapStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t BasicWideStruct_max_cdr_typesize {536UL}; -constexpr uint32_t BasicWideStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t SimplBadDiscUnionStruct_max_cdr_typesize {24UL}; -constexpr uint32_t SimplBadDiscUnionStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t MapStruct_max_cdr_typesize {24UL}; -constexpr uint32_t MapStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t MyBadEnumStruct_max_cdr_typesize {8UL}; -constexpr uint32_t MyBadEnumStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SequenceBadStruct_max_cdr_typesize {10UL}; -constexpr uint32_t SequenceBadStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SimpleUnionNamesStruct_max_cdr_typesize {24UL}; -constexpr uint32_t SimpleUnionNamesStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t LargeStringStruct_max_cdr_typesize {41934UL}; -constexpr uint32_t LargeStringStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t ArrayStruct_max_cdr_typesize {12UL}; -constexpr uint32_t ArrayStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t BadBasicWideStruct_max_cdr_typesize {536UL}; -constexpr uint32_t BadBasicWideStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t ArraySizeStruct_max_cdr_typesize {24UL}; -constexpr uint32_t ArraySizeStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t MapBadElemStruct_max_cdr_typesize {40UL}; -constexpr uint32_t MapBadElemStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SimpleUnionStructEqual_max_cdr_typesize {24UL}; -constexpr uint32_t SimpleUnionStructEqual_max_key_cdr_typesize {0UL}; - -constexpr uint32_t BasicBadStruct_max_cdr_typesize {272UL}; -constexpr uint32_t BasicBadStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t BasicNamesStruct_max_cdr_typesize {272UL}; -constexpr uint32_t BasicNamesStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t StringStruct_max_cdr_typesize {264UL}; -constexpr uint32_t StringStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t MapMapBoundsStruct_max_cdr_typesize {108UL}; -constexpr uint32_t MapMapBoundsStruct_max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MyEnumStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MyBadEnumStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MyAliasEnumStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicNamesStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicBadStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicWideStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BadBasicWideStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const StringStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LargeStringStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const WStringStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LargeWStringStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayStructEqual& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayBadStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayDimensionsStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArraySizeStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceStructEqual& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceBadStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceBoundsStruct& data); - - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceSequenceStruct& data); - - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceSequenceBoundsStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapStructEqual& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapBadKeyStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapBadElemStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapBoundsStruct& data); - - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapMapStruct& data); - - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapMapBoundsStruct& data); - - - - - - - - - - - - - - - - - - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionStructEqual& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionNamesStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleTypeUnionStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleBadUnionStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimplBadDiscUnionStruct& data); - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_TYPESCDRAUX_HPP_ - diff --git a/test/unittest/xtypes/idl/TypesCdrAux.ipp b/test/unittest/xtypes/idl/TypesCdrAux.ipp deleted file mode 100644 index 5d6735bcfef..00000000000 --- a/test/unittest/xtypes/idl/TypesCdrAux.ipp +++ /dev/null @@ -1,3543 +0,0 @@ -// 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_TYPESCDRAUX_IPP_ -#define _FAST_DDS_GENERATED_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 MyEnumStruct& 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.my_enum(), 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 MyEnumStruct& 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.my_enum() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MyEnumStruct& 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.my_enum(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MyEnumStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MyBadEnumStruct& 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.my_enum(), 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 MyBadEnumStruct& 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.my_enum() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MyBadEnumStruct& 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.my_enum(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MyBadEnumStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MyAliasEnumStruct& 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.my_enum(), 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 MyAliasEnumStruct& 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.my_enum() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MyAliasEnumStruct& 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.my_enum(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MyAliasEnumStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const BasicStruct& 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.my_bool(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.my_int32(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.my_string(), 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 BasicStruct& 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.my_bool() - << eprosima::fastcdr::MemberId(1) << data.my_int32() - << eprosima::fastcdr::MemberId(2) << data.my_string() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - BasicStruct& 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.my_bool(); - break; - - case 1: - dcdr >> data.my_int32(); - break; - - case 2: - dcdr >> data.my_string(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const BasicNamesStruct& 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.my_bool_name(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.my_int32_name(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.my_string_name(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const BasicNamesStruct& 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.my_bool_name() - << eprosima::fastcdr::MemberId(1) << data.my_int32_name() - << eprosima::fastcdr::MemberId(2) << data.my_string_name() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - BasicNamesStruct& 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.my_bool_name(); - break; - - case 1: - dcdr >> data.my_int32_name(); - break; - - case 2: - dcdr >> data.my_string_name(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicNamesStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const BasicBadStruct& 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.my_bool(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.my_int32(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.my_string(), 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 BasicBadStruct& 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.my_bool() - << eprosima::fastcdr::MemberId(1) << data.my_int32() - << eprosima::fastcdr::MemberId(2) << data.my_string() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - BasicBadStruct& 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.my_bool(); - break; - - case 1: - dcdr >> data.my_int32(); - break; - - case 2: - dcdr >> data.my_string(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicBadStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const BasicWideStruct& 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.my_bool(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.my_int32(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.my_string(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), - data.new_int32(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), - data.new_string(), 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 BasicWideStruct& 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.my_bool() - << eprosima::fastcdr::MemberId(1) << data.my_int32() - << eprosima::fastcdr::MemberId(2) << data.my_string() - << eprosima::fastcdr::MemberId(3) << data.new_int32() - << eprosima::fastcdr::MemberId(4) << data.new_string() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - BasicWideStruct& 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.my_bool(); - break; - - case 1: - dcdr >> data.my_int32(); - break; - - case 2: - dcdr >> data.my_string(); - break; - - case 3: - dcdr >> data.new_int32(); - break; - - case 4: - dcdr >> data.new_string(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicWideStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const BadBasicWideStruct& 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.new_int32(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.new_string(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.my_bool(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), - data.my_int32(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), - data.my_string(), 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 BadBasicWideStruct& 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.new_int32() - << eprosima::fastcdr::MemberId(1) << data.new_string() - << eprosima::fastcdr::MemberId(2) << data.my_bool() - << eprosima::fastcdr::MemberId(3) << data.my_int32() - << eprosima::fastcdr::MemberId(4) << data.my_string() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - BadBasicWideStruct& 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.new_int32(); - break; - - case 1: - dcdr >> data.new_string(); - break; - - case 2: - dcdr >> data.my_bool(); - break; - - case 3: - dcdr >> data.my_int32(); - break; - - case 4: - dcdr >> data.my_string(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BadBasicWideStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const StringStruct& 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.my_string(), 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 StringStruct& 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.my_string() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - StringStruct& 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.my_string(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const StringStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const LargeStringStruct& 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.my_large_string(), 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 LargeStringStruct& 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.my_large_string() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - LargeStringStruct& 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.my_large_string(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LargeStringStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const WStringStruct& 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.my_wstring(), 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 WStringStruct& 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.my_wstring() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - WStringStruct& 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.my_wstring(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const WStringStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const LargeWStringStruct& 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.my_large_wstring(), 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 LargeWStringStruct& 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.my_large_wstring() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - LargeWStringStruct& 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.my_large_wstring(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LargeWStringStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const ArrayStruct& 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.my_array(), 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 ArrayStruct& 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.my_array() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ArrayStruct& 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.my_array(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const ArrayStructEqual& 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.my_array_equal(), 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 ArrayStructEqual& 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.my_array_equal() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ArrayStructEqual& 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.my_array_equal(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayStructEqual& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const ArrayBadStruct& 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.my_array(), 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 ArrayBadStruct& 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.my_array() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ArrayBadStruct& 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.my_array(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayBadStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const ArrayDimensionsStruct& 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.my_array(), 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 ArrayDimensionsStruct& 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.my_array() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ArrayDimensionsStruct& 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.my_array(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayDimensionsStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const ArraySizeStruct& 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.my_array(), 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 ArraySizeStruct& 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.my_array() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ArraySizeStruct& 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.my_array(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArraySizeStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SequenceStruct& 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.my_sequence(), 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 SequenceStruct& 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.my_sequence() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SequenceStruct& 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.my_sequence(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SequenceStructEqual& 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.my_sequence_equal(), 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 SequenceStructEqual& 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.my_sequence_equal() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SequenceStructEqual& 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.my_sequence_equal(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceStructEqual& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SequenceBadStruct& 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.my_sequence(), 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 SequenceBadStruct& 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.my_sequence() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SequenceBadStruct& 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.my_sequence(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceBadStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SequenceBoundsStruct& 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.my_sequence(), 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 SequenceBoundsStruct& 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.my_sequence() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SequenceBoundsStruct& 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.my_sequence(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceBoundsStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SequenceSequenceStruct& 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.my_sequence_sequence(), 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 SequenceSequenceStruct& 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.my_sequence_sequence() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SequenceSequenceStruct& 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.my_sequence_sequence(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceSequenceStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SequenceSequenceBoundsStruct& 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.my_sequence_sequence(), 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 SequenceSequenceBoundsStruct& 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.my_sequence_sequence() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SequenceSequenceBoundsStruct& 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.my_sequence_sequence(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceSequenceBoundsStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MapStruct& 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.my_map(), 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 MapStruct& 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.my_map() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MapStruct& 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.my_map(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MapStructEqual& 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.my_map_equal(), 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 MapStructEqual& 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.my_map_equal() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MapStructEqual& 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.my_map_equal(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapStructEqual& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MapBadKeyStruct& 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.my_map(), 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 MapBadKeyStruct& 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.my_map() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MapBadKeyStruct& 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.my_map(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapBadKeyStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MapBadElemStruct& 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.my_map(), 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 MapBadElemStruct& 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.my_map() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MapBadElemStruct& 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.my_map(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapBadElemStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MapBoundsStruct& 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.my_map(), 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 MapBoundsStruct& 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.my_map() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MapBoundsStruct& 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.my_map(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapBoundsStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MapMapStruct& 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.my_map_map(), 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 MapMapStruct& 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.my_map_map() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MapMapStruct& 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.my_map_map(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapMapStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MapMapBoundsStruct& 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.my_map_map(), 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 MapMapBoundsStruct& 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.my_map_map() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MapMapBoundsStruct& 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.my_map_map(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapMapBoundsStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleUnion& 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 A: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.first(), current_alignment); - break; - - case B: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.second(), current_alignment); - break; - - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnion& 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 A: - scdr << eprosima::fastcdr::MemberId(1) << data.first(); - break; - - case B: - scdr << eprosima::fastcdr::MemberId(2) << data.second(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleUnion& 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 A: - dcdr >> data.first(); - break; - - case B: - dcdr >> data.second(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleUnionNames& 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 A: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.first_case(), current_alignment); - break; - - case B: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.second_case(), current_alignment); - break; - - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionNames& 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 A: - scdr << eprosima::fastcdr::MemberId(1) << data.first_case(); - break; - - case B: - scdr << eprosima::fastcdr::MemberId(2) << data.second_case(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleUnionNames& 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 A: - dcdr >> data.first_case(); - break; - - case B: - dcdr >> data.second_case(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleTypeUnion& 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 A: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.first(), current_alignment); - break; - - case B: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.second(), current_alignment); - break; - - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleTypeUnion& 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 A: - scdr << eprosima::fastcdr::MemberId(1) << data.first(); - break; - - case B: - scdr << eprosima::fastcdr::MemberId(2) << data.second(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleTypeUnion& 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 A: - dcdr >> data.first(); - break; - - case B: - dcdr >> data.second(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleBadUnion& 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 A: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.first(), current_alignment); - break; - - case C: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.second(), current_alignment); - break; - - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleBadUnion& 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 A: - scdr << eprosima::fastcdr::MemberId(1) << data.first(); - break; - - case C: - scdr << eprosima::fastcdr::MemberId(2) << data.second(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleBadUnion& 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 A: - dcdr >> data.first(); - break; - - case C: - dcdr >> data.second(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleBadDiscUnion& 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 0: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.first(), current_alignment); - break; - - case 1: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.second(), current_alignment); - break; - - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleBadDiscUnion& 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 0: - scdr << eprosima::fastcdr::MemberId(1) << data.first(); - break; - - case 1: - scdr << eprosima::fastcdr::MemberId(2) << data.second(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleBadDiscUnion& 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 0: - dcdr >> data.first(); - break; - - case 1: - dcdr >> data.second(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleUnionStruct& 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.my_union(), 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 SimpleUnionStruct& 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.my_union() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleUnionStruct& 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.my_union(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleUnionStructEqual& 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.my_union_equal(), 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 SimpleUnionStructEqual& 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.my_union_equal() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleUnionStructEqual& 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.my_union_equal(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionStructEqual& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleUnionNamesStruct& 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.my_union(), 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 SimpleUnionNamesStruct& 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.my_union() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleUnionNamesStruct& 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.my_union(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionNamesStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleTypeUnionStruct& 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.my_union(), 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 SimpleTypeUnionStruct& 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.my_union() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleTypeUnionStruct& 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.my_union(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleTypeUnionStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleBadUnionStruct& 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.my_union(), 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 SimpleBadUnionStruct& 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.my_union() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleBadUnionStruct& 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.my_union(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleBadUnionStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimplBadDiscUnionStruct& 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.my_union(), 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 SimplBadDiscUnionStruct& 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.my_union() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimplBadDiscUnionStruct& 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.my_union(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimplBadDiscUnionStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_TYPESCDRAUX_IPP_ - diff --git a/test/unittest/xtypes/idl/TypesPubSubTypes.cxx b/test/unittest/xtypes/idl/TypesPubSubTypes.cxx deleted file mode 100644 index 0c0a8f0363e..00000000000 --- a/test/unittest/xtypes/idl/TypesPubSubTypes.cxx +++ /dev/null @@ -1,6927 +0,0 @@ -// 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 TypesPubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#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; - - - -MyEnumStructPubSubType::MyEnumStructPubSubType() -{ - setName("MyEnumStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MyEnumStruct::getMaxCdrSerializedSize()); -#else - MyEnumStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = MyEnumStruct_max_key_cdr_typesize > 16 ? MyEnumStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MyEnumStructPubSubType::~MyEnumStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MyEnumStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MyEnumStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool MyEnumStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MyEnumStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function MyEnumStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* MyEnumStructPubSubType::createData() -{ - return reinterpret_cast(new MyEnumStruct()); -} - -void MyEnumStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MyEnumStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MyEnumStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MyEnumStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || MyEnumStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -MyBadEnumStructPubSubType::MyBadEnumStructPubSubType() -{ - setName("MyBadEnumStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MyBadEnumStruct::getMaxCdrSerializedSize()); -#else - MyBadEnumStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = MyBadEnumStruct_max_key_cdr_typesize > 16 ? MyBadEnumStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MyBadEnumStructPubSubType::~MyBadEnumStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MyBadEnumStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MyBadEnumStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool MyBadEnumStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MyBadEnumStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function MyBadEnumStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* MyBadEnumStructPubSubType::createData() -{ - return reinterpret_cast(new MyBadEnumStruct()); -} - -void MyBadEnumStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MyBadEnumStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MyBadEnumStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MyBadEnumStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || MyBadEnumStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - -MyAliasEnumStructPubSubType::MyAliasEnumStructPubSubType() -{ - setName("MyAliasEnumStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MyAliasEnumStruct::getMaxCdrSerializedSize()); -#else - MyAliasEnumStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = MyAliasEnumStruct_max_key_cdr_typesize > 16 ? MyAliasEnumStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MyAliasEnumStructPubSubType::~MyAliasEnumStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MyAliasEnumStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MyAliasEnumStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool MyAliasEnumStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MyAliasEnumStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function MyAliasEnumStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* MyAliasEnumStructPubSubType::createData() -{ - return reinterpret_cast(new MyAliasEnumStruct()); -} - -void MyAliasEnumStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MyAliasEnumStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MyAliasEnumStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MyAliasEnumStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || MyAliasEnumStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -BasicStructPubSubType::BasicStructPubSubType() -{ - setName("BasicStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(BasicStruct::getMaxCdrSerializedSize()); -#else - BasicStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = BasicStruct_max_key_cdr_typesize > 16 ? BasicStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -BasicStructPubSubType::~BasicStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool BasicStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - BasicStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool BasicStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - BasicStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function BasicStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* BasicStructPubSubType::createData() -{ - return reinterpret_cast(new BasicStruct()); -} - -void BasicStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool BasicStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - BasicStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - BasicStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || BasicStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -BasicNamesStructPubSubType::BasicNamesStructPubSubType() -{ - setName("BasicNamesStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(BasicNamesStruct::getMaxCdrSerializedSize()); -#else - BasicNamesStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = BasicNamesStruct_max_key_cdr_typesize > 16 ? BasicNamesStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -BasicNamesStructPubSubType::~BasicNamesStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool BasicNamesStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - BasicNamesStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool BasicNamesStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - BasicNamesStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function BasicNamesStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* BasicNamesStructPubSubType::createData() -{ - return reinterpret_cast(new BasicNamesStruct()); -} - -void BasicNamesStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool BasicNamesStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - BasicNamesStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - BasicNamesStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || BasicNamesStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -BasicBadStructPubSubType::BasicBadStructPubSubType() -{ - setName("BasicBadStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(BasicBadStruct::getMaxCdrSerializedSize()); -#else - BasicBadStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = BasicBadStruct_max_key_cdr_typesize > 16 ? BasicBadStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -BasicBadStructPubSubType::~BasicBadStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool BasicBadStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - BasicBadStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool BasicBadStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - BasicBadStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function BasicBadStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* BasicBadStructPubSubType::createData() -{ - return reinterpret_cast(new BasicBadStruct()); -} - -void BasicBadStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool BasicBadStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - BasicBadStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - BasicBadStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || BasicBadStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -BasicWideStructPubSubType::BasicWideStructPubSubType() -{ - setName("BasicWideStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(BasicWideStruct::getMaxCdrSerializedSize()); -#else - BasicWideStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = BasicWideStruct_max_key_cdr_typesize > 16 ? BasicWideStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -BasicWideStructPubSubType::~BasicWideStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool BasicWideStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - BasicWideStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool BasicWideStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - BasicWideStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function BasicWideStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* BasicWideStructPubSubType::createData() -{ - return reinterpret_cast(new BasicWideStruct()); -} - -void BasicWideStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool BasicWideStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - BasicWideStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - BasicWideStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || BasicWideStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -BadBasicWideStructPubSubType::BadBasicWideStructPubSubType() -{ - setName("BadBasicWideStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(BadBasicWideStruct::getMaxCdrSerializedSize()); -#else - BadBasicWideStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = BadBasicWideStruct_max_key_cdr_typesize > 16 ? BadBasicWideStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -BadBasicWideStructPubSubType::~BadBasicWideStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool BadBasicWideStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - BadBasicWideStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool BadBasicWideStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - BadBasicWideStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function BadBasicWideStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* BadBasicWideStructPubSubType::createData() -{ - return reinterpret_cast(new BadBasicWideStruct()); -} - -void BadBasicWideStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool BadBasicWideStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - BadBasicWideStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - BadBasicWideStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || BadBasicWideStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -StringStructPubSubType::StringStructPubSubType() -{ - setName("StringStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(StringStruct::getMaxCdrSerializedSize()); -#else - StringStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = StringStruct_max_key_cdr_typesize > 16 ? StringStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -StringStructPubSubType::~StringStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool StringStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - StringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool StringStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - StringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function StringStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* StringStructPubSubType::createData() -{ - return reinterpret_cast(new StringStruct()); -} - -void StringStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool StringStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - StringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - StringStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || StringStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -LargeStringStructPubSubType::LargeStringStructPubSubType() -{ - setName("LargeStringStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(LargeStringStruct::getMaxCdrSerializedSize()); -#else - LargeStringStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = LargeStringStruct_max_key_cdr_typesize > 16 ? LargeStringStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -LargeStringStructPubSubType::~LargeStringStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool LargeStringStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - LargeStringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool LargeStringStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - LargeStringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function LargeStringStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* LargeStringStructPubSubType::createData() -{ - return reinterpret_cast(new LargeStringStruct()); -} - -void LargeStringStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool LargeStringStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - LargeStringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - LargeStringStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || LargeStringStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -WStringStructPubSubType::WStringStructPubSubType() -{ - setName("WStringStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(WStringStruct::getMaxCdrSerializedSize()); -#else - WStringStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = WStringStruct_max_key_cdr_typesize > 16 ? WStringStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -WStringStructPubSubType::~WStringStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool WStringStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - WStringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool WStringStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - WStringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function WStringStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* WStringStructPubSubType::createData() -{ - return reinterpret_cast(new WStringStruct()); -} - -void WStringStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool WStringStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - WStringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - WStringStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || WStringStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -LargeWStringStructPubSubType::LargeWStringStructPubSubType() -{ - setName("LargeWStringStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(LargeWStringStruct::getMaxCdrSerializedSize()); -#else - LargeWStringStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = LargeWStringStruct_max_key_cdr_typesize > 16 ? LargeWStringStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -LargeWStringStructPubSubType::~LargeWStringStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool LargeWStringStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - LargeWStringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool LargeWStringStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - LargeWStringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function LargeWStringStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* LargeWStringStructPubSubType::createData() -{ - return reinterpret_cast(new LargeWStringStruct()); -} - -void LargeWStringStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool LargeWStringStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - LargeWStringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - LargeWStringStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || LargeWStringStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -ArrayStructPubSubType::ArrayStructPubSubType() -{ - setName("ArrayStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ArrayStruct::getMaxCdrSerializedSize()); -#else - ArrayStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = ArrayStruct_max_key_cdr_typesize > 16 ? ArrayStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ArrayStructPubSubType::~ArrayStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ArrayStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ArrayStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool ArrayStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ArrayStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function ArrayStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* ArrayStructPubSubType::createData() -{ - return reinterpret_cast(new ArrayStruct()); -} - -void ArrayStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ArrayStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ArrayStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ArrayStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || ArrayStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -ArrayStructEqualPubSubType::ArrayStructEqualPubSubType() -{ - setName("ArrayStructEqual"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ArrayStructEqual::getMaxCdrSerializedSize()); -#else - ArrayStructEqual_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = ArrayStructEqual_max_key_cdr_typesize > 16 ? ArrayStructEqual_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ArrayStructEqualPubSubType::~ArrayStructEqualPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ArrayStructEqualPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ArrayStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool ArrayStructEqualPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ArrayStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function ArrayStructEqualPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* ArrayStructEqualPubSubType::createData() -{ - return reinterpret_cast(new ArrayStructEqual()); -} - -void ArrayStructEqualPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ArrayStructEqualPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ArrayStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ArrayStructEqual_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || ArrayStructEqual_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -ArrayBadStructPubSubType::ArrayBadStructPubSubType() -{ - setName("ArrayBadStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ArrayBadStruct::getMaxCdrSerializedSize()); -#else - ArrayBadStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = ArrayBadStruct_max_key_cdr_typesize > 16 ? ArrayBadStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ArrayBadStructPubSubType::~ArrayBadStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ArrayBadStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ArrayBadStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool ArrayBadStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ArrayBadStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function ArrayBadStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* ArrayBadStructPubSubType::createData() -{ - return reinterpret_cast(new ArrayBadStruct()); -} - -void ArrayBadStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ArrayBadStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ArrayBadStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ArrayBadStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || ArrayBadStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -ArrayDimensionsStructPubSubType::ArrayDimensionsStructPubSubType() -{ - setName("ArrayDimensionsStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ArrayDimensionsStruct::getMaxCdrSerializedSize()); -#else - ArrayDimensionsStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = ArrayDimensionsStruct_max_key_cdr_typesize > 16 ? ArrayDimensionsStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ArrayDimensionsStructPubSubType::~ArrayDimensionsStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ArrayDimensionsStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ArrayDimensionsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool ArrayDimensionsStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ArrayDimensionsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function ArrayDimensionsStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* ArrayDimensionsStructPubSubType::createData() -{ - return reinterpret_cast(new ArrayDimensionsStruct()); -} - -void ArrayDimensionsStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ArrayDimensionsStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ArrayDimensionsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ArrayDimensionsStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || ArrayDimensionsStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -ArraySizeStructPubSubType::ArraySizeStructPubSubType() -{ - setName("ArraySizeStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ArraySizeStruct::getMaxCdrSerializedSize()); -#else - ArraySizeStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = ArraySizeStruct_max_key_cdr_typesize > 16 ? ArraySizeStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ArraySizeStructPubSubType::~ArraySizeStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ArraySizeStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ArraySizeStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool ArraySizeStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ArraySizeStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function ArraySizeStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* ArraySizeStructPubSubType::createData() -{ - return reinterpret_cast(new ArraySizeStruct()); -} - -void ArraySizeStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ArraySizeStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ArraySizeStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ArraySizeStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || ArraySizeStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - -SequenceStructPubSubType::SequenceStructPubSubType() -{ - setName("SequenceStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SequenceStruct::getMaxCdrSerializedSize()); -#else - SequenceStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = SequenceStruct_max_key_cdr_typesize > 16 ? SequenceStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SequenceStructPubSubType::~SequenceStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SequenceStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SequenceStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool SequenceStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SequenceStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function SequenceStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* SequenceStructPubSubType::createData() -{ - return reinterpret_cast(new SequenceStruct()); -} - -void SequenceStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SequenceStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SequenceStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SequenceStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || SequenceStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - -SequenceStructEqualPubSubType::SequenceStructEqualPubSubType() -{ - setName("SequenceStructEqual"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SequenceStructEqual::getMaxCdrSerializedSize()); -#else - SequenceStructEqual_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = SequenceStructEqual_max_key_cdr_typesize > 16 ? SequenceStructEqual_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SequenceStructEqualPubSubType::~SequenceStructEqualPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SequenceStructEqualPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SequenceStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool SequenceStructEqualPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SequenceStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function SequenceStructEqualPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* SequenceStructEqualPubSubType::createData() -{ - return reinterpret_cast(new SequenceStructEqual()); -} - -void SequenceStructEqualPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SequenceStructEqualPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SequenceStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SequenceStructEqual_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || SequenceStructEqual_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - -SequenceBadStructPubSubType::SequenceBadStructPubSubType() -{ - setName("SequenceBadStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SequenceBadStruct::getMaxCdrSerializedSize()); -#else - SequenceBadStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = SequenceBadStruct_max_key_cdr_typesize > 16 ? SequenceBadStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SequenceBadStructPubSubType::~SequenceBadStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SequenceBadStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SequenceBadStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool SequenceBadStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SequenceBadStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function SequenceBadStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* SequenceBadStructPubSubType::createData() -{ - return reinterpret_cast(new SequenceBadStruct()); -} - -void SequenceBadStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SequenceBadStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SequenceBadStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SequenceBadStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || SequenceBadStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - -SequenceBoundsStructPubSubType::SequenceBoundsStructPubSubType() -{ - setName("SequenceBoundsStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SequenceBoundsStruct::getMaxCdrSerializedSize()); -#else - SequenceBoundsStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = SequenceBoundsStruct_max_key_cdr_typesize > 16 ? SequenceBoundsStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SequenceBoundsStructPubSubType::~SequenceBoundsStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SequenceBoundsStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SequenceBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool SequenceBoundsStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SequenceBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function SequenceBoundsStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* SequenceBoundsStructPubSubType::createData() -{ - return reinterpret_cast(new SequenceBoundsStruct()); -} - -void SequenceBoundsStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SequenceBoundsStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SequenceBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SequenceBoundsStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || SequenceBoundsStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - - - -SequenceSequenceStructPubSubType::SequenceSequenceStructPubSubType() -{ - setName("SequenceSequenceStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SequenceSequenceStruct::getMaxCdrSerializedSize()); -#else - SequenceSequenceStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = SequenceSequenceStruct_max_key_cdr_typesize > 16 ? SequenceSequenceStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SequenceSequenceStructPubSubType::~SequenceSequenceStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SequenceSequenceStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SequenceSequenceStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool SequenceSequenceStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SequenceSequenceStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function SequenceSequenceStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* SequenceSequenceStructPubSubType::createData() -{ - return reinterpret_cast(new SequenceSequenceStruct()); -} - -void SequenceSequenceStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SequenceSequenceStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SequenceSequenceStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SequenceSequenceStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || SequenceSequenceStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - - - -SequenceSequenceBoundsStructPubSubType::SequenceSequenceBoundsStructPubSubType() -{ - setName("SequenceSequenceBoundsStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SequenceSequenceBoundsStruct::getMaxCdrSerializedSize()); -#else - SequenceSequenceBoundsStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = SequenceSequenceBoundsStruct_max_key_cdr_typesize > 16 ? SequenceSequenceBoundsStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SequenceSequenceBoundsStructPubSubType::~SequenceSequenceBoundsStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SequenceSequenceBoundsStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SequenceSequenceBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool SequenceSequenceBoundsStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SequenceSequenceBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function SequenceSequenceBoundsStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* SequenceSequenceBoundsStructPubSubType::createData() -{ - return reinterpret_cast(new SequenceSequenceBoundsStruct()); -} - -void SequenceSequenceBoundsStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SequenceSequenceBoundsStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SequenceSequenceBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SequenceSequenceBoundsStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || SequenceSequenceBoundsStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - -MapStructPubSubType::MapStructPubSubType() -{ - setName("MapStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MapStruct::getMaxCdrSerializedSize()); -#else - MapStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = MapStruct_max_key_cdr_typesize > 16 ? MapStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MapStructPubSubType::~MapStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MapStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MapStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool MapStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MapStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function MapStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* MapStructPubSubType::createData() -{ - return reinterpret_cast(new MapStruct()); -} - -void MapStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MapStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MapStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MapStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || MapStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - -MapStructEqualPubSubType::MapStructEqualPubSubType() -{ - setName("MapStructEqual"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MapStructEqual::getMaxCdrSerializedSize()); -#else - MapStructEqual_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = MapStructEqual_max_key_cdr_typesize > 16 ? MapStructEqual_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MapStructEqualPubSubType::~MapStructEqualPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MapStructEqualPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MapStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool MapStructEqualPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MapStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function MapStructEqualPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* MapStructEqualPubSubType::createData() -{ - return reinterpret_cast(new MapStructEqual()); -} - -void MapStructEqualPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MapStructEqualPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MapStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MapStructEqual_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || MapStructEqual_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - -MapBadKeyStructPubSubType::MapBadKeyStructPubSubType() -{ - setName("MapBadKeyStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MapBadKeyStruct::getMaxCdrSerializedSize()); -#else - MapBadKeyStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = MapBadKeyStruct_max_key_cdr_typesize > 16 ? MapBadKeyStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MapBadKeyStructPubSubType::~MapBadKeyStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MapBadKeyStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MapBadKeyStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool MapBadKeyStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MapBadKeyStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function MapBadKeyStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* MapBadKeyStructPubSubType::createData() -{ - return reinterpret_cast(new MapBadKeyStruct()); -} - -void MapBadKeyStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MapBadKeyStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MapBadKeyStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MapBadKeyStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || MapBadKeyStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - -MapBadElemStructPubSubType::MapBadElemStructPubSubType() -{ - setName("MapBadElemStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MapBadElemStruct::getMaxCdrSerializedSize()); -#else - MapBadElemStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = MapBadElemStruct_max_key_cdr_typesize > 16 ? MapBadElemStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MapBadElemStructPubSubType::~MapBadElemStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MapBadElemStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MapBadElemStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool MapBadElemStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MapBadElemStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function MapBadElemStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* MapBadElemStructPubSubType::createData() -{ - return reinterpret_cast(new MapBadElemStruct()); -} - -void MapBadElemStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MapBadElemStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MapBadElemStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MapBadElemStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || MapBadElemStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - -MapBoundsStructPubSubType::MapBoundsStructPubSubType() -{ - setName("MapBoundsStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MapBoundsStruct::getMaxCdrSerializedSize()); -#else - MapBoundsStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = MapBoundsStruct_max_key_cdr_typesize > 16 ? MapBoundsStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MapBoundsStructPubSubType::~MapBoundsStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MapBoundsStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MapBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool MapBoundsStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MapBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function MapBoundsStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* MapBoundsStructPubSubType::createData() -{ - return reinterpret_cast(new MapBoundsStruct()); -} - -void MapBoundsStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MapBoundsStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MapBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MapBoundsStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || MapBoundsStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - - - -MapMapStructPubSubType::MapMapStructPubSubType() -{ - setName("MapMapStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MapMapStruct::getMaxCdrSerializedSize()); -#else - MapMapStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = MapMapStruct_max_key_cdr_typesize > 16 ? MapMapStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MapMapStructPubSubType::~MapMapStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MapMapStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MapMapStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool MapMapStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MapMapStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function MapMapStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* MapMapStructPubSubType::createData() -{ - return reinterpret_cast(new MapMapStruct()); -} - -void MapMapStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MapMapStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MapMapStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MapMapStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || MapMapStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - - - -MapMapBoundsStructPubSubType::MapMapBoundsStructPubSubType() -{ - setName("MapMapBoundsStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MapMapBoundsStruct::getMaxCdrSerializedSize()); -#else - MapMapBoundsStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = MapMapBoundsStruct_max_key_cdr_typesize > 16 ? MapMapBoundsStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MapMapBoundsStructPubSubType::~MapMapBoundsStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MapMapBoundsStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MapMapBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool MapMapBoundsStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MapMapBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function MapMapBoundsStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* MapMapBoundsStructPubSubType::createData() -{ - return reinterpret_cast(new MapMapBoundsStruct()); -} - -void MapMapBoundsStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MapMapBoundsStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MapMapBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MapMapBoundsStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || MapMapBoundsStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - - - - - - - - - - - - - - - - - - - -SimpleUnionStructPubSubType::SimpleUnionStructPubSubType() -{ - setName("SimpleUnionStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SimpleUnionStruct::getMaxCdrSerializedSize()); -#else - SimpleUnionStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = SimpleUnionStruct_max_key_cdr_typesize > 16 ? SimpleUnionStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SimpleUnionStructPubSubType::~SimpleUnionStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SimpleUnionStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SimpleUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool SimpleUnionStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SimpleUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function SimpleUnionStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* SimpleUnionStructPubSubType::createData() -{ - return reinterpret_cast(new SimpleUnionStruct()); -} - -void SimpleUnionStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SimpleUnionStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SimpleUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SimpleUnionStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || SimpleUnionStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -SimpleUnionStructEqualPubSubType::SimpleUnionStructEqualPubSubType() -{ - setName("SimpleUnionStructEqual"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SimpleUnionStructEqual::getMaxCdrSerializedSize()); -#else - SimpleUnionStructEqual_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = SimpleUnionStructEqual_max_key_cdr_typesize > 16 ? SimpleUnionStructEqual_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SimpleUnionStructEqualPubSubType::~SimpleUnionStructEqualPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SimpleUnionStructEqualPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SimpleUnionStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool SimpleUnionStructEqualPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SimpleUnionStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function SimpleUnionStructEqualPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* SimpleUnionStructEqualPubSubType::createData() -{ - return reinterpret_cast(new SimpleUnionStructEqual()); -} - -void SimpleUnionStructEqualPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SimpleUnionStructEqualPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SimpleUnionStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SimpleUnionStructEqual_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || SimpleUnionStructEqual_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -SimpleUnionNamesStructPubSubType::SimpleUnionNamesStructPubSubType() -{ - setName("SimpleUnionNamesStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SimpleUnionNamesStruct::getMaxCdrSerializedSize()); -#else - SimpleUnionNamesStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = SimpleUnionNamesStruct_max_key_cdr_typesize > 16 ? SimpleUnionNamesStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SimpleUnionNamesStructPubSubType::~SimpleUnionNamesStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SimpleUnionNamesStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SimpleUnionNamesStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool SimpleUnionNamesStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SimpleUnionNamesStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function SimpleUnionNamesStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* SimpleUnionNamesStructPubSubType::createData() -{ - return reinterpret_cast(new SimpleUnionNamesStruct()); -} - -void SimpleUnionNamesStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SimpleUnionNamesStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SimpleUnionNamesStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SimpleUnionNamesStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || SimpleUnionNamesStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -SimpleTypeUnionStructPubSubType::SimpleTypeUnionStructPubSubType() -{ - setName("SimpleTypeUnionStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SimpleTypeUnionStruct::getMaxCdrSerializedSize()); -#else - SimpleTypeUnionStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = SimpleTypeUnionStruct_max_key_cdr_typesize > 16 ? SimpleTypeUnionStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SimpleTypeUnionStructPubSubType::~SimpleTypeUnionStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SimpleTypeUnionStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SimpleTypeUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool SimpleTypeUnionStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SimpleTypeUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function SimpleTypeUnionStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* SimpleTypeUnionStructPubSubType::createData() -{ - return reinterpret_cast(new SimpleTypeUnionStruct()); -} - -void SimpleTypeUnionStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SimpleTypeUnionStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SimpleTypeUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SimpleTypeUnionStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || SimpleTypeUnionStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -SimpleBadUnionStructPubSubType::SimpleBadUnionStructPubSubType() -{ - setName("SimpleBadUnionStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SimpleBadUnionStruct::getMaxCdrSerializedSize()); -#else - SimpleBadUnionStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = SimpleBadUnionStruct_max_key_cdr_typesize > 16 ? SimpleBadUnionStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SimpleBadUnionStructPubSubType::~SimpleBadUnionStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SimpleBadUnionStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SimpleBadUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool SimpleBadUnionStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SimpleBadUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function SimpleBadUnionStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* SimpleBadUnionStructPubSubType::createData() -{ - return reinterpret_cast(new SimpleBadUnionStruct()); -} - -void SimpleBadUnionStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SimpleBadUnionStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SimpleBadUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SimpleBadUnionStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || SimpleBadUnionStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -SimplBadDiscUnionStructPubSubType::SimplBadDiscUnionStructPubSubType() -{ - setName("SimplBadDiscUnionStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SimplBadDiscUnionStruct::getMaxCdrSerializedSize()); -#else - SimplBadDiscUnionStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = SimplBadDiscUnionStruct_max_key_cdr_typesize > 16 ? SimplBadDiscUnionStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SimplBadDiscUnionStructPubSubType::~SimplBadDiscUnionStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SimplBadDiscUnionStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SimplBadDiscUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool SimplBadDiscUnionStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SimplBadDiscUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function SimplBadDiscUnionStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* SimplBadDiscUnionStructPubSubType::createData() -{ - return reinterpret_cast(new SimplBadDiscUnionStruct()); -} - -void SimplBadDiscUnionStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SimplBadDiscUnionStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SimplBadDiscUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SimplBadDiscUnionStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || SimplBadDiscUnionStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - diff --git a/test/unittest/xtypes/idl/TypesPubSubTypes.h b/test/unittest/xtypes/idl/TypesPubSubTypes.h deleted file mode 100644 index e579289b6e5..00000000000 --- a/test/unittest/xtypes/idl/TypesPubSubTypes.h +++ /dev/null @@ -1,3337 +0,0 @@ -// 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 TypesPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_TYPES_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_TYPES_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "Types.h" - - -#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 - - - - -/*! - * @brief This class represents the TopicDataType of the type MyEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyEnumStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MyEnumStruct type; - - eProsima_user_DllExport MyEnumStructPubSubType(); - - eProsima_user_DllExport ~MyEnumStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type MyBadEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyBadEnumStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MyBadEnumStruct type; - - eProsima_user_DllExport MyBadEnumStructPubSubType(); - - eProsima_user_DllExport ~MyBadEnumStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; -typedef MyEnum MyAliasEnum; - - - -/*! - * @brief This class represents the TopicDataType of the type MyAliasEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyAliasEnumStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MyAliasEnumStruct type; - - eProsima_user_DllExport MyAliasEnumStructPubSubType(); - - eProsima_user_DllExport ~MyAliasEnumStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type BasicStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef BasicStruct type; - - eProsima_user_DllExport BasicStructPubSubType(); - - eProsima_user_DllExport ~BasicStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type BasicNamesStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicNamesStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef BasicNamesStruct type; - - eProsima_user_DllExport BasicNamesStructPubSubType(); - - eProsima_user_DllExport ~BasicNamesStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type BasicBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicBadStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef BasicBadStruct type; - - eProsima_user_DllExport BasicBadStructPubSubType(); - - eProsima_user_DllExport ~BasicBadStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type BasicWideStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicWideStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef BasicWideStruct type; - - eProsima_user_DllExport BasicWideStructPubSubType(); - - eProsima_user_DllExport ~BasicWideStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type BadBasicWideStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BadBasicWideStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef BadBasicWideStruct type; - - eProsima_user_DllExport BadBasicWideStructPubSubType(); - - eProsima_user_DllExport ~BadBasicWideStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type StringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class StringStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef StringStruct type; - - eProsima_user_DllExport StringStructPubSubType(); - - eProsima_user_DllExport ~StringStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type LargeStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class LargeStringStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef LargeStringStruct type; - - eProsima_user_DllExport LargeStringStructPubSubType(); - - eProsima_user_DllExport ~LargeStringStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type WStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class WStringStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef WStringStruct type; - - eProsima_user_DllExport WStringStructPubSubType(); - - eProsima_user_DllExport ~WStringStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type LargeWStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class LargeWStringStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef LargeWStringStruct type; - - eProsima_user_DllExport LargeWStringStructPubSubType(); - - eProsima_user_DllExport ~LargeWStringStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type ArrayStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ArrayStruct type; - - eProsima_user_DllExport ArrayStructPubSubType(); - - eProsima_user_DllExport ~ArrayStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type ArrayStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayStructEqualPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ArrayStructEqual type; - - eProsima_user_DllExport ArrayStructEqualPubSubType(); - - eProsima_user_DllExport ~ArrayStructEqualPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type ArrayBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayBadStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ArrayBadStruct type; - - eProsima_user_DllExport ArrayBadStructPubSubType(); - - eProsima_user_DllExport ~ArrayBadStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type ArrayDimensionsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayDimensionsStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ArrayDimensionsStruct type; - - eProsima_user_DllExport ArrayDimensionsStructPubSubType(); - - eProsima_user_DllExport ~ArrayDimensionsStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type ArraySizeStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArraySizeStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ArraySizeStruct type; - - eProsima_user_DllExport ArraySizeStructPubSubType(); - - eProsima_user_DllExport ~ArraySizeStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type SequenceStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SequenceStruct type; - - eProsima_user_DllExport SequenceStructPubSubType(); - - eProsima_user_DllExport ~SequenceStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type SequenceStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceStructEqualPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SequenceStructEqual type; - - eProsima_user_DllExport SequenceStructEqualPubSubType(); - - eProsima_user_DllExport ~SequenceStructEqualPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type SequenceBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceBadStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SequenceBadStruct type; - - eProsima_user_DllExport SequenceBadStructPubSubType(); - - eProsima_user_DllExport ~SequenceBadStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type SequenceBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceBoundsStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SequenceBoundsStruct type; - - eProsima_user_DllExport SequenceBoundsStructPubSubType(); - - eProsima_user_DllExport ~SequenceBoundsStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - - - -/*! - * @brief This class represents the TopicDataType of the type SequenceSequenceStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceSequenceStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SequenceSequenceStruct type; - - eProsima_user_DllExport SequenceSequenceStructPubSubType(); - - eProsima_user_DllExport ~SequenceSequenceStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - - - -/*! - * @brief This class represents the TopicDataType of the type SequenceSequenceBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceSequenceBoundsStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SequenceSequenceBoundsStruct type; - - eProsima_user_DllExport SequenceSequenceBoundsStructPubSubType(); - - eProsima_user_DllExport ~SequenceSequenceBoundsStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type MapStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MapStruct type; - - eProsima_user_DllExport MapStructPubSubType(); - - eProsima_user_DllExport ~MapStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type MapStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class MapStructEqualPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MapStructEqual type; - - eProsima_user_DllExport MapStructEqualPubSubType(); - - eProsima_user_DllExport ~MapStructEqualPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type MapBadKeyStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBadKeyStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MapBadKeyStruct type; - - eProsima_user_DllExport MapBadKeyStructPubSubType(); - - eProsima_user_DllExport ~MapBadKeyStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type MapBadElemStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBadElemStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MapBadElemStruct type; - - eProsima_user_DllExport MapBadElemStructPubSubType(); - - eProsima_user_DllExport ~MapBadElemStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type MapBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBoundsStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MapBoundsStruct type; - - eProsima_user_DllExport MapBoundsStructPubSubType(); - - eProsima_user_DllExport ~MapBoundsStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - - - -/*! - * @brief This class represents the TopicDataType of the type MapMapStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapMapStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MapMapStruct type; - - eProsima_user_DllExport MapMapStructPubSubType(); - - eProsima_user_DllExport ~MapMapStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - - - -/*! - * @brief This class represents the TopicDataType of the type MapMapBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapMapBoundsStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MapMapBoundsStruct type; - - eProsima_user_DllExport MapMapBoundsStructPubSubType(); - - eProsima_user_DllExport ~MapMapBoundsStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - - - - - - - - - - - - - - - - - - - -/*! - * @brief This class represents the TopicDataType of the type SimpleUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SimpleUnionStruct type; - - eProsima_user_DllExport SimpleUnionStructPubSubType(); - - eProsima_user_DllExport ~SimpleUnionStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type SimpleUnionStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionStructEqualPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SimpleUnionStructEqual type; - - eProsima_user_DllExport SimpleUnionStructEqualPubSubType(); - - eProsima_user_DllExport ~SimpleUnionStructEqualPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type SimpleUnionNamesStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionNamesStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SimpleUnionNamesStruct type; - - eProsima_user_DllExport SimpleUnionNamesStructPubSubType(); - - eProsima_user_DllExport ~SimpleUnionNamesStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type SimpleTypeUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleTypeUnionStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SimpleTypeUnionStruct type; - - eProsima_user_DllExport SimpleTypeUnionStructPubSubType(); - - eProsima_user_DllExport ~SimpleTypeUnionStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type SimpleBadUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleBadUnionStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SimpleBadUnionStruct type; - - eProsima_user_DllExport SimpleBadUnionStructPubSubType(); - - eProsima_user_DllExport ~SimpleBadUnionStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type SimplBadDiscUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimplBadDiscUnionStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SimplBadDiscUnionStruct type; - - eProsima_user_DllExport SimplBadDiscUnionStructPubSubType(); - - eProsima_user_DllExport ~SimplBadDiscUnionStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - -#endif // _FAST_DDS_GENERATED_TYPES_PUBSUBTYPES_H_ - diff --git a/test/unittest/xtypes/idl/TypesTypeObject.cxx b/test/unittest/xtypes/idl/TypesTypeObject.cxx deleted file mode 100644 index 8082634f979..00000000000 --- a/test/unittest/xtypes/idl/TypesTypeObject.cxx +++ /dev/null @@ -1,8990 +0,0 @@ -// 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 TypesTypeObject.cpp - * This source file contains the definition of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { char dummy; } -#endif - -#include "Types.h" -#include "TypesTypeObject.h" - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -using namespace eprosima::fastrtps::rtps; - -void registerTypesTypes() -{ - static std::once_flag once_flag; - std::call_once(once_flag, []() - { - TypeObjectFactory *factory = TypeObjectFactory::get_instance(); - factory->add_type_object("MyEnum", GetMyEnumIdentifier(true), - GetMyEnumObject(true)); - factory->add_type_object("MyEnum", GetMyEnumIdentifier(false), - GetMyEnumObject(false)); - - - factory->add_type_object("MyBadEnum", GetMyBadEnumIdentifier(true), - GetMyBadEnumObject(true)); - factory->add_type_object("MyBadEnum", GetMyBadEnumIdentifier(false), - GetMyBadEnumObject(false)); - - - factory->add_type_object("MyEnumStruct", GetMyEnumStructIdentifier(true), - GetMyEnumStructObject(true)); - factory->add_type_object("MyEnumStruct", GetMyEnumStructIdentifier(false), - GetMyEnumStructObject(false)); - - - factory->add_type_object("MyBadEnumStruct", GetMyBadEnumStructIdentifier(true), - GetMyBadEnumStructObject(true)); - factory->add_type_object("MyBadEnumStruct", GetMyBadEnumStructIdentifier(false), - GetMyBadEnumStructObject(false)); - - - factory->add_type_object("MyAliasEnum", GetMyAliasEnumIdentifier(true), - GetMyAliasEnumObject(true)); - factory->add_type_object("MyAliasEnum", GetMyAliasEnumIdentifier(false), - GetMyAliasEnumObject(false)); - - - factory->add_type_object("MyAliasEnumStruct", GetMyAliasEnumStructIdentifier(true), - GetMyAliasEnumStructObject(true)); - factory->add_type_object("MyAliasEnumStruct", GetMyAliasEnumStructIdentifier(false), - GetMyAliasEnumStructObject(false)); - - - factory->add_type_object("BasicStruct", GetBasicStructIdentifier(true), - GetBasicStructObject(true)); - factory->add_type_object("BasicStruct", GetBasicStructIdentifier(false), - GetBasicStructObject(false)); - - - factory->add_type_object("BasicNamesStruct", GetBasicNamesStructIdentifier(true), - GetBasicNamesStructObject(true)); - factory->add_type_object("BasicNamesStruct", GetBasicNamesStructIdentifier(false), - GetBasicNamesStructObject(false)); - - - factory->add_type_object("BasicBadStruct", GetBasicBadStructIdentifier(true), - GetBasicBadStructObject(true)); - factory->add_type_object("BasicBadStruct", GetBasicBadStructIdentifier(false), - GetBasicBadStructObject(false)); - - - factory->add_type_object("BasicWideStruct", GetBasicWideStructIdentifier(true), - GetBasicWideStructObject(true)); - factory->add_type_object("BasicWideStruct", GetBasicWideStructIdentifier(false), - GetBasicWideStructObject(false)); - - - factory->add_type_object("BadBasicWideStruct", GetBadBasicWideStructIdentifier(true), - GetBadBasicWideStructObject(true)); - factory->add_type_object("BadBasicWideStruct", GetBadBasicWideStructIdentifier(false), - GetBadBasicWideStructObject(false)); - - - factory->add_type_object("StringStruct", GetStringStructIdentifier(true), - GetStringStructObject(true)); - factory->add_type_object("StringStruct", GetStringStructIdentifier(false), - GetStringStructObject(false)); - - - factory->add_type_object("LargeStringStruct", GetLargeStringStructIdentifier(true), - GetLargeStringStructObject(true)); - factory->add_type_object("LargeStringStruct", GetLargeStringStructIdentifier(false), - GetLargeStringStructObject(false)); - - - factory->add_type_object("WStringStruct", GetWStringStructIdentifier(true), - GetWStringStructObject(true)); - factory->add_type_object("WStringStruct", GetWStringStructIdentifier(false), - GetWStringStructObject(false)); - - - factory->add_type_object("LargeWStringStruct", GetLargeWStringStructIdentifier(true), - GetLargeWStringStructObject(true)); - factory->add_type_object("LargeWStringStruct", GetLargeWStringStructIdentifier(false), - GetLargeWStringStructObject(false)); - - - factory->add_type_object("ArrayStruct", GetArrayStructIdentifier(true), - GetArrayStructObject(true)); - factory->add_type_object("ArrayStruct", GetArrayStructIdentifier(false), - GetArrayStructObject(false)); - - - factory->add_type_object("ArrayStructEqual", GetArrayStructEqualIdentifier(true), - GetArrayStructEqualObject(true)); - factory->add_type_object("ArrayStructEqual", GetArrayStructEqualIdentifier(false), - GetArrayStructEqualObject(false)); - - - factory->add_type_object("ArrayBadStruct", GetArrayBadStructIdentifier(true), - GetArrayBadStructObject(true)); - factory->add_type_object("ArrayBadStruct", GetArrayBadStructIdentifier(false), - GetArrayBadStructObject(false)); - - - factory->add_type_object("ArrayDimensionsStruct", GetArrayDimensionsStructIdentifier(true), - GetArrayDimensionsStructObject(true)); - factory->add_type_object("ArrayDimensionsStruct", GetArrayDimensionsStructIdentifier(false), - GetArrayDimensionsStructObject(false)); - - - factory->add_type_object("ArraySizeStruct", GetArraySizeStructIdentifier(true), - GetArraySizeStructObject(true)); - factory->add_type_object("ArraySizeStruct", GetArraySizeStructIdentifier(false), - GetArraySizeStructObject(false)); - - - factory->add_type_object("SequenceStruct", GetSequenceStructIdentifier(true), - GetSequenceStructObject(true)); - factory->add_type_object("SequenceStruct", GetSequenceStructIdentifier(false), - GetSequenceStructObject(false)); - - - factory->add_type_object("SequenceStructEqual", GetSequenceStructEqualIdentifier(true), - GetSequenceStructEqualObject(true)); - factory->add_type_object("SequenceStructEqual", GetSequenceStructEqualIdentifier(false), - GetSequenceStructEqualObject(false)); - - - factory->add_type_object("SequenceBadStruct", GetSequenceBadStructIdentifier(true), - GetSequenceBadStructObject(true)); - factory->add_type_object("SequenceBadStruct", GetSequenceBadStructIdentifier(false), - GetSequenceBadStructObject(false)); - - - factory->add_type_object("SequenceBoundsStruct", GetSequenceBoundsStructIdentifier(true), - GetSequenceBoundsStructObject(true)); - factory->add_type_object("SequenceBoundsStruct", GetSequenceBoundsStructIdentifier(false), - GetSequenceBoundsStructObject(false)); - - - factory->add_type_object("SequenceSequenceStruct", GetSequenceSequenceStructIdentifier(true), - GetSequenceSequenceStructObject(true)); - factory->add_type_object("SequenceSequenceStruct", GetSequenceSequenceStructIdentifier(false), - GetSequenceSequenceStructObject(false)); - - - factory->add_type_object("SequenceSequenceBoundsStruct", GetSequenceSequenceBoundsStructIdentifier(true), - GetSequenceSequenceBoundsStructObject(true)); - factory->add_type_object("SequenceSequenceBoundsStruct", GetSequenceSequenceBoundsStructIdentifier(false), - GetSequenceSequenceBoundsStructObject(false)); - - - factory->add_type_object("MapStruct", GetMapStructIdentifier(true), - GetMapStructObject(true)); - factory->add_type_object("MapStruct", GetMapStructIdentifier(false), - GetMapStructObject(false)); - - - factory->add_type_object("MapStructEqual", GetMapStructEqualIdentifier(true), - GetMapStructEqualObject(true)); - factory->add_type_object("MapStructEqual", GetMapStructEqualIdentifier(false), - GetMapStructEqualObject(false)); - - - factory->add_type_object("MapBadKeyStruct", GetMapBadKeyStructIdentifier(true), - GetMapBadKeyStructObject(true)); - factory->add_type_object("MapBadKeyStruct", GetMapBadKeyStructIdentifier(false), - GetMapBadKeyStructObject(false)); - - - factory->add_type_object("MapBadElemStruct", GetMapBadElemStructIdentifier(true), - GetMapBadElemStructObject(true)); - factory->add_type_object("MapBadElemStruct", GetMapBadElemStructIdentifier(false), - GetMapBadElemStructObject(false)); - - - factory->add_type_object("MapBoundsStruct", GetMapBoundsStructIdentifier(true), - GetMapBoundsStructObject(true)); - factory->add_type_object("MapBoundsStruct", GetMapBoundsStructIdentifier(false), - GetMapBoundsStructObject(false)); - - - factory->add_type_object("MapMapStruct", GetMapMapStructIdentifier(true), - GetMapMapStructObject(true)); - factory->add_type_object("MapMapStruct", GetMapMapStructIdentifier(false), - GetMapMapStructObject(false)); - - - factory->add_type_object("MapMapBoundsStruct", GetMapMapBoundsStructIdentifier(true), - GetMapMapBoundsStructObject(true)); - factory->add_type_object("MapMapBoundsStruct", GetMapMapBoundsStructIdentifier(false), - GetMapMapBoundsStructObject(false)); - - - factory->add_type_object("SimpleUnion", GetSimpleUnionIdentifier(true), - GetSimpleUnionObject(true)); - factory->add_type_object("SimpleUnion", GetSimpleUnionIdentifier(false), - GetSimpleUnionObject(false)); - - - factory->add_type_object("SimpleUnionNames", GetSimpleUnionNamesIdentifier(true), - GetSimpleUnionNamesObject(true)); - factory->add_type_object("SimpleUnionNames", GetSimpleUnionNamesIdentifier(false), - GetSimpleUnionNamesObject(false)); - - - factory->add_type_object("SimpleTypeUnion", GetSimpleTypeUnionIdentifier(true), - GetSimpleTypeUnionObject(true)); - factory->add_type_object("SimpleTypeUnion", GetSimpleTypeUnionIdentifier(false), - GetSimpleTypeUnionObject(false)); - - - factory->add_type_object("SimpleBadUnion", GetSimpleBadUnionIdentifier(true), - GetSimpleBadUnionObject(true)); - factory->add_type_object("SimpleBadUnion", GetSimpleBadUnionIdentifier(false), - GetSimpleBadUnionObject(false)); - - - factory->add_type_object("SimpleBadDiscUnion", GetSimpleBadDiscUnionIdentifier(true), - GetSimpleBadDiscUnionObject(true)); - factory->add_type_object("SimpleBadDiscUnion", GetSimpleBadDiscUnionIdentifier(false), - GetSimpleBadDiscUnionObject(false)); - - - factory->add_type_object("SimpleUnionStruct", GetSimpleUnionStructIdentifier(true), - GetSimpleUnionStructObject(true)); - factory->add_type_object("SimpleUnionStruct", GetSimpleUnionStructIdentifier(false), - GetSimpleUnionStructObject(false)); - - - factory->add_type_object("SimpleUnionStructEqual", GetSimpleUnionStructEqualIdentifier(true), - GetSimpleUnionStructEqualObject(true)); - factory->add_type_object("SimpleUnionStructEqual", GetSimpleUnionStructEqualIdentifier(false), - GetSimpleUnionStructEqualObject(false)); - - - factory->add_type_object("SimpleUnionNamesStruct", GetSimpleUnionNamesStructIdentifier(true), - GetSimpleUnionNamesStructObject(true)); - factory->add_type_object("SimpleUnionNamesStruct", GetSimpleUnionNamesStructIdentifier(false), - GetSimpleUnionNamesStructObject(false)); - - - factory->add_type_object("SimpleTypeUnionStruct", GetSimpleTypeUnionStructIdentifier(true), - GetSimpleTypeUnionStructObject(true)); - factory->add_type_object("SimpleTypeUnionStruct", GetSimpleTypeUnionStructIdentifier(false), - GetSimpleTypeUnionStructObject(false)); - - - factory->add_type_object("SimpleBadUnionStruct", GetSimpleBadUnionStructIdentifier(true), - GetSimpleBadUnionStructObject(true)); - factory->add_type_object("SimpleBadUnionStruct", GetSimpleBadUnionStructIdentifier(false), - GetSimpleBadUnionStructObject(false)); - - - factory->add_type_object("SimplBadDiscUnionStruct", GetSimplBadDiscUnionStructIdentifier(true), - GetSimplBadDiscUnionStructObject(true)); - factory->add_type_object("SimplBadDiscUnionStruct", GetSimplBadDiscUnionStructIdentifier(false), - GetSimplBadDiscUnionStructObject(false)); - - }); -} - -const TypeIdentifier* GetMyEnumIdentifier(bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyEnum", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyEnumObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyEnum", complete); -} - -const TypeObject* GetMyEnumObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnum", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyEnumObject(); - } - // else - return GetMinimalMyEnumObject(); -} - -const TypeObject* GetMinimalMyEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnum", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ENUM); - - // No flags apply - //type_object->minimal().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->minimal().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->minimal().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->minimal().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - - uint32_t value = 0; - MinimalEnumeratedLiteral mel_A; - mel_A.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_A.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_A.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_A.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_A.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_A.common().flags().IS_KEY(false); // Doesn't apply - mel_A.common().flags().IS_DEFAULT(false); - mel_A.common().value(value++); - MD5 A_hash("A"); - for(int i = 0; i < 4; ++i) - { - mel_A.detail().name_hash()[i] = A_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_A); - - MinimalEnumeratedLiteral mel_B; - mel_B.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_B.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_B.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_B.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_B.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_B.common().flags().IS_KEY(false); // Doesn't apply - mel_B.common().flags().IS_DEFAULT(false); - mel_B.common().value(value++); - MD5 B_hash("B"); - for(int i = 0; i < 4; ++i) - { - mel_B.detail().name_hash()[i] = B_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_B); - - MinimalEnumeratedLiteral mel_C; - mel_C.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_C.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_C.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_C.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_C.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_C.common().flags().IS_KEY(false); // Doesn't apply - mel_C.common().flags().IS_DEFAULT(false); - mel_C.common().value(value++); - MD5 C_hash("C"); - for(int i = 0; i < 4; ++i) - { - mel_C.detail().name_hash()[i] = C_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_C); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().enumerated_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyEnum", false); -} - -const TypeObject* GetCompleteMyEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnum", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ENUM); - - // No flags apply - //type_object->complete().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->complete().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->complete().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->complete().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - type_object->complete().enumerated_type().header().detail().type_name("MyEnum"); - - uint32_t value = 0; - CompleteEnumeratedLiteral cel_A; - cel_A.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_A.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_A.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_A.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_A.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_A.common().flags().IS_KEY(false); // Doesn't apply - cel_A.common().flags().IS_DEFAULT(false); - cel_A.common().value(value++); - cel_A.detail().name("A"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_A); - - CompleteEnumeratedLiteral cel_B; - cel_B.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_B.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_B.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_B.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_B.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_B.common().flags().IS_KEY(false); // Doesn't apply - cel_B.common().flags().IS_DEFAULT(false); - cel_B.common().value(value++); - cel_B.detail().name("B"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_B); - - CompleteEnumeratedLiteral cel_C; - cel_C.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_C.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_C.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_C.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_C.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_C.common().flags().IS_KEY(false); // Doesn't apply - cel_C.common().flags().IS_DEFAULT(false); - cel_C.common().value(value++); - cel_C.detail().name("C"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_C); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().enumerated_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyEnum", true); -} - -const TypeIdentifier* GetMyBadEnumIdentifier(bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyBadEnum", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyBadEnumObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyBadEnum", complete); -} - -const TypeObject* GetMyBadEnumObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBadEnum", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyBadEnumObject(); - } - // else - return GetMinimalMyBadEnumObject(); -} - -const TypeObject* GetMinimalMyBadEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBadEnum", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ENUM); - - // No flags apply - //type_object->minimal().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->minimal().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->minimal().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->minimal().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - - uint32_t value = 0; - MinimalEnumeratedLiteral mel_A1; - mel_A1.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_A1.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_A1.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_A1.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_A1.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_A1.common().flags().IS_KEY(false); // Doesn't apply - mel_A1.common().flags().IS_DEFAULT(false); - mel_A1.common().value(value++); - MD5 A1_hash("A1"); - for(int i = 0; i < 4; ++i) - { - mel_A1.detail().name_hash()[i] = A1_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_A1); - - MinimalEnumeratedLiteral mel_B1; - mel_B1.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_B1.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_B1.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_B1.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_B1.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_B1.common().flags().IS_KEY(false); // Doesn't apply - mel_B1.common().flags().IS_DEFAULT(false); - mel_B1.common().value(value++); - MD5 B1_hash("B1"); - for(int i = 0; i < 4; ++i) - { - mel_B1.detail().name_hash()[i] = B1_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_B1); - - MinimalEnumeratedLiteral mel_C1; - mel_C1.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_C1.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_C1.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_C1.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_C1.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_C1.common().flags().IS_KEY(false); // Doesn't apply - mel_C1.common().flags().IS_DEFAULT(false); - mel_C1.common().value(value++); - MD5 C1_hash("C1"); - for(int i = 0; i < 4; ++i) - { - mel_C1.detail().name_hash()[i] = C1_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_C1); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().enumerated_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyBadEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyBadEnum", false); -} - -const TypeObject* GetCompleteMyBadEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBadEnum", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ENUM); - - // No flags apply - //type_object->complete().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->complete().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->complete().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->complete().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - type_object->complete().enumerated_type().header().detail().type_name("MyBadEnum"); - - uint32_t value = 0; - CompleteEnumeratedLiteral cel_A1; - cel_A1.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_A1.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_A1.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_A1.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_A1.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_A1.common().flags().IS_KEY(false); // Doesn't apply - cel_A1.common().flags().IS_DEFAULT(false); - cel_A1.common().value(value++); - cel_A1.detail().name("A1"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_A1); - - CompleteEnumeratedLiteral cel_B1; - cel_B1.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_B1.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_B1.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_B1.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_B1.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_B1.common().flags().IS_KEY(false); // Doesn't apply - cel_B1.common().flags().IS_DEFAULT(false); - cel_B1.common().value(value++); - cel_B1.detail().name("B1"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_B1); - - CompleteEnumeratedLiteral cel_C1; - cel_C1.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_C1.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_C1.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_C1.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_C1.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_C1.common().flags().IS_KEY(false); // Doesn't apply - cel_C1.common().flags().IS_DEFAULT(false); - cel_C1.common().value(value++); - cel_C1.detail().name("C1"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_C1); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().enumerated_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyBadEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyBadEnum", true); -} - - - -const TypeIdentifier* GetMyEnumStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyEnumStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyEnumStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyEnumStruct", complete); -} - -const TypeObject* GetMyEnumStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnumStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyEnumStructObject(); - } - //else - return GetMinimalMyEnumStructObject(); -} - -const TypeObject* GetMinimalMyEnumStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnumStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_enum; - mst_my_enum.common().member_id(memberId++); - mst_my_enum.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_enum.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_enum.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_enum.common().member_flags().IS_OPTIONAL(false); - mst_my_enum.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_enum.common().member_flags().IS_KEY(false); - mst_my_enum.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_enum.common().member_type_id(*GetMyEnumIdentifier(false)); - - MD5 my_enum_hash("my_enum"); - for(int i = 0; i < 4; ++i) - { - mst_my_enum.detail().name_hash()[i] = my_enum_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_enum); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyEnumStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyEnumStruct", false); -} - -const TypeObject* GetCompleteMyEnumStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnumStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_enum; - cst_my_enum.common().member_id(memberId++); - cst_my_enum.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_enum.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_enum.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_enum.common().member_flags().IS_OPTIONAL(false); - cst_my_enum.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_enum.common().member_flags().IS_KEY(false); - cst_my_enum.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_enum.common().member_type_id(*GetMyEnumIdentifier(true)); - - cst_my_enum.detail().name("my_enum"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_enum); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MyEnumStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyEnumStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyEnumStruct", true); -} - - - -const TypeIdentifier* GetMyBadEnumStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyBadEnumStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyBadEnumStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyBadEnumStruct", complete); -} - -const TypeObject* GetMyBadEnumStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBadEnumStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyBadEnumStructObject(); - } - //else - return GetMinimalMyBadEnumStructObject(); -} - -const TypeObject* GetMinimalMyBadEnumStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBadEnumStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_enum; - mst_my_enum.common().member_id(memberId++); - mst_my_enum.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_enum.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_enum.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_enum.common().member_flags().IS_OPTIONAL(false); - mst_my_enum.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_enum.common().member_flags().IS_KEY(false); - mst_my_enum.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_enum.common().member_type_id(*GetMyBadEnumIdentifier(false)); - - MD5 my_enum_hash("my_enum"); - for(int i = 0; i < 4; ++i) - { - mst_my_enum.detail().name_hash()[i] = my_enum_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_enum); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyBadEnumStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyBadEnumStruct", false); -} - -const TypeObject* GetCompleteMyBadEnumStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBadEnumStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_enum; - cst_my_enum.common().member_id(memberId++); - cst_my_enum.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_enum.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_enum.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_enum.common().member_flags().IS_OPTIONAL(false); - cst_my_enum.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_enum.common().member_flags().IS_KEY(false); - cst_my_enum.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_enum.common().member_type_id(*GetMyBadEnumIdentifier(true)); - - cst_my_enum.detail().name("my_enum"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_enum); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MyBadEnumStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyBadEnumStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyBadEnumStruct", true); -} - -const TypeIdentifier* GetMyAliasEnumIdentifier(bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyAliasEnum", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyAliasEnumObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyAliasEnum", complete); -} - -const TypeObject* GetMyAliasEnumObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyAliasEnumObject(); - } - else - { - return GetMinimalMyAliasEnumObject(); - } -} - -const TypeObject* GetMinimalMyAliasEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ALIAS); - - // No flags apply - //type_object->minimal().alias_type().alias_flags().IS_FINAL(false); - //type_object->minimal().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_NESTED(false); - //type_object->minimal().alias_type().alias_flags().IS_AUTOID_HASH(false); - - // type_object->minimal().alias_type().header()... Is empty - - // No flags apply - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_DEFAULT(false); - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier("MyEnum", false); - - - if (relatedType != nullptr) - { - type_object->minimal().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MyAliasEnum", "MyEnum"); - - TypeObjectFactory::get_instance()->add_type_object("MyAliasEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", false); -} - -const TypeObject* GetCompleteMyAliasEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ALIAS); - - // No flags apply - //type_object->complete().alias_type().alias_flags().IS_FINAL(false); - //type_object->complete().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->complete().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->complete().alias_type().alias_flags().IS_NESTED(false); - //type_object->complete().alias_type().alias_flags().IS_AUTOID_HASH(false); - - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().placement("placement"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().language("language"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().text("text"); - //type_object->complete().alias_type().header().detail().ann_custom().push_back(...); - type_object->complete().alias_type().header().detail().type_name("MyAliasEnum"); - - // No flags apply - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->complete().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->complete().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->complete().alias_type().body().common().related_flags().IS_DEFAULT(false); - - //type_object->complete().alias_type().body().common().ann_builtin() - //type_object->complete().alias_type().body().common().ann_custom() - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("MyEnum"); - - - if (relatedType != nullptr) - { - type_object->complete().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MyAliasEnum", "MyEnum"); - - TypeObjectFactory::get_instance()->add_type_object("MyAliasEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", true); -} - - - -const TypeIdentifier* GetMyAliasEnumStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyAliasEnumStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyAliasEnumStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyAliasEnumStruct", complete); -} - -const TypeObject* GetMyAliasEnumStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnumStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyAliasEnumStructObject(); - } - //else - return GetMinimalMyAliasEnumStructObject(); -} - -const TypeObject* GetMinimalMyAliasEnumStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnumStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_enum; - mst_my_enum.common().member_id(memberId++); - mst_my_enum.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_enum.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_enum.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_enum.common().member_flags().IS_OPTIONAL(false); - mst_my_enum.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_enum.common().member_flags().IS_KEY(false); - mst_my_enum.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_enum.common().member_type_id(*GetMyAliasEnumIdentifier(false)); - - MD5 my_enum_hash("my_enum"); - for(int i = 0; i < 4; ++i) - { - mst_my_enum.detail().name_hash()[i] = my_enum_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_enum); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyAliasEnumStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyAliasEnumStruct", false); -} - -const TypeObject* GetCompleteMyAliasEnumStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnumStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_enum; - cst_my_enum.common().member_id(memberId++); - cst_my_enum.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_enum.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_enum.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_enum.common().member_flags().IS_OPTIONAL(false); - cst_my_enum.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_enum.common().member_flags().IS_KEY(false); - cst_my_enum.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_enum.common().member_type_id(*GetMyAliasEnumIdentifier(true)); - - cst_my_enum.detail().name("my_enum"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_enum); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MyAliasEnumStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyAliasEnumStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyAliasEnumStruct", true); -} - - - -const TypeIdentifier* GetBasicStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BasicStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetBasicStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("BasicStruct", complete); -} - -const TypeObject* GetBasicStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteBasicStructObject(); - } - //else - return GetMinimalBasicStructObject(); -} - -const TypeObject* GetMinimalBasicStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_bool; - mst_my_bool.common().member_id(memberId++); - mst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_bool.common().member_flags().IS_OPTIONAL(false); - mst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_bool.common().member_flags().IS_KEY(false); - mst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - MD5 my_bool_hash("my_bool"); - for(int i = 0; i < 4; ++i) - { - mst_my_bool.detail().name_hash()[i] = my_bool_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_bool); - - MinimalStructMember mst_my_int32; - mst_my_int32.common().member_id(memberId++); - mst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_int32.common().member_flags().IS_OPTIONAL(false); - mst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_int32.common().member_flags().IS_KEY(false); - mst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 my_int32_hash("my_int32"); - for(int i = 0; i < 4; ++i) - { - mst_my_int32.detail().name_hash()[i] = my_int32_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_int32); - - MinimalStructMember mst_my_string; - mst_my_string.common().member_id(memberId++); - mst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_string.common().member_flags().IS_OPTIONAL(false); - mst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_string.common().member_flags().IS_KEY(false); - mst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 my_string_hash("my_string"); - for(int i = 0; i < 4; ++i) - { - mst_my_string.detail().name_hash()[i] = my_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_string); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicStruct", false); -} - -const TypeObject* GetCompleteBasicStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_bool; - cst_my_bool.common().member_id(memberId++); - cst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_bool.common().member_flags().IS_OPTIONAL(false); - cst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_bool.common().member_flags().IS_KEY(false); - cst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - cst_my_bool.detail().name("my_bool"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_bool); - - CompleteStructMember cst_my_int32; - cst_my_int32.common().member_id(memberId++); - cst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_int32.common().member_flags().IS_OPTIONAL(false); - cst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_int32.common().member_flags().IS_KEY(false); - cst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_my_int32.detail().name("my_int32"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_int32); - - CompleteStructMember cst_my_string; - cst_my_string.common().member_id(memberId++); - cst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_string.common().member_flags().IS_OPTIONAL(false); - cst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_string.common().member_flags().IS_KEY(false); - cst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_my_string.detail().name("my_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_string); - - - // Header - type_object->complete().struct_type().header().detail().type_name("BasicStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicStruct", true); -} - - - -const TypeIdentifier* GetBasicNamesStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BasicNamesStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetBasicNamesStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("BasicNamesStruct", complete); -} - -const TypeObject* GetBasicNamesStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicNamesStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteBasicNamesStructObject(); - } - //else - return GetMinimalBasicNamesStructObject(); -} - -const TypeObject* GetMinimalBasicNamesStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicNamesStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_bool_name; - mst_my_bool_name.common().member_id(memberId++); - mst_my_bool_name.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_bool_name.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_bool_name.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_bool_name.common().member_flags().IS_OPTIONAL(false); - mst_my_bool_name.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_bool_name.common().member_flags().IS_KEY(false); - mst_my_bool_name.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_bool_name.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - MD5 my_bool_name_hash("my_bool_name"); - for(int i = 0; i < 4; ++i) - { - mst_my_bool_name.detail().name_hash()[i] = my_bool_name_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_bool_name); - - MinimalStructMember mst_my_int32_name; - mst_my_int32_name.common().member_id(memberId++); - mst_my_int32_name.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_int32_name.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_int32_name.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_int32_name.common().member_flags().IS_OPTIONAL(false); - mst_my_int32_name.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_int32_name.common().member_flags().IS_KEY(false); - mst_my_int32_name.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_int32_name.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 my_int32_name_hash("my_int32_name"); - for(int i = 0; i < 4; ++i) - { - mst_my_int32_name.detail().name_hash()[i] = my_int32_name_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_int32_name); - - MinimalStructMember mst_my_string_name; - mst_my_string_name.common().member_id(memberId++); - mst_my_string_name.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_string_name.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_string_name.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_string_name.common().member_flags().IS_OPTIONAL(false); - mst_my_string_name.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_string_name.common().member_flags().IS_KEY(false); - mst_my_string_name.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_string_name.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 my_string_name_hash("my_string_name"); - for(int i = 0; i < 4; ++i) - { - mst_my_string_name.detail().name_hash()[i] = my_string_name_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_string_name); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicNamesStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicNamesStruct", false); -} - -const TypeObject* GetCompleteBasicNamesStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicNamesStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_bool_name; - cst_my_bool_name.common().member_id(memberId++); - cst_my_bool_name.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_bool_name.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_bool_name.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_bool_name.common().member_flags().IS_OPTIONAL(false); - cst_my_bool_name.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_bool_name.common().member_flags().IS_KEY(false); - cst_my_bool_name.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_bool_name.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - cst_my_bool_name.detail().name("my_bool_name"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_bool_name); - - CompleteStructMember cst_my_int32_name; - cst_my_int32_name.common().member_id(memberId++); - cst_my_int32_name.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_int32_name.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_int32_name.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_int32_name.common().member_flags().IS_OPTIONAL(false); - cst_my_int32_name.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_int32_name.common().member_flags().IS_KEY(false); - cst_my_int32_name.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_int32_name.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_my_int32_name.detail().name("my_int32_name"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_int32_name); - - CompleteStructMember cst_my_string_name; - cst_my_string_name.common().member_id(memberId++); - cst_my_string_name.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_string_name.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_string_name.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_string_name.common().member_flags().IS_OPTIONAL(false); - cst_my_string_name.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_string_name.common().member_flags().IS_KEY(false); - cst_my_string_name.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_string_name.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_my_string_name.detail().name("my_string_name"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_string_name); - - - // Header - type_object->complete().struct_type().header().detail().type_name("BasicNamesStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicNamesStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicNamesStruct", true); -} - - - -const TypeIdentifier* GetBasicBadStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BasicBadStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetBasicBadStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("BasicBadStruct", complete); -} - -const TypeObject* GetBasicBadStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicBadStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteBasicBadStructObject(); - } - //else - return GetMinimalBasicBadStructObject(); -} - -const TypeObject* GetMinimalBasicBadStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicBadStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_bool; - mst_my_bool.common().member_id(memberId++); - mst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_bool.common().member_flags().IS_OPTIONAL(false); - mst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_bool.common().member_flags().IS_KEY(false); - mst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - - MD5 my_bool_hash("my_bool"); - for(int i = 0; i < 4; ++i) - { - mst_my_bool.detail().name_hash()[i] = my_bool_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_bool); - - MinimalStructMember mst_my_int32; - mst_my_int32.common().member_id(memberId++); - mst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_int32.common().member_flags().IS_OPTIONAL(false); - mst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_int32.common().member_flags().IS_KEY(false); - mst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 my_int32_hash("my_int32"); - for(int i = 0; i < 4; ++i) - { - mst_my_int32.detail().name_hash()[i] = my_int32_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_int32); - - MinimalStructMember mst_my_string; - mst_my_string.common().member_id(memberId++); - mst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_string.common().member_flags().IS_OPTIONAL(false); - mst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_string.common().member_flags().IS_KEY(false); - mst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 my_string_hash("my_string"); - for(int i = 0; i < 4; ++i) - { - mst_my_string.detail().name_hash()[i] = my_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_string); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicBadStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicBadStruct", false); -} - -const TypeObject* GetCompleteBasicBadStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicBadStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_bool; - cst_my_bool.common().member_id(memberId++); - cst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_bool.common().member_flags().IS_OPTIONAL(false); - cst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_bool.common().member_flags().IS_KEY(false); - cst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - - cst_my_bool.detail().name("my_bool"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_bool); - - CompleteStructMember cst_my_int32; - cst_my_int32.common().member_id(memberId++); - cst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_int32.common().member_flags().IS_OPTIONAL(false); - cst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_int32.common().member_flags().IS_KEY(false); - cst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_my_int32.detail().name("my_int32"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_int32); - - CompleteStructMember cst_my_string; - cst_my_string.common().member_id(memberId++); - cst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_string.common().member_flags().IS_OPTIONAL(false); - cst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_string.common().member_flags().IS_KEY(false); - cst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_my_string.detail().name("my_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_string); - - - // Header - type_object->complete().struct_type().header().detail().type_name("BasicBadStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicBadStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicBadStruct", true); -} - - - -const TypeIdentifier* GetBasicWideStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BasicWideStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetBasicWideStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("BasicWideStruct", complete); -} - -const TypeObject* GetBasicWideStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicWideStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteBasicWideStructObject(); - } - //else - return GetMinimalBasicWideStructObject(); -} - -const TypeObject* GetMinimalBasicWideStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicWideStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_bool; - mst_my_bool.common().member_id(memberId++); - mst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_bool.common().member_flags().IS_OPTIONAL(false); - mst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_bool.common().member_flags().IS_KEY(false); - mst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - MD5 my_bool_hash("my_bool"); - for(int i = 0; i < 4; ++i) - { - mst_my_bool.detail().name_hash()[i] = my_bool_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_bool); - - MinimalStructMember mst_my_int32; - mst_my_int32.common().member_id(memberId++); - mst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_int32.common().member_flags().IS_OPTIONAL(false); - mst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_int32.common().member_flags().IS_KEY(false); - mst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 my_int32_hash("my_int32"); - for(int i = 0; i < 4; ++i) - { - mst_my_int32.detail().name_hash()[i] = my_int32_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_int32); - - MinimalStructMember mst_my_string; - mst_my_string.common().member_id(memberId++); - mst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_string.common().member_flags().IS_OPTIONAL(false); - mst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_string.common().member_flags().IS_KEY(false); - mst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 my_string_hash("my_string"); - for(int i = 0; i < 4; ++i) - { - mst_my_string.detail().name_hash()[i] = my_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_string); - - MinimalStructMember mst_new_int32; - mst_new_int32.common().member_id(memberId++); - mst_new_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_new_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_new_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_new_int32.common().member_flags().IS_OPTIONAL(false); - mst_new_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_new_int32.common().member_flags().IS_KEY(false); - mst_new_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_new_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 new_int32_hash("new_int32"); - for(int i = 0; i < 4; ++i) - { - mst_new_int32.detail().name_hash()[i] = new_int32_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_new_int32); - - MinimalStructMember mst_new_string; - mst_new_string.common().member_id(memberId++); - mst_new_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_new_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_new_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_new_string.common().member_flags().IS_OPTIONAL(false); - mst_new_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_new_string.common().member_flags().IS_KEY(false); - mst_new_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_new_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 new_string_hash("new_string"); - for(int i = 0; i < 4; ++i) - { - mst_new_string.detail().name_hash()[i] = new_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_new_string); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicWideStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicWideStruct", false); -} - -const TypeObject* GetCompleteBasicWideStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicWideStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_bool; - cst_my_bool.common().member_id(memberId++); - cst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_bool.common().member_flags().IS_OPTIONAL(false); - cst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_bool.common().member_flags().IS_KEY(false); - cst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - cst_my_bool.detail().name("my_bool"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_bool); - - CompleteStructMember cst_my_int32; - cst_my_int32.common().member_id(memberId++); - cst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_int32.common().member_flags().IS_OPTIONAL(false); - cst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_int32.common().member_flags().IS_KEY(false); - cst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_my_int32.detail().name("my_int32"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_int32); - - CompleteStructMember cst_my_string; - cst_my_string.common().member_id(memberId++); - cst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_string.common().member_flags().IS_OPTIONAL(false); - cst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_string.common().member_flags().IS_KEY(false); - cst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_my_string.detail().name("my_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_string); - - CompleteStructMember cst_new_int32; - cst_new_int32.common().member_id(memberId++); - cst_new_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_new_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_new_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_new_int32.common().member_flags().IS_OPTIONAL(false); - cst_new_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_new_int32.common().member_flags().IS_KEY(false); - cst_new_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_new_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_new_int32.detail().name("new_int32"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_new_int32); - - CompleteStructMember cst_new_string; - cst_new_string.common().member_id(memberId++); - cst_new_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_new_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_new_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_new_string.common().member_flags().IS_OPTIONAL(false); - cst_new_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_new_string.common().member_flags().IS_KEY(false); - cst_new_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_new_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_new_string.detail().name("new_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_new_string); - - - // Header - type_object->complete().struct_type().header().detail().type_name("BasicWideStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicWideStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicWideStruct", true); -} - - - -const TypeIdentifier* GetBadBasicWideStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BadBasicWideStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetBadBasicWideStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("BadBasicWideStruct", complete); -} - -const TypeObject* GetBadBasicWideStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BadBasicWideStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteBadBasicWideStructObject(); - } - //else - return GetMinimalBadBasicWideStructObject(); -} - -const TypeObject* GetMinimalBadBasicWideStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BadBasicWideStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_new_int32; - mst_new_int32.common().member_id(memberId++); - mst_new_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_new_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_new_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_new_int32.common().member_flags().IS_OPTIONAL(false); - mst_new_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_new_int32.common().member_flags().IS_KEY(false); - mst_new_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_new_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 new_int32_hash("new_int32"); - for(int i = 0; i < 4; ++i) - { - mst_new_int32.detail().name_hash()[i] = new_int32_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_new_int32); - - MinimalStructMember mst_new_string; - mst_new_string.common().member_id(memberId++); - mst_new_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_new_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_new_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_new_string.common().member_flags().IS_OPTIONAL(false); - mst_new_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_new_string.common().member_flags().IS_KEY(false); - mst_new_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_new_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 new_string_hash("new_string"); - for(int i = 0; i < 4; ++i) - { - mst_new_string.detail().name_hash()[i] = new_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_new_string); - - MinimalStructMember mst_my_bool; - mst_my_bool.common().member_id(memberId++); - mst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_bool.common().member_flags().IS_OPTIONAL(false); - mst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_bool.common().member_flags().IS_KEY(false); - mst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - MD5 my_bool_hash("my_bool"); - for(int i = 0; i < 4; ++i) - { - mst_my_bool.detail().name_hash()[i] = my_bool_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_bool); - - MinimalStructMember mst_my_int32; - mst_my_int32.common().member_id(memberId++); - mst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_int32.common().member_flags().IS_OPTIONAL(false); - mst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_int32.common().member_flags().IS_KEY(false); - mst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 my_int32_hash("my_int32"); - for(int i = 0; i < 4; ++i) - { - mst_my_int32.detail().name_hash()[i] = my_int32_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_int32); - - MinimalStructMember mst_my_string; - mst_my_string.common().member_id(memberId++); - mst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_string.common().member_flags().IS_OPTIONAL(false); - mst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_string.common().member_flags().IS_KEY(false); - mst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 my_string_hash("my_string"); - for(int i = 0; i < 4; ++i) - { - mst_my_string.detail().name_hash()[i] = my_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_string); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BadBasicWideStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BadBasicWideStruct", false); -} - -const TypeObject* GetCompleteBadBasicWideStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BadBasicWideStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_new_int32; - cst_new_int32.common().member_id(memberId++); - cst_new_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_new_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_new_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_new_int32.common().member_flags().IS_OPTIONAL(false); - cst_new_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_new_int32.common().member_flags().IS_KEY(false); - cst_new_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_new_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_new_int32.detail().name("new_int32"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_new_int32); - - CompleteStructMember cst_new_string; - cst_new_string.common().member_id(memberId++); - cst_new_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_new_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_new_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_new_string.common().member_flags().IS_OPTIONAL(false); - cst_new_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_new_string.common().member_flags().IS_KEY(false); - cst_new_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_new_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_new_string.detail().name("new_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_new_string); - - CompleteStructMember cst_my_bool; - cst_my_bool.common().member_id(memberId++); - cst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_bool.common().member_flags().IS_OPTIONAL(false); - cst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_bool.common().member_flags().IS_KEY(false); - cst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - cst_my_bool.detail().name("my_bool"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_bool); - - CompleteStructMember cst_my_int32; - cst_my_int32.common().member_id(memberId++); - cst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_int32.common().member_flags().IS_OPTIONAL(false); - cst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_int32.common().member_flags().IS_KEY(false); - cst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_my_int32.detail().name("my_int32"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_int32); - - CompleteStructMember cst_my_string; - cst_my_string.common().member_id(memberId++); - cst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_string.common().member_flags().IS_OPTIONAL(false); - cst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_string.common().member_flags().IS_KEY(false); - cst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_my_string.detail().name("my_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_string); - - - // Header - type_object->complete().struct_type().header().detail().type_name("BadBasicWideStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BadBasicWideStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BadBasicWideStruct", true); -} - - - -const TypeIdentifier* GetStringStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("StringStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetStringStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("StringStruct", complete); -} - -const TypeObject* GetStringStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("StringStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteStringStructObject(); - } - //else - return GetMinimalStringStructObject(); -} - -const TypeObject* GetMinimalStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("StringStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_string; - mst_my_string.common().member_id(memberId++); - mst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_string.common().member_flags().IS_OPTIONAL(false); - mst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_string.common().member_flags().IS_KEY(false); - mst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 my_string_hash("my_string"); - for(int i = 0; i < 4; ++i) - { - mst_my_string.detail().name_hash()[i] = my_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_string); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("StringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("StringStruct", false); -} - -const TypeObject* GetCompleteStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("StringStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_string; - cst_my_string.common().member_id(memberId++); - cst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_string.common().member_flags().IS_OPTIONAL(false); - cst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_string.common().member_flags().IS_KEY(false); - cst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_my_string.detail().name("my_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_string); - - - // Header - type_object->complete().struct_type().header().detail().type_name("StringStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("StringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("StringStruct", true); -} - - - -const TypeIdentifier* GetLargeStringStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("LargeStringStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetLargeStringStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("LargeStringStruct", complete); -} - -const TypeObject* GetLargeStringStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LargeStringStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteLargeStringStructObject(); - } - //else - return GetMinimalLargeStringStructObject(); -} - -const TypeObject* GetMinimalLargeStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LargeStringStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_large_string; - mst_my_large_string.common().member_id(memberId++); - mst_my_large_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_large_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_large_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_large_string.common().member_flags().IS_OPTIONAL(false); - mst_my_large_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_large_string.common().member_flags().IS_KEY(false); - mst_my_large_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_large_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(41925, false)); - - MD5 my_large_string_hash("my_large_string"); - for(int i = 0; i < 4; ++i) - { - mst_my_large_string.detail().name_hash()[i] = my_large_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_large_string); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("LargeStringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("LargeStringStruct", false); -} - -const TypeObject* GetCompleteLargeStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LargeStringStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_large_string; - cst_my_large_string.common().member_id(memberId++); - cst_my_large_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_large_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_large_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_large_string.common().member_flags().IS_OPTIONAL(false); - cst_my_large_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_large_string.common().member_flags().IS_KEY(false); - cst_my_large_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_large_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(41925, false)); - - cst_my_large_string.detail().name("my_large_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_large_string); - - - // Header - type_object->complete().struct_type().header().detail().type_name("LargeStringStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("LargeStringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("LargeStringStruct", true); -} - - - -const TypeIdentifier* GetWStringStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("WStringStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetWStringStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("WStringStruct", complete); -} - -const TypeObject* GetWStringStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("WStringStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteWStringStructObject(); - } - //else - return GetMinimalWStringStructObject(); -} - -const TypeObject* GetMinimalWStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("WStringStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_wstring; - mst_my_wstring.common().member_id(memberId++); - mst_my_wstring.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_wstring.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_wstring.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_wstring.common().member_flags().IS_OPTIONAL(false); - mst_my_wstring.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_wstring.common().member_flags().IS_KEY(false); - mst_my_wstring.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_wstring.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, true)); - - MD5 my_wstring_hash("my_wstring"); - for(int i = 0; i < 4; ++i) - { - mst_my_wstring.detail().name_hash()[i] = my_wstring_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_wstring); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("WStringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("WStringStruct", false); -} - -const TypeObject* GetCompleteWStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("WStringStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_wstring; - cst_my_wstring.common().member_id(memberId++); - cst_my_wstring.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_wstring.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_wstring.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_wstring.common().member_flags().IS_OPTIONAL(false); - cst_my_wstring.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_wstring.common().member_flags().IS_KEY(false); - cst_my_wstring.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_wstring.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, true)); - - cst_my_wstring.detail().name("my_wstring"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_wstring); - - - // Header - type_object->complete().struct_type().header().detail().type_name("WStringStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("WStringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("WStringStruct", true); -} - - - -const TypeIdentifier* GetLargeWStringStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("LargeWStringStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetLargeWStringStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("LargeWStringStruct", complete); -} - -const TypeObject* GetLargeWStringStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LargeWStringStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteLargeWStringStructObject(); - } - //else - return GetMinimalLargeWStringStructObject(); -} - -const TypeObject* GetMinimalLargeWStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LargeWStringStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_large_wstring; - mst_my_large_wstring.common().member_id(memberId++); - mst_my_large_wstring.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_large_wstring.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_large_wstring.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_large_wstring.common().member_flags().IS_OPTIONAL(false); - mst_my_large_wstring.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_large_wstring.common().member_flags().IS_KEY(false); - mst_my_large_wstring.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_large_wstring.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(41925, true)); - - MD5 my_large_wstring_hash("my_large_wstring"); - for(int i = 0; i < 4; ++i) - { - mst_my_large_wstring.detail().name_hash()[i] = my_large_wstring_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_large_wstring); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("LargeWStringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("LargeWStringStruct", false); -} - -const TypeObject* GetCompleteLargeWStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LargeWStringStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_large_wstring; - cst_my_large_wstring.common().member_id(memberId++); - cst_my_large_wstring.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_large_wstring.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_large_wstring.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_large_wstring.common().member_flags().IS_OPTIONAL(false); - cst_my_large_wstring.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_large_wstring.common().member_flags().IS_KEY(false); - cst_my_large_wstring.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_large_wstring.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(41925, true)); - - cst_my_large_wstring.detail().name("my_large_wstring"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_large_wstring); - - - // Header - type_object->complete().struct_type().header().detail().type_name("LargeWStringStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("LargeWStringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("LargeWStringStruct", true); -} - - - -const TypeIdentifier* GetArrayStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArrayStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetArrayStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("ArrayStruct", complete); -} - -const TypeObject* GetArrayStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteArrayStructObject(); - } - //else - return GetMinimalArrayStructObject(); -} - -const TypeObject* GetMinimalArrayStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_array; - mst_my_array.common().member_id(memberId++); - mst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_array.common().member_flags().IS_OPTIONAL(false); - mst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_array.common().member_flags().IS_KEY(false); - mst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {2}, false)); - - MD5 my_array_hash("my_array"); - for(int i = 0; i < 4; ++i) - { - mst_my_array.detail().name_hash()[i] = my_array_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_array); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayStruct", false); -} - -const TypeObject* GetCompleteArrayStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_array; - cst_my_array.common().member_id(memberId++); - cst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_array.common().member_flags().IS_OPTIONAL(false); - cst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_array.common().member_flags().IS_KEY(false); - cst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {2}, true)); - - cst_my_array.detail().name("my_array"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_array); - - - // Header - type_object->complete().struct_type().header().detail().type_name("ArrayStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayStruct", true); -} - - - -const TypeIdentifier* GetArrayStructEqualIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArrayStructEqual", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetArrayStructEqualObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("ArrayStructEqual", complete); -} - -const TypeObject* GetArrayStructEqualObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayStructEqual", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteArrayStructEqualObject(); - } - //else - return GetMinimalArrayStructEqualObject(); -} - -const TypeObject* GetMinimalArrayStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayStructEqual", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_array_equal; - mst_my_array_equal.common().member_id(memberId++); - mst_my_array_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_array_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_array_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_array_equal.common().member_flags().IS_OPTIONAL(false); - mst_my_array_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_array_equal.common().member_flags().IS_KEY(false); - mst_my_array_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_array_equal.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {2}, false)); - - MD5 my_array_equal_hash("my_array_equal"); - for(int i = 0; i < 4; ++i) - { - mst_my_array_equal.detail().name_hash()[i] = my_array_equal_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_array_equal); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayStructEqual", false); -} - -const TypeObject* GetCompleteArrayStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayStructEqual", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_array_equal; - cst_my_array_equal.common().member_id(memberId++); - cst_my_array_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_array_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_array_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_array_equal.common().member_flags().IS_OPTIONAL(false); - cst_my_array_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_array_equal.common().member_flags().IS_KEY(false); - cst_my_array_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_array_equal.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {2}, true)); - - cst_my_array_equal.detail().name("my_array_equal"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_array_equal); - - - // Header - type_object->complete().struct_type().header().detail().type_name("ArrayStructEqual"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayStructEqual", true); -} - - - -const TypeIdentifier* GetArrayBadStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArrayBadStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetArrayBadStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("ArrayBadStruct", complete); -} - -const TypeObject* GetArrayBadStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayBadStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteArrayBadStructObject(); - } - //else - return GetMinimalArrayBadStructObject(); -} - -const TypeObject* GetMinimalArrayBadStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayBadStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_array; - mst_my_array.common().member_id(memberId++); - mst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_array.common().member_flags().IS_OPTIONAL(false); - mst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_array.common().member_flags().IS_KEY(false); - mst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint8_t", {2}, false)); - - MD5 my_array_hash("my_array"); - for(int i = 0; i < 4; ++i) - { - mst_my_array.detail().name_hash()[i] = my_array_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_array); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayBadStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayBadStruct", false); -} - -const TypeObject* GetCompleteArrayBadStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayBadStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_array; - cst_my_array.common().member_id(memberId++); - cst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_array.common().member_flags().IS_OPTIONAL(false); - cst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_array.common().member_flags().IS_KEY(false); - cst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint8_t", {2}, true)); - - cst_my_array.detail().name("my_array"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_array); - - - // Header - type_object->complete().struct_type().header().detail().type_name("ArrayBadStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayBadStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayBadStruct", true); -} - - - -const TypeIdentifier* GetArrayDimensionsStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArrayDimensionsStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetArrayDimensionsStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("ArrayDimensionsStruct", complete); -} - -const TypeObject* GetArrayDimensionsStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayDimensionsStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteArrayDimensionsStructObject(); - } - //else - return GetMinimalArrayDimensionsStructObject(); -} - -const TypeObject* GetMinimalArrayDimensionsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayDimensionsStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_array; - mst_my_array.common().member_id(memberId++); - mst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_array.common().member_flags().IS_OPTIONAL(false); - mst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_array.common().member_flags().IS_KEY(false); - mst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {2, 2}, false)); - - MD5 my_array_hash("my_array"); - for(int i = 0; i < 4; ++i) - { - mst_my_array.detail().name_hash()[i] = my_array_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_array); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayDimensionsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayDimensionsStruct", false); -} - -const TypeObject* GetCompleteArrayDimensionsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayDimensionsStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_array; - cst_my_array.common().member_id(memberId++); - cst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_array.common().member_flags().IS_OPTIONAL(false); - cst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_array.common().member_flags().IS_KEY(false); - cst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {2, 2}, true)); - - cst_my_array.detail().name("my_array"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_array); - - - // Header - type_object->complete().struct_type().header().detail().type_name("ArrayDimensionsStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayDimensionsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayDimensionsStruct", true); -} - - - -const TypeIdentifier* GetArraySizeStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArraySizeStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetArraySizeStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("ArraySizeStruct", complete); -} - -const TypeObject* GetArraySizeStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArraySizeStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteArraySizeStructObject(); - } - //else - return GetMinimalArraySizeStructObject(); -} - -const TypeObject* GetMinimalArraySizeStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArraySizeStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_array; - mst_my_array.common().member_id(memberId++); - mst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_array.common().member_flags().IS_OPTIONAL(false); - mst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_array.common().member_flags().IS_KEY(false); - mst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {5}, false)); - - MD5 my_array_hash("my_array"); - for(int i = 0; i < 4; ++i) - { - mst_my_array.detail().name_hash()[i] = my_array_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_array); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArraySizeStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArraySizeStruct", false); -} - -const TypeObject* GetCompleteArraySizeStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArraySizeStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_array; - cst_my_array.common().member_id(memberId++); - cst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_array.common().member_flags().IS_OPTIONAL(false); - cst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_array.common().member_flags().IS_KEY(false); - cst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {5}, true)); - - cst_my_array.detail().name("my_array"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_array); - - - // Header - type_object->complete().struct_type().header().detail().type_name("ArraySizeStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArraySizeStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArraySizeStruct", true); -} - - - - - -const TypeIdentifier* GetSequenceStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSequenceStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SequenceStruct", complete); -} - -const TypeObject* GetSequenceStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSequenceStructObject(); - } - //else - return GetMinimalSequenceStructObject(); -} - -const TypeObject* GetMinimalSequenceStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_sequence; - mst_my_sequence.common().member_id(memberId++); - mst_my_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_sequence.common().member_flags().IS_OPTIONAL(false); - mst_my_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_sequence.common().member_flags().IS_KEY(false); - mst_my_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", 2, false)); - - MD5 my_sequence_hash("my_sequence"); - for(int i = 0; i < 4; ++i) - { - mst_my_sequence.detail().name_hash()[i] = my_sequence_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_sequence); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceStruct", false); -} - -const TypeObject* GetCompleteSequenceStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_sequence; - cst_my_sequence.common().member_id(memberId++); - cst_my_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_sequence.common().member_flags().IS_OPTIONAL(false); - cst_my_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_sequence.common().member_flags().IS_KEY(false); - cst_my_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", 2, true)); - - cst_my_sequence.detail().name("my_sequence"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_sequence); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SequenceStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceStruct", true); -} - - - - - -const TypeIdentifier* GetSequenceStructEqualIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceStructEqual", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSequenceStructEqualObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SequenceStructEqual", complete); -} - -const TypeObject* GetSequenceStructEqualObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceStructEqual", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSequenceStructEqualObject(); - } - //else - return GetMinimalSequenceStructEqualObject(); -} - -const TypeObject* GetMinimalSequenceStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceStructEqual", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_sequence_equal; - mst_my_sequence_equal.common().member_id(memberId++); - mst_my_sequence_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_sequence_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_sequence_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_sequence_equal.common().member_flags().IS_OPTIONAL(false); - mst_my_sequence_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_sequence_equal.common().member_flags().IS_KEY(false); - mst_my_sequence_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_sequence_equal.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", 2, false)); - - MD5 my_sequence_equal_hash("my_sequence_equal"); - for(int i = 0; i < 4; ++i) - { - mst_my_sequence_equal.detail().name_hash()[i] = my_sequence_equal_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_sequence_equal); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceStructEqual", false); -} - -const TypeObject* GetCompleteSequenceStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceStructEqual", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_sequence_equal; - cst_my_sequence_equal.common().member_id(memberId++); - cst_my_sequence_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_sequence_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_sequence_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_sequence_equal.common().member_flags().IS_OPTIONAL(false); - cst_my_sequence_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_sequence_equal.common().member_flags().IS_KEY(false); - cst_my_sequence_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_sequence_equal.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", 2, true)); - - cst_my_sequence_equal.detail().name("my_sequence_equal"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_sequence_equal); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SequenceStructEqual"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceStructEqual", true); -} - - - - - -const TypeIdentifier* GetSequenceBadStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceBadStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSequenceBadStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SequenceBadStruct", complete); -} - -const TypeObject* GetSequenceBadStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceBadStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSequenceBadStructObject(); - } - //else - return GetMinimalSequenceBadStructObject(); -} - -const TypeObject* GetMinimalSequenceBadStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceBadStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_sequence; - mst_my_sequence.common().member_id(memberId++); - mst_my_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_sequence.common().member_flags().IS_OPTIONAL(false); - mst_my_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_sequence.common().member_flags().IS_KEY(false); - mst_my_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint8_t", 2, false)); - - MD5 my_sequence_hash("my_sequence"); - for(int i = 0; i < 4; ++i) - { - mst_my_sequence.detail().name_hash()[i] = my_sequence_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_sequence); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceBadStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceBadStruct", false); -} - -const TypeObject* GetCompleteSequenceBadStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceBadStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_sequence; - cst_my_sequence.common().member_id(memberId++); - cst_my_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_sequence.common().member_flags().IS_OPTIONAL(false); - cst_my_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_sequence.common().member_flags().IS_KEY(false); - cst_my_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint8_t", 2, true)); - - cst_my_sequence.detail().name("my_sequence"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_sequence); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SequenceBadStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceBadStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceBadStruct", true); -} - - - - - -const TypeIdentifier* GetSequenceBoundsStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceBoundsStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSequenceBoundsStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SequenceBoundsStruct", complete); -} - -const TypeObject* GetSequenceBoundsStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceBoundsStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSequenceBoundsStructObject(); - } - //else - return GetMinimalSequenceBoundsStructObject(); -} - -const TypeObject* GetMinimalSequenceBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceBoundsStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_sequence; - mst_my_sequence.common().member_id(memberId++); - mst_my_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_sequence.common().member_flags().IS_OPTIONAL(false); - mst_my_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_sequence.common().member_flags().IS_KEY(false); - mst_my_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", 4, false)); - - MD5 my_sequence_hash("my_sequence"); - for(int i = 0; i < 4; ++i) - { - mst_my_sequence.detail().name_hash()[i] = my_sequence_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_sequence); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceBoundsStruct", false); -} - -const TypeObject* GetCompleteSequenceBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceBoundsStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_sequence; - cst_my_sequence.common().member_id(memberId++); - cst_my_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_sequence.common().member_flags().IS_OPTIONAL(false); - cst_my_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_sequence.common().member_flags().IS_KEY(false); - cst_my_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", 4, true)); - - cst_my_sequence.detail().name("my_sequence"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_sequence); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SequenceBoundsStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceBoundsStruct", true); -} - - - - - - - -const TypeIdentifier* GetSequenceSequenceStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceSequenceStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSequenceSequenceStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SequenceSequenceStruct", complete); -} - -const TypeObject* GetSequenceSequenceStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSequenceSequenceStructObject(); - } - //else - return GetMinimalSequenceSequenceStructObject(); -} - -const TypeObject* GetMinimalSequenceSequenceStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_sequence_sequence; - mst_my_sequence_sequence.common().member_id(memberId++); - mst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_sequence_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_sequence_sequence.common().member_flags().IS_OPTIONAL(false); - mst_my_sequence_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_sequence_sequence.common().member_flags().IS_KEY(false); - mst_my_sequence_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_sequence_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier(TypeNamesGenerator::get_sequence_type_name("int32_t", 2), 3, false)); - - MD5 my_sequence_sequence_hash("my_sequence_sequence"); - for(int i = 0; i < 4; ++i) - { - mst_my_sequence_sequence.detail().name_hash()[i] = my_sequence_sequence_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_sequence_sequence); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceSequenceStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceStruct", false); -} - -const TypeObject* GetCompleteSequenceSequenceStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_sequence_sequence; - cst_my_sequence_sequence.common().member_id(memberId++); - cst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_sequence_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_sequence_sequence.common().member_flags().IS_OPTIONAL(false); - cst_my_sequence_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_sequence_sequence.common().member_flags().IS_KEY(false); - cst_my_sequence_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_sequence_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier(TypeNamesGenerator::get_sequence_type_name("int32_t", 2), 3, true)); - - cst_my_sequence_sequence.detail().name("my_sequence_sequence"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_sequence_sequence); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SequenceSequenceStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceSequenceStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceStruct", true); -} - - - - - - - -const TypeIdentifier* GetSequenceSequenceBoundsStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceSequenceBoundsStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSequenceSequenceBoundsStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SequenceSequenceBoundsStruct", complete); -} - -const TypeObject* GetSequenceSequenceBoundsStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceBoundsStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSequenceSequenceBoundsStructObject(); - } - //else - return GetMinimalSequenceSequenceBoundsStructObject(); -} - -const TypeObject* GetMinimalSequenceSequenceBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceBoundsStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_sequence_sequence; - mst_my_sequence_sequence.common().member_id(memberId++); - mst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_sequence_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_sequence_sequence.common().member_flags().IS_OPTIONAL(false); - mst_my_sequence_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_sequence_sequence.common().member_flags().IS_KEY(false); - mst_my_sequence_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_sequence_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier(TypeNamesGenerator::get_sequence_type_name("int32_t", 5), 5, false)); - - MD5 my_sequence_sequence_hash("my_sequence_sequence"); - for(int i = 0; i < 4; ++i) - { - mst_my_sequence_sequence.detail().name_hash()[i] = my_sequence_sequence_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_sequence_sequence); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceSequenceBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceBoundsStruct", false); -} - -const TypeObject* GetCompleteSequenceSequenceBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceBoundsStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_sequence_sequence; - cst_my_sequence_sequence.common().member_id(memberId++); - cst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_sequence_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_sequence_sequence.common().member_flags().IS_OPTIONAL(false); - cst_my_sequence_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_sequence_sequence.common().member_flags().IS_KEY(false); - cst_my_sequence_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_sequence_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier(TypeNamesGenerator::get_sequence_type_name("int32_t", 5), 5, true)); - - cst_my_sequence_sequence.detail().name("my_sequence_sequence"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_sequence_sequence); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SequenceSequenceBoundsStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceSequenceBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceBoundsStruct", true); -} - - - - - -const TypeIdentifier* GetMapStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMapStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MapStruct", complete); -} - -const TypeObject* GetMapStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMapStructObject(); - } - //else - return GetMinimalMapStructObject(); -} - -const TypeObject* GetMinimalMapStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_map; - mst_my_map.common().member_id(memberId++); - mst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map.common().member_flags().IS_OPTIONAL(false); - mst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map.common().member_flags().IS_KEY(false); - mst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int32_t", 2, false)); - - MD5 my_map_hash("my_map"); - for(int i = 0; i < 4; ++i) - { - mst_my_map.detail().name_hash()[i] = my_map_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapStruct", false); -} - -const TypeObject* GetCompleteMapStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_map; - cst_my_map.common().member_id(memberId++); - cst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map.common().member_flags().IS_OPTIONAL(false); - cst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map.common().member_flags().IS_KEY(false); - cst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int32_t", 2, true)); - - cst_my_map.detail().name("my_map"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MapStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapStruct", true); -} - - - - - -const TypeIdentifier* GetMapStructEqualIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapStructEqual", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMapStructEqualObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MapStructEqual", complete); -} - -const TypeObject* GetMapStructEqualObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapStructEqual", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMapStructEqualObject(); - } - //else - return GetMinimalMapStructEqualObject(); -} - -const TypeObject* GetMinimalMapStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapStructEqual", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_map_equal; - mst_my_map_equal.common().member_id(memberId++); - mst_my_map_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map_equal.common().member_flags().IS_OPTIONAL(false); - mst_my_map_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map_equal.common().member_flags().IS_KEY(false); - mst_my_map_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map_equal.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int32_t", 2, false)); - - MD5 my_map_equal_hash("my_map_equal"); - for(int i = 0; i < 4; ++i) - { - mst_my_map_equal.detail().name_hash()[i] = my_map_equal_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map_equal); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapStructEqual", false); -} - -const TypeObject* GetCompleteMapStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapStructEqual", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_map_equal; - cst_my_map_equal.common().member_id(memberId++); - cst_my_map_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map_equal.common().member_flags().IS_OPTIONAL(false); - cst_my_map_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map_equal.common().member_flags().IS_KEY(false); - cst_my_map_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map_equal.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int32_t", 2, true)); - - cst_my_map_equal.detail().name("my_map_equal"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map_equal); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MapStructEqual"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapStructEqual", true); -} - - - - - -const TypeIdentifier* GetMapBadKeyStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapBadKeyStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMapBadKeyStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MapBadKeyStruct", complete); -} - -const TypeObject* GetMapBadKeyStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBadKeyStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMapBadKeyStructObject(); - } - //else - return GetMinimalMapBadKeyStructObject(); -} - -const TypeObject* GetMinimalMapBadKeyStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBadKeyStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_map; - mst_my_map.common().member_id(memberId++); - mst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map.common().member_flags().IS_OPTIONAL(false); - mst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map.common().member_flags().IS_KEY(false); - mst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("uint8_t", "int32_t", 2, false)); - - MD5 my_map_hash("my_map"); - for(int i = 0; i < 4; ++i) - { - mst_my_map.detail().name_hash()[i] = my_map_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapBadKeyStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapBadKeyStruct", false); -} - -const TypeObject* GetCompleteMapBadKeyStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBadKeyStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_map; - cst_my_map.common().member_id(memberId++); - cst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map.common().member_flags().IS_OPTIONAL(false); - cst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map.common().member_flags().IS_KEY(false); - cst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("uint8_t", "int32_t", 2, true)); - - cst_my_map.detail().name("my_map"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MapBadKeyStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapBadKeyStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapBadKeyStruct", true); -} - - - - - -const TypeIdentifier* GetMapBadElemStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapBadElemStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMapBadElemStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MapBadElemStruct", complete); -} - -const TypeObject* GetMapBadElemStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBadElemStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMapBadElemStructObject(); - } - //else - return GetMinimalMapBadElemStructObject(); -} - -const TypeObject* GetMinimalMapBadElemStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBadElemStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_map; - mst_my_map.common().member_id(memberId++); - mst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map.common().member_flags().IS_OPTIONAL(false); - mst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map.common().member_flags().IS_KEY(false); - mst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int64_t", 2, false)); - - MD5 my_map_hash("my_map"); - for(int i = 0; i < 4; ++i) - { - mst_my_map.detail().name_hash()[i] = my_map_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapBadElemStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapBadElemStruct", false); -} - -const TypeObject* GetCompleteMapBadElemStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBadElemStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_map; - cst_my_map.common().member_id(memberId++); - cst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map.common().member_flags().IS_OPTIONAL(false); - cst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map.common().member_flags().IS_KEY(false); - cst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int64_t", 2, true)); - - cst_my_map.detail().name("my_map"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MapBadElemStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapBadElemStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapBadElemStruct", true); -} - - - - - -const TypeIdentifier* GetMapBoundsStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapBoundsStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMapBoundsStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MapBoundsStruct", complete); -} - -const TypeObject* GetMapBoundsStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBoundsStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMapBoundsStructObject(); - } - //else - return GetMinimalMapBoundsStructObject(); -} - -const TypeObject* GetMinimalMapBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBoundsStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_map; - mst_my_map.common().member_id(memberId++); - mst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map.common().member_flags().IS_OPTIONAL(false); - mst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map.common().member_flags().IS_KEY(false); - mst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int32_t", 4, false)); - - MD5 my_map_hash("my_map"); - for(int i = 0; i < 4; ++i) - { - mst_my_map.detail().name_hash()[i] = my_map_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapBoundsStruct", false); -} - -const TypeObject* GetCompleteMapBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBoundsStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_map; - cst_my_map.common().member_id(memberId++); - cst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map.common().member_flags().IS_OPTIONAL(false); - cst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map.common().member_flags().IS_KEY(false); - cst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int32_t", 4, true)); - - cst_my_map.detail().name("my_map"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MapBoundsStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapBoundsStruct", true); -} - - - - - - - -const TypeIdentifier* GetMapMapStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapMapStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMapMapStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MapMapStruct", complete); -} - -const TypeObject* GetMapMapStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapMapStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMapMapStructObject(); - } - //else - return GetMinimalMapMapStructObject(); -} - -const TypeObject* GetMinimalMapMapStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapMapStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_map_map; - mst_my_map_map.common().member_id(memberId++); - mst_my_map_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map_map.common().member_flags().IS_OPTIONAL(false); - mst_my_map_map.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map_map.common().member_flags().IS_KEY(false); - mst_my_map_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", TypeNamesGenerator::get_map_type_name("int32_t", "int32_t", 2), 2, false)); - - MD5 my_map_map_hash("my_map_map"); - for(int i = 0; i < 4; ++i) - { - mst_my_map_map.detail().name_hash()[i] = my_map_map_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map_map); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapMapStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapMapStruct", false); -} - -const TypeObject* GetCompleteMapMapStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapMapStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_map_map; - cst_my_map_map.common().member_id(memberId++); - cst_my_map_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map_map.common().member_flags().IS_OPTIONAL(false); - cst_my_map_map.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map_map.common().member_flags().IS_KEY(false); - cst_my_map_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", TypeNamesGenerator::get_map_type_name("int32_t", "int32_t", 2), 2, true)); - - cst_my_map_map.detail().name("my_map_map"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map_map); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MapMapStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapMapStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapMapStruct", true); -} - - - - - - - -const TypeIdentifier* GetMapMapBoundsStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapMapBoundsStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMapMapBoundsStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MapMapBoundsStruct", complete); -} - -const TypeObject* GetMapMapBoundsStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapMapBoundsStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMapMapBoundsStructObject(); - } - //else - return GetMinimalMapMapBoundsStructObject(); -} - -const TypeObject* GetMinimalMapMapBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapMapBoundsStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_map_map; - mst_my_map_map.common().member_id(memberId++); - mst_my_map_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map_map.common().member_flags().IS_OPTIONAL(false); - mst_my_map_map.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map_map.common().member_flags().IS_KEY(false); - mst_my_map_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", TypeNamesGenerator::get_map_type_name("int32_t", "int32_t", 3), 3, false)); - - MD5 my_map_map_hash("my_map_map"); - for(int i = 0; i < 4; ++i) - { - mst_my_map_map.detail().name_hash()[i] = my_map_map_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map_map); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapMapBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapMapBoundsStruct", false); -} - -const TypeObject* GetCompleteMapMapBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapMapBoundsStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_map_map; - cst_my_map_map.common().member_id(memberId++); - cst_my_map_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map_map.common().member_flags().IS_OPTIONAL(false); - cst_my_map_map.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map_map.common().member_flags().IS_KEY(false); - cst_my_map_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", TypeNamesGenerator::get_map_type_name("int32_t", "int32_t", 3), 3, true)); - - cst_my_map_map.detail().name("my_map_map"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map_map); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MapMapBoundsStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapMapBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapMapBoundsStruct", true); -} - - - -const TypeIdentifier* GetSimpleUnionIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnion", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleUnionObject(complete); - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnion", complete); -} - -const TypeObject* GetSimpleUnionObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnion", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleUnionObject(); - } - // else - return GetMinimalSimpleUnionObject(); -} - -const TypeObject* GetMinimalSimpleUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnion", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_UNION); - - type_object->minimal().union_type().union_flags().IS_FINAL(false); - type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); - type_object->minimal().union_type().union_flags().IS_MUTABLE(false); - type_object->minimal().union_type().union_flags().IS_NESTED(false); - type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->minimal().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - MinimalUnionMember mst_first; - mst_first.common().member_id(memberId++); - mst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_first.common().member_flags().IS_KEY(false); // Doesn't apply - mst_first.common().member_flags().IS_DEFAULT(false); - mst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - mst_first.common().label_seq().emplace_back(A); - - MD5 first_hash("first"); - for(int i = 0; i < 4; ++i) - { - mst_first.detail().name_hash()[i] = first_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_first); - - MinimalUnionMember mst_second; - mst_second.common().member_id(memberId++); - mst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_second.common().member_flags().IS_KEY(false); // Doesn't apply - mst_second.common().member_flags().IS_DEFAULT(false); - mst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - mst_second.common().label_seq().emplace_back(B); - - MD5 second_hash("second"); - for(int i = 0; i < 4; ++i) - { - mst_second.detail().name_hash()[i] = second_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_second); - - - // Header - //type_object->minimal().union_type().header().detail()... // Empty - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnion", false); -} - -const TypeObject* GetCompleteSimpleUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnion", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_UNION); - - type_object->complete().union_type().union_flags().IS_FINAL(false); - type_object->complete().union_type().union_flags().IS_APPENDABLE(false); - type_object->complete().union_type().union_flags().IS_MUTABLE(false); - type_object->complete().union_type().union_flags().IS_NESTED(false); - type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->complete().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - CompleteUnionMember cst_first; - cst_first.common().member_id(memberId++); - cst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_first.common().member_flags().IS_KEY(false); // Doesn't apply - cst_first.common().member_flags().IS_DEFAULT(false); - cst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - cst_first.common().label_seq().emplace_back(A); - - - cst_first.detail().name("first"); - - type_object->complete().union_type().member_seq().emplace_back(cst_first); - - CompleteUnionMember cst_second; - cst_second.common().member_id(memberId++); - cst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_second.common().member_flags().IS_KEY(false); // Doesn't apply - cst_second.common().member_flags().IS_DEFAULT(false); - cst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - cst_second.common().label_seq().emplace_back(B); - - - cst_second.detail().name("second"); - - type_object->complete().union_type().member_seq().emplace_back(cst_second); - - - // Header - type_object->complete().union_type().header().detail().type_name("SimpleUnion"); - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnion", true); -} - - - -const TypeIdentifier* GetSimpleUnionNamesIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionNames", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleUnionNamesObject(complete); - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionNames", complete); -} - -const TypeObject* GetSimpleUnionNamesObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNames", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleUnionNamesObject(); - } - // else - return GetMinimalSimpleUnionNamesObject(); -} - -const TypeObject* GetMinimalSimpleUnionNamesObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNames", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_UNION); - - type_object->minimal().union_type().union_flags().IS_FINAL(false); - type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); - type_object->minimal().union_type().union_flags().IS_MUTABLE(false); - type_object->minimal().union_type().union_flags().IS_NESTED(false); - type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->minimal().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - MinimalUnionMember mst_first_case; - mst_first_case.common().member_id(memberId++); - mst_first_case.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_first_case.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_first_case.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_first_case.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_first_case.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_first_case.common().member_flags().IS_KEY(false); // Doesn't apply - mst_first_case.common().member_flags().IS_DEFAULT(false); - mst_first_case.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - mst_first_case.common().label_seq().emplace_back(A); - - MD5 first_case_hash("first_case"); - for(int i = 0; i < 4; ++i) - { - mst_first_case.detail().name_hash()[i] = first_case_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_first_case); - - MinimalUnionMember mst_second_case; - mst_second_case.common().member_id(memberId++); - mst_second_case.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_second_case.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_second_case.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_second_case.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_second_case.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_second_case.common().member_flags().IS_KEY(false); // Doesn't apply - mst_second_case.common().member_flags().IS_DEFAULT(false); - mst_second_case.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - mst_second_case.common().label_seq().emplace_back(B); - - MD5 second_case_hash("second_case"); - for(int i = 0; i < 4; ++i) - { - mst_second_case.detail().name_hash()[i] = second_case_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_second_case); - - - // Header - //type_object->minimal().union_type().header().detail()... // Empty - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionNames", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNames", false); -} - -const TypeObject* GetCompleteSimpleUnionNamesObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNames", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_UNION); - - type_object->complete().union_type().union_flags().IS_FINAL(false); - type_object->complete().union_type().union_flags().IS_APPENDABLE(false); - type_object->complete().union_type().union_flags().IS_MUTABLE(false); - type_object->complete().union_type().union_flags().IS_NESTED(false); - type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->complete().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - CompleteUnionMember cst_first_case; - cst_first_case.common().member_id(memberId++); - cst_first_case.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_first_case.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_first_case.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_first_case.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_first_case.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_first_case.common().member_flags().IS_KEY(false); // Doesn't apply - cst_first_case.common().member_flags().IS_DEFAULT(false); - cst_first_case.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - cst_first_case.common().label_seq().emplace_back(A); - - - cst_first_case.detail().name("first_case"); - - type_object->complete().union_type().member_seq().emplace_back(cst_first_case); - - CompleteUnionMember cst_second_case; - cst_second_case.common().member_id(memberId++); - cst_second_case.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_second_case.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_second_case.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_second_case.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_second_case.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_second_case.common().member_flags().IS_KEY(false); // Doesn't apply - cst_second_case.common().member_flags().IS_DEFAULT(false); - cst_second_case.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - cst_second_case.common().label_seq().emplace_back(B); - - - cst_second_case.detail().name("second_case"); - - type_object->complete().union_type().member_seq().emplace_back(cst_second_case); - - - // Header - type_object->complete().union_type().header().detail().type_name("SimpleUnionNames"); - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionNames", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNames", true); -} - - - -const TypeIdentifier* GetSimpleTypeUnionIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleTypeUnion", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleTypeUnionObject(complete); - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleTypeUnion", complete); -} - -const TypeObject* GetSimpleTypeUnionObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnion", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleTypeUnionObject(); - } - // else - return GetMinimalSimpleTypeUnionObject(); -} - -const TypeObject* GetMinimalSimpleTypeUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnion", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_UNION); - - type_object->minimal().union_type().union_flags().IS_FINAL(false); - type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); - type_object->minimal().union_type().union_flags().IS_MUTABLE(false); - type_object->minimal().union_type().union_flags().IS_NESTED(false); - type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->minimal().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - MinimalUnionMember mst_first; - mst_first.common().member_id(memberId++); - mst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_first.common().member_flags().IS_KEY(false); // Doesn't apply - mst_first.common().member_flags().IS_DEFAULT(false); - mst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - - mst_first.common().label_seq().emplace_back(A); - - MD5 first_hash("first"); - for(int i = 0; i < 4; ++i) - { - mst_first.detail().name_hash()[i] = first_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_first); - - MinimalUnionMember mst_second; - mst_second.common().member_id(memberId++); - mst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_second.common().member_flags().IS_KEY(false); // Doesn't apply - mst_second.common().member_flags().IS_DEFAULT(false); - mst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - mst_second.common().label_seq().emplace_back(B); - - MD5 second_hash("second"); - for(int i = 0; i < 4; ++i) - { - mst_second.detail().name_hash()[i] = second_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_second); - - - // Header - //type_object->minimal().union_type().header().detail()... // Empty - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleTypeUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnion", false); -} - -const TypeObject* GetCompleteSimpleTypeUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnion", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_UNION); - - type_object->complete().union_type().union_flags().IS_FINAL(false); - type_object->complete().union_type().union_flags().IS_APPENDABLE(false); - type_object->complete().union_type().union_flags().IS_MUTABLE(false); - type_object->complete().union_type().union_flags().IS_NESTED(false); - type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->complete().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - CompleteUnionMember cst_first; - cst_first.common().member_id(memberId++); - cst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_first.common().member_flags().IS_KEY(false); // Doesn't apply - cst_first.common().member_flags().IS_DEFAULT(false); - cst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - cst_first.common().label_seq().emplace_back(A); - - - cst_first.detail().name("first"); - - type_object->complete().union_type().member_seq().emplace_back(cst_first); - - CompleteUnionMember cst_second; - cst_second.common().member_id(memberId++); - cst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_second.common().member_flags().IS_KEY(false); // Doesn't apply - cst_second.common().member_flags().IS_DEFAULT(false); - cst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - cst_second.common().label_seq().emplace_back(B); - - - cst_second.detail().name("second"); - - type_object->complete().union_type().member_seq().emplace_back(cst_second); - - - // Header - type_object->complete().union_type().header().detail().type_name("SimpleTypeUnion"); - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleTypeUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnion", true); -} - - - -const TypeIdentifier* GetSimpleBadUnionIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleBadUnion", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleBadUnionObject(complete); - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleBadUnion", complete); -} - -const TypeObject* GetSimpleBadUnionObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnion", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleBadUnionObject(); - } - // else - return GetMinimalSimpleBadUnionObject(); -} - -const TypeObject* GetMinimalSimpleBadUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnion", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_UNION); - - type_object->minimal().union_type().union_flags().IS_FINAL(false); - type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); - type_object->minimal().union_type().union_flags().IS_MUTABLE(false); - type_object->minimal().union_type().union_flags().IS_NESTED(false); - type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->minimal().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - MinimalUnionMember mst_first; - mst_first.common().member_id(memberId++); - mst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_first.common().member_flags().IS_KEY(false); // Doesn't apply - mst_first.common().member_flags().IS_DEFAULT(false); - mst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - mst_first.common().label_seq().emplace_back(A); - - MD5 first_hash("first"); - for(int i = 0; i < 4; ++i) - { - mst_first.detail().name_hash()[i] = first_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_first); - - MinimalUnionMember mst_second; - mst_second.common().member_id(memberId++); - mst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_second.common().member_flags().IS_KEY(false); // Doesn't apply - mst_second.common().member_flags().IS_DEFAULT(false); - mst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - mst_second.common().label_seq().emplace_back(C); - - MD5 second_hash("second"); - for(int i = 0; i < 4; ++i) - { - mst_second.detail().name_hash()[i] = second_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_second); - - - // Header - //type_object->minimal().union_type().header().detail()... // Empty - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleBadUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnion", false); -} - -const TypeObject* GetCompleteSimpleBadUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnion", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_UNION); - - type_object->complete().union_type().union_flags().IS_FINAL(false); - type_object->complete().union_type().union_flags().IS_APPENDABLE(false); - type_object->complete().union_type().union_flags().IS_MUTABLE(false); - type_object->complete().union_type().union_flags().IS_NESTED(false); - type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->complete().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - CompleteUnionMember cst_first; - cst_first.common().member_id(memberId++); - cst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_first.common().member_flags().IS_KEY(false); // Doesn't apply - cst_first.common().member_flags().IS_DEFAULT(false); - cst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - cst_first.common().label_seq().emplace_back(A); - - - cst_first.detail().name("first"); - - type_object->complete().union_type().member_seq().emplace_back(cst_first); - - CompleteUnionMember cst_second; - cst_second.common().member_id(memberId++); - cst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_second.common().member_flags().IS_KEY(false); // Doesn't apply - cst_second.common().member_flags().IS_DEFAULT(false); - cst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - cst_second.common().label_seq().emplace_back(C); - - - cst_second.detail().name("second"); - - type_object->complete().union_type().member_seq().emplace_back(cst_second); - - - // Header - type_object->complete().union_type().header().detail().type_name("SimpleBadUnion"); - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleBadUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnion", true); -} - - - -const TypeIdentifier* GetSimpleBadDiscUnionIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleBadDiscUnion", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleBadDiscUnionObject(complete); - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleBadDiscUnion", complete); -} - -const TypeObject* GetSimpleBadDiscUnionObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadDiscUnion", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleBadDiscUnionObject(); - } - // else - return GetMinimalSimpleBadDiscUnionObject(); -} - -const TypeObject* GetMinimalSimpleBadDiscUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadDiscUnion", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_UNION); - - type_object->minimal().union_type().union_flags().IS_FINAL(false); - type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); - type_object->minimal().union_type().union_flags().IS_MUTABLE(false); - type_object->minimal().union_type().union_flags().IS_NESTED(false); - type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->minimal().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - MemberId memberId = 0; - MinimalUnionMember mst_first; - mst_first.common().member_id(memberId++); - mst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_first.common().member_flags().IS_KEY(false); // Doesn't apply - mst_first.common().member_flags().IS_DEFAULT(false); - mst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - mst_first.common().label_seq().emplace_back(0); - - MD5 first_hash("first"); - for(int i = 0; i < 4; ++i) - { - mst_first.detail().name_hash()[i] = first_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_first); - - MinimalUnionMember mst_second; - mst_second.common().member_id(memberId++); - mst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_second.common().member_flags().IS_KEY(false); // Doesn't apply - mst_second.common().member_flags().IS_DEFAULT(false); - mst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - mst_second.common().label_seq().emplace_back(1); - - MD5 second_hash("second"); - for(int i = 0; i < 4; ++i) - { - mst_second.detail().name_hash()[i] = second_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_second); - - - // Header - //type_object->minimal().union_type().header().detail()... // Empty - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleBadDiscUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleBadDiscUnion", false); -} - -const TypeObject* GetCompleteSimpleBadDiscUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadDiscUnion", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_UNION); - - type_object->complete().union_type().union_flags().IS_FINAL(false); - type_object->complete().union_type().union_flags().IS_APPENDABLE(false); - type_object->complete().union_type().union_flags().IS_MUTABLE(false); - type_object->complete().union_type().union_flags().IS_NESTED(false); - type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->complete().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - MemberId memberId = 0; - CompleteUnionMember cst_first; - cst_first.common().member_id(memberId++); - cst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_first.common().member_flags().IS_KEY(false); // Doesn't apply - cst_first.common().member_flags().IS_DEFAULT(false); - cst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - cst_first.common().label_seq().emplace_back(0); - - - cst_first.detail().name("first"); - - type_object->complete().union_type().member_seq().emplace_back(cst_first); - - CompleteUnionMember cst_second; - cst_second.common().member_id(memberId++); - cst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_second.common().member_flags().IS_KEY(false); // Doesn't apply - cst_second.common().member_flags().IS_DEFAULT(false); - cst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - cst_second.common().label_seq().emplace_back(1); - - - cst_second.detail().name("second"); - - type_object->complete().union_type().member_seq().emplace_back(cst_second); - - - // Header - type_object->complete().union_type().header().detail().type_name("SimpleBadDiscUnion"); - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleBadDiscUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleBadDiscUnion", true); -} - - - -const TypeIdentifier* GetSimpleUnionStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleUnionStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionStruct", complete); -} - -const TypeObject* GetSimpleUnionStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleUnionStructObject(); - } - //else - return GetMinimalSimpleUnionStructObject(); -} - -const TypeObject* GetMinimalSimpleUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_union; - mst_my_union.common().member_id(memberId++); - mst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union.common().member_flags().IS_OPTIONAL(false); - mst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union.common().member_flags().IS_KEY(false); - mst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union.common().member_type_id(*GetSimpleUnionIdentifier(false)); - - MD5 my_union_hash("my_union"); - for(int i = 0; i < 4; ++i) - { - mst_my_union.detail().name_hash()[i] = my_union_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStruct", false); -} - -const TypeObject* GetCompleteSimpleUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_union; - cst_my_union.common().member_id(memberId++); - cst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union.common().member_flags().IS_OPTIONAL(false); - cst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union.common().member_flags().IS_KEY(false); - cst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union.common().member_type_id(*GetSimpleUnionIdentifier(true)); - - cst_my_union.detail().name("my_union"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SimpleUnionStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStruct", true); -} - - - -const TypeIdentifier* GetSimpleUnionStructEqualIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionStructEqual", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleUnionStructEqualObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionStructEqual", complete); -} - -const TypeObject* GetSimpleUnionStructEqualObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStructEqual", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleUnionStructEqualObject(); - } - //else - return GetMinimalSimpleUnionStructEqualObject(); -} - -const TypeObject* GetMinimalSimpleUnionStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStructEqual", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_union_equal; - mst_my_union_equal.common().member_id(memberId++); - mst_my_union_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union_equal.common().member_flags().IS_OPTIONAL(false); - mst_my_union_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union_equal.common().member_flags().IS_KEY(false); - mst_my_union_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union_equal.common().member_type_id(*GetSimpleUnionIdentifier(false)); - - MD5 my_union_equal_hash("my_union_equal"); - for(int i = 0; i < 4; ++i) - { - mst_my_union_equal.detail().name_hash()[i] = my_union_equal_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union_equal); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStructEqual", false); -} - -const TypeObject* GetCompleteSimpleUnionStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStructEqual", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_union_equal; - cst_my_union_equal.common().member_id(memberId++); - cst_my_union_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union_equal.common().member_flags().IS_OPTIONAL(false); - cst_my_union_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union_equal.common().member_flags().IS_KEY(false); - cst_my_union_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union_equal.common().member_type_id(*GetSimpleUnionIdentifier(true)); - - cst_my_union_equal.detail().name("my_union_equal"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union_equal); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SimpleUnionStructEqual"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStructEqual", true); -} - - - -const TypeIdentifier* GetSimpleUnionNamesStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionNamesStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleUnionNamesStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionNamesStruct", complete); -} - -const TypeObject* GetSimpleUnionNamesStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNamesStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleUnionNamesStructObject(); - } - //else - return GetMinimalSimpleUnionNamesStructObject(); -} - -const TypeObject* GetMinimalSimpleUnionNamesStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNamesStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_union; - mst_my_union.common().member_id(memberId++); - mst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union.common().member_flags().IS_OPTIONAL(false); - mst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union.common().member_flags().IS_KEY(false); - mst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union.common().member_type_id(*GetSimpleUnionNamesIdentifier(false)); - - MD5 my_union_hash("my_union"); - for(int i = 0; i < 4; ++i) - { - mst_my_union.detail().name_hash()[i] = my_union_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionNamesStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNamesStruct", false); -} - -const TypeObject* GetCompleteSimpleUnionNamesStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNamesStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_union; - cst_my_union.common().member_id(memberId++); - cst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union.common().member_flags().IS_OPTIONAL(false); - cst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union.common().member_flags().IS_KEY(false); - cst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union.common().member_type_id(*GetSimpleUnionNamesIdentifier(true)); - - cst_my_union.detail().name("my_union"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SimpleUnionNamesStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionNamesStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNamesStruct", true); -} - - - -const TypeIdentifier* GetSimpleTypeUnionStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleTypeUnionStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleTypeUnionStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleTypeUnionStruct", complete); -} - -const TypeObject* GetSimpleTypeUnionStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnionStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleTypeUnionStructObject(); - } - //else - return GetMinimalSimpleTypeUnionStructObject(); -} - -const TypeObject* GetMinimalSimpleTypeUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnionStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_union; - mst_my_union.common().member_id(memberId++); - mst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union.common().member_flags().IS_OPTIONAL(false); - mst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union.common().member_flags().IS_KEY(false); - mst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union.common().member_type_id(*GetSimpleTypeUnionIdentifier(false)); - - MD5 my_union_hash("my_union"); - for(int i = 0; i < 4; ++i) - { - mst_my_union.detail().name_hash()[i] = my_union_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleTypeUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnionStruct", false); -} - -const TypeObject* GetCompleteSimpleTypeUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnionStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_union; - cst_my_union.common().member_id(memberId++); - cst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union.common().member_flags().IS_OPTIONAL(false); - cst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union.common().member_flags().IS_KEY(false); - cst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union.common().member_type_id(*GetSimpleTypeUnionIdentifier(true)); - - cst_my_union.detail().name("my_union"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SimpleTypeUnionStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleTypeUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnionStruct", true); -} - - - -const TypeIdentifier* GetSimpleBadUnionStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleBadUnionStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleBadUnionStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleBadUnionStruct", complete); -} - -const TypeObject* GetSimpleBadUnionStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnionStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleBadUnionStructObject(); - } - //else - return GetMinimalSimpleBadUnionStructObject(); -} - -const TypeObject* GetMinimalSimpleBadUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnionStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_union; - mst_my_union.common().member_id(memberId++); - mst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union.common().member_flags().IS_OPTIONAL(false); - mst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union.common().member_flags().IS_KEY(false); - mst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union.common().member_type_id(*GetSimpleBadUnionIdentifier(false)); - - MD5 my_union_hash("my_union"); - for(int i = 0; i < 4; ++i) - { - mst_my_union.detail().name_hash()[i] = my_union_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleBadUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnionStruct", false); -} - -const TypeObject* GetCompleteSimpleBadUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnionStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_union; - cst_my_union.common().member_id(memberId++); - cst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union.common().member_flags().IS_OPTIONAL(false); - cst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union.common().member_flags().IS_KEY(false); - cst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union.common().member_type_id(*GetSimpleBadUnionIdentifier(true)); - - cst_my_union.detail().name("my_union"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SimpleBadUnionStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleBadUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnionStruct", true); -} - - - -const TypeIdentifier* GetSimplBadDiscUnionStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimplBadDiscUnionStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimplBadDiscUnionStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SimplBadDiscUnionStruct", complete); -} - -const TypeObject* GetSimplBadDiscUnionStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimplBadDiscUnionStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimplBadDiscUnionStructObject(); - } - //else - return GetMinimalSimplBadDiscUnionStructObject(); -} - -const TypeObject* GetMinimalSimplBadDiscUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimplBadDiscUnionStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_union; - mst_my_union.common().member_id(memberId++); - mst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union.common().member_flags().IS_OPTIONAL(false); - mst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union.common().member_flags().IS_KEY(false); - mst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union.common().member_type_id(*GetSimpleBadDiscUnionIdentifier(false)); - - MD5 my_union_hash("my_union"); - for(int i = 0; i < 4; ++i) - { - mst_my_union.detail().name_hash()[i] = my_union_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimplBadDiscUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimplBadDiscUnionStruct", false); -} - -const TypeObject* GetCompleteSimplBadDiscUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimplBadDiscUnionStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_union; - cst_my_union.common().member_id(memberId++); - cst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union.common().member_flags().IS_OPTIONAL(false); - cst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union.common().member_flags().IS_KEY(false); - cst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union.common().member_type_id(*GetSimpleBadDiscUnionIdentifier(true)); - - cst_my_union.detail().name("my_union"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SimplBadDiscUnionStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimplBadDiscUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimplBadDiscUnionStruct", true); -} diff --git a/test/unittest/xtypes/idl/TypesTypeObject.h b/test/unittest/xtypes/idl/TypesTypeObject.h deleted file mode 100644 index 2f615b62792..00000000000 --- a/test/unittest/xtypes/idl/TypesTypeObject.h +++ /dev/null @@ -1,394 +0,0 @@ -// 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 TypesTypeObject.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_TYPES_TYPE_OBJECT_H_ -#define _FAST_DDS_GENERATED_TYPES_TYPE_OBJECT_H_ - - -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif -#else -#define eProsima_user_DllExport -#endif - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Types_SOURCE) -#define Types_DllAPI __declspec( dllexport ) -#else -#define Types_DllAPI __declspec( dllimport ) -#endif // Types_SOURCE -#else -#define Types_DllAPI -#endif -#else -#define Types_DllAPI -#endif // _WIN32 - -using namespace eprosima::fastrtps::types; - -eProsima_user_DllExport void registerTypesTypes(); - -eProsima_user_DllExport const TypeIdentifier* GetMyEnumIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyEnumObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyEnumObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyEnumObject(); - -eProsima_user_DllExport const TypeIdentifier* GetMyBadEnumIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyBadEnumObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyBadEnumObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyBadEnumObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetMyEnumStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyEnumStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyEnumStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyEnumStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetMyBadEnumStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyBadEnumStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyBadEnumStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyBadEnumStructObject(); - -eProsima_user_DllExport const TypeIdentifier* GetMyAliasEnumIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyAliasEnumObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyAliasEnumObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyAliasEnumObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetMyAliasEnumStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyAliasEnumStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyAliasEnumStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyAliasEnumStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetBasicStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetBasicStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalBasicStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteBasicStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetBasicNamesStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetBasicNamesStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalBasicNamesStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteBasicNamesStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetBasicBadStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetBasicBadStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalBasicBadStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteBasicBadStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetBasicWideStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetBasicWideStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalBasicWideStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteBasicWideStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetBadBasicWideStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetBadBasicWideStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalBadBasicWideStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteBadBasicWideStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetStringStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetStringStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalStringStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteStringStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetLargeStringStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetLargeStringStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalLargeStringStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteLargeStringStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetWStringStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetWStringStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalWStringStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteWStringStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetLargeWStringStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetLargeWStringStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalLargeWStringStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteLargeWStringStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetArrayStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetArrayStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalArrayStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteArrayStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetArrayStructEqualIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetArrayStructEqualObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalArrayStructEqualObject(); -eProsima_user_DllExport const TypeObject* GetCompleteArrayStructEqualObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetArrayBadStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetArrayBadStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalArrayBadStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteArrayBadStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetArrayDimensionsStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetArrayDimensionsStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalArrayDimensionsStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteArrayDimensionsStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetArraySizeStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetArraySizeStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalArraySizeStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteArraySizeStructObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetSequenceStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSequenceStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSequenceStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSequenceStructObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetSequenceStructEqualIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSequenceStructEqualObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSequenceStructEqualObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSequenceStructEqualObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetSequenceBadStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSequenceBadStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSequenceBadStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSequenceBadStructObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetSequenceBoundsStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSequenceBoundsStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSequenceBoundsStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSequenceBoundsStructObject(); - - - - - - - -eProsima_user_DllExport const TypeIdentifier* GetSequenceSequenceStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSequenceSequenceStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSequenceSequenceStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSequenceSequenceStructObject(); - - - - - - - -eProsima_user_DllExport const TypeIdentifier* GetSequenceSequenceBoundsStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSequenceSequenceBoundsStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSequenceSequenceBoundsStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSequenceSequenceBoundsStructObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetMapStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMapStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMapStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMapStructObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetMapStructEqualIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMapStructEqualObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMapStructEqualObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMapStructEqualObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetMapBadKeyStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMapBadKeyStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMapBadKeyStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMapBadKeyStructObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetMapBadElemStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMapBadElemStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMapBadElemStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMapBadElemStructObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetMapBoundsStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMapBoundsStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMapBoundsStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMapBoundsStructObject(); - - - - - - - -eProsima_user_DllExport const TypeIdentifier* GetMapMapStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMapMapStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMapMapStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMapMapStructObject(); - - - - - - - -eProsima_user_DllExport const TypeIdentifier* GetMapMapBoundsStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMapMapBoundsStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMapMapBoundsStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMapMapBoundsStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleUnionObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionNamesIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleUnionNamesObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionNamesObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionNamesObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleTypeUnionIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleTypeUnionObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleTypeUnionObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleTypeUnionObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleBadUnionIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleBadUnionObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleBadUnionObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleBadUnionObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleBadDiscUnionIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleBadDiscUnionObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleBadDiscUnionObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleBadDiscUnionObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleUnionStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionStructEqualIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleUnionStructEqualObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionStructEqualObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionStructEqualObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionNamesStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleUnionNamesStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionNamesStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionNamesStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleTypeUnionStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleTypeUnionStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleTypeUnionStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleTypeUnionStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleBadUnionStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleBadUnionStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleBadUnionStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleBadUnionStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimplBadDiscUnionStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimplBadDiscUnionStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimplBadDiscUnionStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimplBadDiscUnionStructObject(); - - -#endif // _FAST_DDS_GENERATED_TYPES_TYPE_OBJECT_H_ \ No newline at end of file diff --git a/test/unittest/xtypes/idl/Typesv1.cxx b/test/unittest/xtypes/idl/Typesv1.cxx deleted file mode 100644 index 098cc1b3b0a..00000000000 --- a/test/unittest/xtypes/idl/Typesv1.cxx +++ /dev/null @@ -1,8202 +0,0 @@ -// 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 Types.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Types.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include "TypesTypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define SimpleUnionStruct_max_cdr_typesize 24ULL; -#define SequenceSequenceBoundsStruct_max_cdr_typesize 132ULL; - -#define MyAliasEnumStruct_max_cdr_typesize 8ULL; -#define ArrayBadStruct_max_cdr_typesize 6ULL; -#define MapBadKeyStruct_max_cdr_typesize 24ULL; -#define SimpleBadUnionStruct_max_cdr_typesize 24ULL; -#define MyEnumStruct_max_cdr_typesize 8ULL; - -#define ArrayStructEqual_max_cdr_typesize 12ULL; -#define LargeWStringStruct_max_cdr_typesize 167708ULL; - -#define WStringStruct_max_cdr_typesize 1028ULL; -#define SequenceStruct_max_cdr_typesize 16ULL; -#define SimpleTypeUnionStruct_max_cdr_typesize 24ULL; - -#define ArrayDimensionsStruct_max_cdr_typesize 20ULL; -#define SequenceSequenceStruct_max_cdr_typesize 48ULL; -#define MapBoundsStruct_max_cdr_typesize 40ULL; -#define SequenceStructEqual_max_cdr_typesize 16ULL; -#define MapStructEqual_max_cdr_typesize 24ULL; -#define BasicStruct_max_cdr_typesize 272ULL; -#define SequenceBoundsStruct_max_cdr_typesize 24ULL; -#define MapMapStruct_max_cdr_typesize 60ULL; -#define BasicWideStruct_max_cdr_typesize 536ULL; - -#define SimplBadDiscUnionStruct_max_cdr_typesize 24ULL; -#define MapStruct_max_cdr_typesize 24ULL; - -#define MyBadEnumStruct_max_cdr_typesize 8ULL; -#define SequenceBadStruct_max_cdr_typesize 10ULL; -#define SimpleUnionNamesStruct_max_cdr_typesize 24ULL; -#define LargeStringStruct_max_cdr_typesize 41934ULL; -#define ArrayStruct_max_cdr_typesize 12ULL; -#define BadBasicWideStruct_max_cdr_typesize 536ULL; -#define ArraySizeStruct_max_cdr_typesize 24ULL; - -#define MapBadElemStruct_max_cdr_typesize 40ULL; -#define SimpleUnionStructEqual_max_cdr_typesize 24ULL; -#define BasicBadStruct_max_cdr_typesize 272ULL; -#define BasicNamesStruct_max_cdr_typesize 272ULL; -#define StringStruct_max_cdr_typesize 264ULL; - -#define MapMapBoundsStruct_max_cdr_typesize 108ULL; - - - - -MyEnumStruct::MyEnumStruct() -{ - // MyEnum m_my_enum - m_my_enum = ::A; - - // Just to register all known types - registerTypesTypes(); -} - -MyEnumStruct::~MyEnumStruct() -{ -} - -MyEnumStruct::MyEnumStruct( - const MyEnumStruct& x) -{ - m_my_enum = x.m_my_enum; - -} - -MyEnumStruct::MyEnumStruct( - MyEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; - -} - -MyEnumStruct& MyEnumStruct::operator =( - const MyEnumStruct& x) -{ - m_my_enum = x.m_my_enum; - - return *this; -} - -MyEnumStruct& MyEnumStruct::operator =( - MyEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; - - return *this; -} - -bool MyEnumStruct::operator ==( - const MyEnumStruct& x) const -{ - return (m_my_enum == x.m_my_enum); -} - -bool MyEnumStruct::operator !=( - const MyEnumStruct& x) const -{ - return !(*this == x); -} - -size_t MyEnumStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MyEnumStruct_max_cdr_typesize; -} - -size_t MyEnumStruct::getCdrSerializedSize( - const MyEnumStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void MyEnumStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << (uint32_t)m_my_enum; - -} - -void MyEnumStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_my_enum = (MyEnum)enum_value; - } - - -} - - -bool MyEnumStruct::isKeyDefined() -{ - return false; -} - -void MyEnumStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ -void MyEnumStruct::my_enum( - MyEnum _my_enum) -{ - m_my_enum = _my_enum; -} - -/*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ -MyEnum MyEnumStruct::my_enum() const -{ - return m_my_enum; -} - -/*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ -MyEnum& MyEnumStruct::my_enum() -{ - return m_my_enum; -} - - - - - -MyBadEnumStruct::MyBadEnumStruct() -{ - // MyBadEnum m_my_enum - m_my_enum = ::A1; - - // Just to register all known types - registerTypesTypes(); -} - -MyBadEnumStruct::~MyBadEnumStruct() -{ -} - -MyBadEnumStruct::MyBadEnumStruct( - const MyBadEnumStruct& x) -{ - m_my_enum = x.m_my_enum; - -} - -MyBadEnumStruct::MyBadEnumStruct( - MyBadEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; - -} - -MyBadEnumStruct& MyBadEnumStruct::operator =( - const MyBadEnumStruct& x) -{ - m_my_enum = x.m_my_enum; - - return *this; -} - -MyBadEnumStruct& MyBadEnumStruct::operator =( - MyBadEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; - - return *this; -} - -bool MyBadEnumStruct::operator ==( - const MyBadEnumStruct& x) const -{ - return (m_my_enum == x.m_my_enum); -} - -bool MyBadEnumStruct::operator !=( - const MyBadEnumStruct& x) const -{ - return !(*this == x); -} - -size_t MyBadEnumStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MyBadEnumStruct_max_cdr_typesize; -} - -size_t MyBadEnumStruct::getCdrSerializedSize( - const MyBadEnumStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void MyBadEnumStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << (uint32_t)m_my_enum; - -} - -void MyBadEnumStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_my_enum = (MyBadEnum)enum_value; - } - - -} - - -bool MyBadEnumStruct::isKeyDefined() -{ - return false; -} - -void MyBadEnumStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ -void MyBadEnumStruct::my_enum( - MyBadEnum _my_enum) -{ - m_my_enum = _my_enum; -} - -/*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ -MyBadEnum MyBadEnumStruct::my_enum() const -{ - return m_my_enum; -} - -/*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ -MyBadEnum& MyBadEnumStruct::my_enum() -{ - return m_my_enum; -} - - - - - - -MyAliasEnumStruct::MyAliasEnumStruct() -{ - // MyAliasEnum m_my_enum - m_my_enum = ::A; - - // Just to register all known types - registerTypesTypes(); -} - -MyAliasEnumStruct::~MyAliasEnumStruct() -{ -} - -MyAliasEnumStruct::MyAliasEnumStruct( - const MyAliasEnumStruct& x) -{ - m_my_enum = x.m_my_enum; - -} - -MyAliasEnumStruct::MyAliasEnumStruct( - MyAliasEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; - -} - -MyAliasEnumStruct& MyAliasEnumStruct::operator =( - const MyAliasEnumStruct& x) -{ - m_my_enum = x.m_my_enum; - - return *this; -} - -MyAliasEnumStruct& MyAliasEnumStruct::operator =( - MyAliasEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; - - return *this; -} - -bool MyAliasEnumStruct::operator ==( - const MyAliasEnumStruct& x) const -{ - return (m_my_enum == x.m_my_enum); -} - -bool MyAliasEnumStruct::operator !=( - const MyAliasEnumStruct& x) const -{ - return !(*this == x); -} - -size_t MyAliasEnumStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MyAliasEnumStruct_max_cdr_typesize; -} - -size_t MyAliasEnumStruct::getCdrSerializedSize( - const MyAliasEnumStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void MyAliasEnumStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << (uint32_t)m_my_enum; - -} - -void MyAliasEnumStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_my_enum = (MyAliasEnum)enum_value; - } - - -} - - -bool MyAliasEnumStruct::isKeyDefined() -{ - return false; -} - -void MyAliasEnumStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ -void MyAliasEnumStruct::my_enum( - MyAliasEnum _my_enum) -{ - m_my_enum = _my_enum; -} - -/*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ -MyAliasEnum MyAliasEnumStruct::my_enum() const -{ - return m_my_enum; -} - -/*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ -MyAliasEnum& MyAliasEnumStruct::my_enum() -{ - return m_my_enum; -} - - - - - -BasicStruct::BasicStruct() -{ - // boolean m_my_bool - m_my_bool = false; - // long m_my_int32 - m_my_int32 = 0; - // /type_d() m_my_string - - - // Just to register all known types - registerTypesTypes(); -} - -BasicStruct::~BasicStruct() -{ -} - -BasicStruct::BasicStruct( - const BasicStruct& x) -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - -} - -BasicStruct::BasicStruct( - BasicStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - -} - -BasicStruct& BasicStruct::operator =( - const BasicStruct& x) -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - - return *this; -} - -BasicStruct& BasicStruct::operator =( - BasicStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - - return *this; -} - -bool BasicStruct::operator ==( - const BasicStruct& x) const -{ - return (m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string); -} - -bool BasicStruct::operator !=( - const BasicStruct& x) const -{ - return !(*this == x); -} - -size_t BasicStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return BasicStruct_max_cdr_typesize; -} - -size_t BasicStruct::getCdrSerializedSize( - const BasicStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void BasicStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_bool; - - scdr << m_my_int32; - - scdr << m_my_string.c_str(); - -} - -void BasicStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_bool; - - - - dcdr >> m_my_int32; - - - - dcdr >> m_my_string; - - -} - - -bool BasicStruct::isKeyDefined() -{ - return false; -} - -void BasicStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BasicStruct::my_bool( - bool _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -bool BasicStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -bool& BasicStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BasicStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BasicStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BasicStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BasicStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BasicStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BasicStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BasicStruct::my_string() -{ - return m_my_string; -} - - - - - -BasicNamesStruct::BasicNamesStruct() -{ - // boolean m_my_bool_name - m_my_bool_name = false; - // long m_my_int32_name - m_my_int32_name = 0; - // /type_d() m_my_string_name - - - // Just to register all known types - registerTypesTypes(); -} - -BasicNamesStruct::~BasicNamesStruct() -{ -} - -BasicNamesStruct::BasicNamesStruct( - const BasicNamesStruct& x) -{ - m_my_bool_name = x.m_my_bool_name; - - - m_my_int32_name = x.m_my_int32_name; - - - m_my_string_name = x.m_my_string_name; - -} - -BasicNamesStruct::BasicNamesStruct( - BasicNamesStruct&& x) noexcept -{ - m_my_bool_name = x.m_my_bool_name; - - - m_my_int32_name = x.m_my_int32_name; - - - m_my_string_name = std::move(x.m_my_string_name); - -} - -BasicNamesStruct& BasicNamesStruct::operator =( - const BasicNamesStruct& x) -{ - m_my_bool_name = x.m_my_bool_name; - - - m_my_int32_name = x.m_my_int32_name; - - - m_my_string_name = x.m_my_string_name; - - return *this; -} - -BasicNamesStruct& BasicNamesStruct::operator =( - BasicNamesStruct&& x) noexcept -{ - m_my_bool_name = x.m_my_bool_name; - - - m_my_int32_name = x.m_my_int32_name; - - - m_my_string_name = std::move(x.m_my_string_name); - - return *this; -} - -bool BasicNamesStruct::operator ==( - const BasicNamesStruct& x) const -{ - return (m_my_bool_name == x.m_my_bool_name && - m_my_int32_name == x.m_my_int32_name && - m_my_string_name == x.m_my_string_name); -} - -bool BasicNamesStruct::operator !=( - const BasicNamesStruct& x) const -{ - return !(*this == x); -} - -size_t BasicNamesStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return BasicNamesStruct_max_cdr_typesize; -} - -size_t BasicNamesStruct::getCdrSerializedSize( - const BasicNamesStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string_name().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void BasicNamesStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_bool_name; - - scdr << m_my_int32_name; - - scdr << m_my_string_name.c_str(); - -} - -void BasicNamesStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_bool_name; - - - - dcdr >> m_my_int32_name; - - - - dcdr >> m_my_string_name; - - -} - - -bool BasicNamesStruct::isKeyDefined() -{ - return false; -} - -void BasicNamesStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_bool_name - * @param _my_bool_name New value for member my_bool_name - */ -void BasicNamesStruct::my_bool_name( - bool _my_bool_name) -{ - m_my_bool_name = _my_bool_name; -} - -/*! - * @brief This function returns the value of member my_bool_name - * @return Value of member my_bool_name - */ -bool BasicNamesStruct::my_bool_name() const -{ - return m_my_bool_name; -} - -/*! - * @brief This function returns a reference to member my_bool_name - * @return Reference to member my_bool_name - */ -bool& BasicNamesStruct::my_bool_name() -{ - return m_my_bool_name; -} - - -/*! - * @brief This function sets a value in member my_int32_name - * @param _my_int32_name New value for member my_int32_name - */ -void BasicNamesStruct::my_int32_name( - int32_t _my_int32_name) -{ - m_my_int32_name = _my_int32_name; -} - -/*! - * @brief This function returns the value of member my_int32_name - * @return Value of member my_int32_name - */ -int32_t BasicNamesStruct::my_int32_name() const -{ - return m_my_int32_name; -} - -/*! - * @brief This function returns a reference to member my_int32_name - * @return Reference to member my_int32_name - */ -int32_t& BasicNamesStruct::my_int32_name() -{ - return m_my_int32_name; -} - - -/*! - * @brief This function copies the value in member my_string_name - * @param _my_string_name New value to be copied in member my_string_name - */ -void BasicNamesStruct::my_string_name( - const std::string& _my_string_name) -{ - m_my_string_name = _my_string_name; -} - -/*! - * @brief This function moves the value in member my_string_name - * @param _my_string_name New value to be moved in member my_string_name - */ -void BasicNamesStruct::my_string_name( - std::string&& _my_string_name) -{ - m_my_string_name = std::move(_my_string_name); -} - -/*! - * @brief This function returns a constant reference to member my_string_name - * @return Constant reference to member my_string_name - */ -const std::string& BasicNamesStruct::my_string_name() const -{ - return m_my_string_name; -} - -/*! - * @brief This function returns a reference to member my_string_name - * @return Reference to member my_string_name - */ -std::string& BasicNamesStruct::my_string_name() -{ - return m_my_string_name; -} - - - - - -BasicBadStruct::BasicBadStruct() -{ - // octet m_my_bool - m_my_bool = 0; - // long m_my_int32 - m_my_int32 = 0; - // /type_d() m_my_string - - - // Just to register all known types - registerTypesTypes(); -} - -BasicBadStruct::~BasicBadStruct() -{ -} - -BasicBadStruct::BasicBadStruct( - const BasicBadStruct& x) -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - -} - -BasicBadStruct::BasicBadStruct( - BasicBadStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - -} - -BasicBadStruct& BasicBadStruct::operator =( - const BasicBadStruct& x) -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - - return *this; -} - -BasicBadStruct& BasicBadStruct::operator =( - BasicBadStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - - return *this; -} - -bool BasicBadStruct::operator ==( - const BasicBadStruct& x) const -{ - return (m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string); -} - -bool BasicBadStruct::operator !=( - const BasicBadStruct& x) const -{ - return !(*this == x); -} - -size_t BasicBadStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return BasicBadStruct_max_cdr_typesize; -} - -size_t BasicBadStruct::getCdrSerializedSize( - const BasicBadStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void BasicBadStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_bool; - - scdr << m_my_int32; - - scdr << m_my_string.c_str(); - -} - -void BasicBadStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_bool; - - - - dcdr >> m_my_int32; - - - - dcdr >> m_my_string; - - -} - - -bool BasicBadStruct::isKeyDefined() -{ - return false; -} - -void BasicBadStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BasicBadStruct::my_bool( - uint8_t _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -uint8_t BasicBadStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -uint8_t& BasicBadStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BasicBadStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BasicBadStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BasicBadStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BasicBadStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BasicBadStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BasicBadStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BasicBadStruct::my_string() -{ - return m_my_string; -} - - - - - -BasicWideStruct::BasicWideStruct() -{ - // boolean m_my_bool - m_my_bool = false; - // long m_my_int32 - m_my_int32 = 0; - // /type_d() m_my_string - - // long m_new_int32 - m_new_int32 = 0; - // /type_d() m_new_string - - - // Just to register all known types - registerTypesTypes(); -} - -BasicWideStruct::~BasicWideStruct() -{ -} - -BasicWideStruct::BasicWideStruct( - const BasicWideStruct& x) -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - - - m_new_int32 = x.m_new_int32; - - - m_new_string = x.m_new_string; - -} - -BasicWideStruct::BasicWideStruct( - BasicWideStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - - - m_new_int32 = x.m_new_int32; - - - m_new_string = std::move(x.m_new_string); - -} - -BasicWideStruct& BasicWideStruct::operator =( - const BasicWideStruct& x) -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - - - m_new_int32 = x.m_new_int32; - - - m_new_string = x.m_new_string; - - return *this; -} - -BasicWideStruct& BasicWideStruct::operator =( - BasicWideStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - - - m_new_int32 = x.m_new_int32; - - - m_new_string = std::move(x.m_new_string); - - return *this; -} - -bool BasicWideStruct::operator ==( - const BasicWideStruct& x) const -{ - return (m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string && - m_new_int32 == x.m_new_int32 && - m_new_string == x.m_new_string); -} - -bool BasicWideStruct::operator !=( - const BasicWideStruct& x) const -{ - return !(*this == x); -} - -size_t BasicWideStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return BasicWideStruct_max_cdr_typesize; -} - -size_t BasicWideStruct::getCdrSerializedSize( - const BasicWideStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.new_string().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void BasicWideStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_bool; - - scdr << m_my_int32; - - scdr << m_my_string.c_str(); - - scdr << m_new_int32; - - scdr << m_new_string.c_str(); - -} - -void BasicWideStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_bool; - - - - dcdr >> m_my_int32; - - - - dcdr >> m_my_string; - - - - dcdr >> m_new_int32; - - - - dcdr >> m_new_string; - - -} - - -bool BasicWideStruct::isKeyDefined() -{ - return false; -} - -void BasicWideStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BasicWideStruct::my_bool( - bool _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -bool BasicWideStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -bool& BasicWideStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BasicWideStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BasicWideStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BasicWideStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BasicWideStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BasicWideStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BasicWideStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BasicWideStruct::my_string() -{ - return m_my_string; -} - - -/*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ -void BasicWideStruct::new_int32( - int32_t _new_int32) -{ - m_new_int32 = _new_int32; -} - -/*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ -int32_t BasicWideStruct::new_int32() const -{ - return m_new_int32; -} - -/*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ -int32_t& BasicWideStruct::new_int32() -{ - return m_new_int32; -} - - -/*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ -void BasicWideStruct::new_string( - const std::string& _new_string) -{ - m_new_string = _new_string; -} - -/*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ -void BasicWideStruct::new_string( - std::string&& _new_string) -{ - m_new_string = std::move(_new_string); -} - -/*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ -const std::string& BasicWideStruct::new_string() const -{ - return m_new_string; -} - -/*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ -std::string& BasicWideStruct::new_string() -{ - return m_new_string; -} - - - - - -BadBasicWideStruct::BadBasicWideStruct() -{ - // long m_new_int32 - m_new_int32 = 0; - // /type_d() m_new_string - - // boolean m_my_bool - m_my_bool = false; - // long m_my_int32 - m_my_int32 = 0; - // /type_d() m_my_string - - - // Just to register all known types - registerTypesTypes(); -} - -BadBasicWideStruct::~BadBasicWideStruct() -{ -} - -BadBasicWideStruct::BadBasicWideStruct( - const BadBasicWideStruct& x) -{ - m_new_int32 = x.m_new_int32; - - - m_new_string = x.m_new_string; - - - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - -} - -BadBasicWideStruct::BadBasicWideStruct( - BadBasicWideStruct&& x) noexcept -{ - m_new_int32 = x.m_new_int32; - - - m_new_string = std::move(x.m_new_string); - - - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - -} - -BadBasicWideStruct& BadBasicWideStruct::operator =( - const BadBasicWideStruct& x) -{ - m_new_int32 = x.m_new_int32; - - - m_new_string = x.m_new_string; - - - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - - return *this; -} - -BadBasicWideStruct& BadBasicWideStruct::operator =( - BadBasicWideStruct&& x) noexcept -{ - m_new_int32 = x.m_new_int32; - - - m_new_string = std::move(x.m_new_string); - - - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - - return *this; -} - -bool BadBasicWideStruct::operator ==( - const BadBasicWideStruct& x) const -{ - return (m_new_int32 == x.m_new_int32 && - m_new_string == x.m_new_string && - m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string); -} - -bool BadBasicWideStruct::operator !=( - const BadBasicWideStruct& x) const -{ - return !(*this == x); -} - -size_t BadBasicWideStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return BadBasicWideStruct_max_cdr_typesize; -} - -size_t BadBasicWideStruct::getCdrSerializedSize( - const BadBasicWideStruct& 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.new_string().size() + 1; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void BadBasicWideStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_new_int32; - - scdr << m_new_string.c_str(); - - scdr << m_my_bool; - - scdr << m_my_int32; - - scdr << m_my_string.c_str(); - -} - -void BadBasicWideStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_new_int32; - - - - dcdr >> m_new_string; - - - - dcdr >> m_my_bool; - - - - dcdr >> m_my_int32; - - - - dcdr >> m_my_string; - - -} - - -bool BadBasicWideStruct::isKeyDefined() -{ - return false; -} - -void BadBasicWideStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ -void BadBasicWideStruct::new_int32( - int32_t _new_int32) -{ - m_new_int32 = _new_int32; -} - -/*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ -int32_t BadBasicWideStruct::new_int32() const -{ - return m_new_int32; -} - -/*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ -int32_t& BadBasicWideStruct::new_int32() -{ - return m_new_int32; -} - - -/*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ -void BadBasicWideStruct::new_string( - const std::string& _new_string) -{ - m_new_string = _new_string; -} - -/*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ -void BadBasicWideStruct::new_string( - std::string&& _new_string) -{ - m_new_string = std::move(_new_string); -} - -/*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ -const std::string& BadBasicWideStruct::new_string() const -{ - return m_new_string; -} - -/*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ -std::string& BadBasicWideStruct::new_string() -{ - return m_new_string; -} - - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BadBasicWideStruct::my_bool( - bool _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -bool BadBasicWideStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -bool& BadBasicWideStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BadBasicWideStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BadBasicWideStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BadBasicWideStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BadBasicWideStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BadBasicWideStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BadBasicWideStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BadBasicWideStruct::my_string() -{ - return m_my_string; -} - - - - - -StringStruct::StringStruct() -{ - // /type_d() m_my_string - - - // Just to register all known types - registerTypesTypes(); -} - -StringStruct::~StringStruct() -{ -} - -StringStruct::StringStruct( - const StringStruct& x) -{ - m_my_string = x.m_my_string; - -} - -StringStruct::StringStruct( - StringStruct&& x) noexcept -{ - m_my_string = std::move(x.m_my_string); - -} - -StringStruct& StringStruct::operator =( - const StringStruct& x) -{ - m_my_string = x.m_my_string; - - return *this; -} - -StringStruct& StringStruct::operator =( - StringStruct&& x) noexcept -{ - m_my_string = std::move(x.m_my_string); - - return *this; -} - -bool StringStruct::operator ==( - const StringStruct& x) const -{ - return (m_my_string == x.m_my_string); -} - -bool StringStruct::operator !=( - const StringStruct& x) const -{ - return !(*this == x); -} - -size_t StringStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return StringStruct_max_cdr_typesize; -} - -size_t StringStruct::getCdrSerializedSize( - const StringStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void StringStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_string.c_str(); - -} - -void StringStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_string; - - -} - - -bool StringStruct::isKeyDefined() -{ - return false; -} - -void StringStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void StringStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void StringStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& StringStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& StringStruct::my_string() -{ - return m_my_string; -} - - - - - -LargeStringStruct::LargeStringStruct() -{ - // /type_d() m_my_large_string - - - // Just to register all known types - registerTypesTypes(); -} - -LargeStringStruct::~LargeStringStruct() -{ -} - -LargeStringStruct::LargeStringStruct( - const LargeStringStruct& x) -{ - m_my_large_string = x.m_my_large_string; - -} - -LargeStringStruct::LargeStringStruct( - LargeStringStruct&& x) noexcept -{ - m_my_large_string = std::move(x.m_my_large_string); - -} - -LargeStringStruct& LargeStringStruct::operator =( - const LargeStringStruct& x) -{ - m_my_large_string = x.m_my_large_string; - - return *this; -} - -LargeStringStruct& LargeStringStruct::operator =( - LargeStringStruct&& x) noexcept -{ - m_my_large_string = std::move(x.m_my_large_string); - - return *this; -} - -bool LargeStringStruct::operator ==( - const LargeStringStruct& x) const -{ - return (m_my_large_string == x.m_my_large_string); -} - -bool LargeStringStruct::operator !=( - const LargeStringStruct& x) const -{ - return !(*this == x); -} - -size_t LargeStringStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return LargeStringStruct_max_cdr_typesize; -} - -size_t LargeStringStruct::getCdrSerializedSize( - const LargeStringStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_large_string().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void LargeStringStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_large_string.c_str(); - -} - -void LargeStringStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - std::string aux; - dcdr >> aux; - m_my_large_string = aux.c_str(); - } - - -} - - -bool LargeStringStruct::isKeyDefined() -{ - return false; -} - -void LargeStringStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_large_string - * @param _my_large_string New value to be copied in member my_large_string - */ -void LargeStringStruct::my_large_string( - const eprosima::fastcdr::fixed_string<41925>& _my_large_string) -{ - m_my_large_string = _my_large_string; -} - -/*! - * @brief This function moves the value in member my_large_string - * @param _my_large_string New value to be moved in member my_large_string - */ -void LargeStringStruct::my_large_string( - eprosima::fastcdr::fixed_string<41925>&& _my_large_string) -{ - m_my_large_string = std::move(_my_large_string); -} - -/*! - * @brief This function returns a constant reference to member my_large_string - * @return Constant reference to member my_large_string - */ -const eprosima::fastcdr::fixed_string<41925>& LargeStringStruct::my_large_string() const -{ - return m_my_large_string; -} - -/*! - * @brief This function returns a reference to member my_large_string - * @return Reference to member my_large_string - */ -eprosima::fastcdr::fixed_string<41925>& LargeStringStruct::my_large_string() -{ - return m_my_large_string; -} - - - - - -WStringStruct::WStringStruct() -{ - // /type_15() m_my_wstring - - - // Just to register all known types - registerTypesTypes(); -} - -WStringStruct::~WStringStruct() -{ -} - -WStringStruct::WStringStruct( - const WStringStruct& x) -{ - m_my_wstring = x.m_my_wstring; - -} - -WStringStruct::WStringStruct( - WStringStruct&& x) noexcept -{ - m_my_wstring = std::move(x.m_my_wstring); - -} - -WStringStruct& WStringStruct::operator =( - const WStringStruct& x) -{ - m_my_wstring = x.m_my_wstring; - - return *this; -} - -WStringStruct& WStringStruct::operator =( - WStringStruct&& x) noexcept -{ - m_my_wstring = std::move(x.m_my_wstring); - - return *this; -} - -bool WStringStruct::operator ==( - const WStringStruct& x) const -{ - return (m_my_wstring == x.m_my_wstring); -} - -bool WStringStruct::operator !=( - const WStringStruct& x) const -{ - return !(*this == x); -} - -size_t WStringStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return WStringStruct_max_cdr_typesize; -} - -size_t WStringStruct::getCdrSerializedSize( - const WStringStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + (data.my_wstring().size()) * 4; // 32 bits - - - return current_alignment - initial_alignment; -} - - -void WStringStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_wstring; - -} - -void WStringStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_wstring; - - -} - - -bool WStringStruct::isKeyDefined() -{ - return false; -} - -void WStringStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_wstring - * @param _my_wstring New value to be copied in member my_wstring - */ -void WStringStruct::my_wstring( - const std::wstring& _my_wstring) -{ - m_my_wstring = _my_wstring; -} - -/*! - * @brief This function moves the value in member my_wstring - * @param _my_wstring New value to be moved in member my_wstring - */ -void WStringStruct::my_wstring( - std::wstring&& _my_wstring) -{ - m_my_wstring = std::move(_my_wstring); -} - -/*! - * @brief This function returns a constant reference to member my_wstring - * @return Constant reference to member my_wstring - */ -const std::wstring& WStringStruct::my_wstring() const -{ - return m_my_wstring; -} - -/*! - * @brief This function returns a reference to member my_wstring - * @return Reference to member my_wstring - */ -std::wstring& WStringStruct::my_wstring() -{ - return m_my_wstring; -} - - - - - -LargeWStringStruct::LargeWStringStruct() -{ - // /type_15() m_my_large_wstring - - - // Just to register all known types - registerTypesTypes(); -} - -LargeWStringStruct::~LargeWStringStruct() -{ -} - -LargeWStringStruct::LargeWStringStruct( - const LargeWStringStruct& x) -{ - m_my_large_wstring = x.m_my_large_wstring; - -} - -LargeWStringStruct::LargeWStringStruct( - LargeWStringStruct&& x) noexcept -{ - m_my_large_wstring = std::move(x.m_my_large_wstring); - -} - -LargeWStringStruct& LargeWStringStruct::operator =( - const LargeWStringStruct& x) -{ - m_my_large_wstring = x.m_my_large_wstring; - - return *this; -} - -LargeWStringStruct& LargeWStringStruct::operator =( - LargeWStringStruct&& x) noexcept -{ - m_my_large_wstring = std::move(x.m_my_large_wstring); - - return *this; -} - -bool LargeWStringStruct::operator ==( - const LargeWStringStruct& x) const -{ - return (m_my_large_wstring == x.m_my_large_wstring); -} - -bool LargeWStringStruct::operator !=( - const LargeWStringStruct& x) const -{ - return !(*this == x); -} - -size_t LargeWStringStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return LargeWStringStruct_max_cdr_typesize; -} - -size_t LargeWStringStruct::getCdrSerializedSize( - const LargeWStringStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + (data.my_large_wstring().size()) * 4; // 32 bits - - - return current_alignment - initial_alignment; -} - - -void LargeWStringStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_large_wstring; - -} - -void LargeWStringStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_large_wstring; - - -} - - -bool LargeWStringStruct::isKeyDefined() -{ - return false; -} - -void LargeWStringStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_large_wstring - * @param _my_large_wstring New value to be copied in member my_large_wstring - */ -void LargeWStringStruct::my_large_wstring( - const std::wstring& _my_large_wstring) -{ - m_my_large_wstring = _my_large_wstring; -} - -/*! - * @brief This function moves the value in member my_large_wstring - * @param _my_large_wstring New value to be moved in member my_large_wstring - */ -void LargeWStringStruct::my_large_wstring( - std::wstring&& _my_large_wstring) -{ - m_my_large_wstring = std::move(_my_large_wstring); -} - -/*! - * @brief This function returns a constant reference to member my_large_wstring - * @return Constant reference to member my_large_wstring - */ -const std::wstring& LargeWStringStruct::my_large_wstring() const -{ - return m_my_large_wstring; -} - -/*! - * @brief This function returns a reference to member my_large_wstring - * @return Reference to member my_large_wstring - */ -std::wstring& LargeWStringStruct::my_large_wstring() -{ - return m_my_large_wstring; -} - - - - - -ArrayStruct::ArrayStruct() -{ - // long m_my_array - memset(&m_my_array, 0, ((2)) * 4); - - // Just to register all known types - registerTypesTypes(); -} - -ArrayStruct::~ArrayStruct() -{ -} - -ArrayStruct::ArrayStruct( - const ArrayStruct& x) -{ - m_my_array = x.m_my_array; - -} - -ArrayStruct::ArrayStruct( - ArrayStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - -} - -ArrayStruct& ArrayStruct::operator =( - const ArrayStruct& x) -{ - m_my_array = x.m_my_array; - - return *this; -} - -ArrayStruct& ArrayStruct::operator =( - ArrayStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - - return *this; -} - -bool ArrayStruct::operator ==( - const ArrayStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArrayStruct::operator !=( - const ArrayStruct& x) const -{ - return !(*this == x); -} - -size_t ArrayStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ArrayStruct_max_cdr_typesize; -} - -size_t ArrayStruct::getCdrSerializedSize( - const ArrayStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += (((2)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - - -void ArrayStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_array; - - -} - -void ArrayStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_array; - - -} - - -bool ArrayStruct::isKeyDefined() -{ - return false; -} - -void ArrayStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArrayStruct::my_array( - const std::array& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArrayStruct::my_array( - std::array&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array& ArrayStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array& ArrayStruct::my_array() -{ - return m_my_array; -} - - - - - -ArrayStructEqual::ArrayStructEqual() -{ - // long m_my_array_equal - memset(&m_my_array_equal, 0, ((2)) * 4); - - // Just to register all known types - registerTypesTypes(); -} - -ArrayStructEqual::~ArrayStructEqual() -{ -} - -ArrayStructEqual::ArrayStructEqual( - const ArrayStructEqual& x) -{ - m_my_array_equal = x.m_my_array_equal; - -} - -ArrayStructEqual::ArrayStructEqual( - ArrayStructEqual&& x) noexcept -{ - m_my_array_equal = std::move(x.m_my_array_equal); - -} - -ArrayStructEqual& ArrayStructEqual::operator =( - const ArrayStructEqual& x) -{ - m_my_array_equal = x.m_my_array_equal; - - return *this; -} - -ArrayStructEqual& ArrayStructEqual::operator =( - ArrayStructEqual&& x) noexcept -{ - m_my_array_equal = std::move(x.m_my_array_equal); - - return *this; -} - -bool ArrayStructEqual::operator ==( - const ArrayStructEqual& x) const -{ - return (m_my_array_equal == x.m_my_array_equal); -} - -bool ArrayStructEqual::operator !=( - const ArrayStructEqual& x) const -{ - return !(*this == x); -} - -size_t ArrayStructEqual::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ArrayStructEqual_max_cdr_typesize; -} - -size_t ArrayStructEqual::getCdrSerializedSize( - const ArrayStructEqual& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += (((2)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - - -void ArrayStructEqual::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_array_equal; - - -} - -void ArrayStructEqual::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_array_equal; - - -} - - -bool ArrayStructEqual::isKeyDefined() -{ - return false; -} - -void ArrayStructEqual::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_array_equal - * @param _my_array_equal New value to be copied in member my_array_equal - */ -void ArrayStructEqual::my_array_equal( - const std::array& _my_array_equal) -{ - m_my_array_equal = _my_array_equal; -} - -/*! - * @brief This function moves the value in member my_array_equal - * @param _my_array_equal New value to be moved in member my_array_equal - */ -void ArrayStructEqual::my_array_equal( - std::array&& _my_array_equal) -{ - m_my_array_equal = std::move(_my_array_equal); -} - -/*! - * @brief This function returns a constant reference to member my_array_equal - * @return Constant reference to member my_array_equal - */ -const std::array& ArrayStructEqual::my_array_equal() const -{ - return m_my_array_equal; -} - -/*! - * @brief This function returns a reference to member my_array_equal - * @return Reference to member my_array_equal - */ -std::array& ArrayStructEqual::my_array_equal() -{ - return m_my_array_equal; -} - - - - - -ArrayBadStruct::ArrayBadStruct() -{ - // octet m_my_array - memset(&m_my_array, 0, ((2)) * 1); - - // Just to register all known types - registerTypesTypes(); -} - -ArrayBadStruct::~ArrayBadStruct() -{ -} - -ArrayBadStruct::ArrayBadStruct( - const ArrayBadStruct& x) -{ - m_my_array = x.m_my_array; - -} - -ArrayBadStruct::ArrayBadStruct( - ArrayBadStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - -} - -ArrayBadStruct& ArrayBadStruct::operator =( - const ArrayBadStruct& x) -{ - m_my_array = x.m_my_array; - - return *this; -} - -ArrayBadStruct& ArrayBadStruct::operator =( - ArrayBadStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - - return *this; -} - -bool ArrayBadStruct::operator ==( - const ArrayBadStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArrayBadStruct::operator !=( - const ArrayBadStruct& x) const -{ - return !(*this == x); -} - -size_t ArrayBadStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ArrayBadStruct_max_cdr_typesize; -} - -size_t ArrayBadStruct::getCdrSerializedSize( - const ArrayBadStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += (((2)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - - -void ArrayBadStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_array; - - -} - -void ArrayBadStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_array; - - -} - - -bool ArrayBadStruct::isKeyDefined() -{ - return false; -} - -void ArrayBadStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArrayBadStruct::my_array( - const std::array& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArrayBadStruct::my_array( - std::array&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array& ArrayBadStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array& ArrayBadStruct::my_array() -{ - return m_my_array; -} - - - - - -ArrayDimensionsStruct::ArrayDimensionsStruct() -{ - // long m_my_array - memset(&m_my_array, 0, ((2) * (2)) * 4); - - // Just to register all known types - registerTypesTypes(); -} - -ArrayDimensionsStruct::~ArrayDimensionsStruct() -{ -} - -ArrayDimensionsStruct::ArrayDimensionsStruct( - const ArrayDimensionsStruct& x) -{ - m_my_array = x.m_my_array; - -} - -ArrayDimensionsStruct::ArrayDimensionsStruct( - ArrayDimensionsStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - -} - -ArrayDimensionsStruct& ArrayDimensionsStruct::operator =( - const ArrayDimensionsStruct& x) -{ - m_my_array = x.m_my_array; - - return *this; -} - -ArrayDimensionsStruct& ArrayDimensionsStruct::operator =( - ArrayDimensionsStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - - return *this; -} - -bool ArrayDimensionsStruct::operator ==( - const ArrayDimensionsStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArrayDimensionsStruct::operator !=( - const ArrayDimensionsStruct& x) const -{ - return !(*this == x); -} - -size_t ArrayDimensionsStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ArrayDimensionsStruct_max_cdr_typesize; -} - -size_t ArrayDimensionsStruct::getCdrSerializedSize( - const ArrayDimensionsStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += (((2) * (2)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - - -void ArrayDimensionsStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - for (uint32_t b = 0; b < m_my_array.size(); ++b) - { - scdr << m_my_array[b]; - - } - - - -} - -void ArrayDimensionsStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - for (uint32_t d = 0; d < m_my_array.size(); ++d) - { - dcdr >> m_my_array[d]; - - } - - - -} - - -bool ArrayDimensionsStruct::isKeyDefined() -{ - return false; -} - -void ArrayDimensionsStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArrayDimensionsStruct::my_array( - const std::array, 2>& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArrayDimensionsStruct::my_array( - std::array, 2>&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array, 2>& ArrayDimensionsStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array, 2>& ArrayDimensionsStruct::my_array() -{ - return m_my_array; -} - - - - - -ArraySizeStruct::ArraySizeStruct() -{ - // long m_my_array - memset(&m_my_array, 0, ((5)) * 4); - - // Just to register all known types - registerTypesTypes(); -} - -ArraySizeStruct::~ArraySizeStruct() -{ -} - -ArraySizeStruct::ArraySizeStruct( - const ArraySizeStruct& x) -{ - m_my_array = x.m_my_array; - -} - -ArraySizeStruct::ArraySizeStruct( - ArraySizeStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - -} - -ArraySizeStruct& ArraySizeStruct::operator =( - const ArraySizeStruct& x) -{ - m_my_array = x.m_my_array; - - return *this; -} - -ArraySizeStruct& ArraySizeStruct::operator =( - ArraySizeStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - - return *this; -} - -bool ArraySizeStruct::operator ==( - const ArraySizeStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArraySizeStruct::operator !=( - const ArraySizeStruct& x) const -{ - return !(*this == x); -} - -size_t ArraySizeStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ArraySizeStruct_max_cdr_typesize; -} - -size_t ArraySizeStruct::getCdrSerializedSize( - const ArraySizeStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += (((5)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - - -void ArraySizeStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_array; - - -} - -void ArraySizeStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_array; - - -} - - -bool ArraySizeStruct::isKeyDefined() -{ - return false; -} - -void ArraySizeStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArraySizeStruct::my_array( - const std::array& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArraySizeStruct::my_array( - std::array&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array& ArraySizeStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array& ArraySizeStruct::my_array() -{ - return m_my_array; -} - - - - - - - -SequenceStruct::SequenceStruct() -{ - // sequence m_my_sequence - - - // Just to register all known types - registerTypesTypes(); -} - -SequenceStruct::~SequenceStruct() -{ -} - -SequenceStruct::SequenceStruct( - const SequenceStruct& x) -{ - m_my_sequence = x.m_my_sequence; - -} - -SequenceStruct::SequenceStruct( - SequenceStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); - -} - -SequenceStruct& SequenceStruct::operator =( - const SequenceStruct& x) -{ - m_my_sequence = x.m_my_sequence; - - return *this; -} - -SequenceStruct& SequenceStruct::operator =( - SequenceStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); - - return *this; -} - -bool SequenceStruct::operator ==( - const SequenceStruct& x) const -{ - return (m_my_sequence == x.m_my_sequence); -} - -bool SequenceStruct::operator !=( - const SequenceStruct& x) const -{ - return !(*this == x); -} - -size_t SequenceStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SequenceStruct_max_cdr_typesize; -} - -size_t SequenceStruct::getCdrSerializedSize( - const SequenceStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.my_sequence().size() > 0) - { - current_alignment += (data.my_sequence().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - - return current_alignment - initial_alignment; -} - - -void SequenceStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_sequence; - - -} - -void SequenceStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_sequence; - - -} - - -bool SequenceStruct::isKeyDefined() -{ - return false; -} - -void SequenceStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ -void SequenceStruct::my_sequence( - const std::vector& _my_sequence) -{ - m_my_sequence = _my_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ -void SequenceStruct::my_sequence( - std::vector&& _my_sequence) -{ - m_my_sequence = std::move(_my_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ -const std::vector& SequenceStruct::my_sequence() const -{ - return m_my_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ -std::vector& SequenceStruct::my_sequence() -{ - return m_my_sequence; -} - - - - - - - -SequenceStructEqual::SequenceStructEqual() -{ - // sequence m_my_sequence_equal - - - // Just to register all known types - registerTypesTypes(); -} - -SequenceStructEqual::~SequenceStructEqual() -{ -} - -SequenceStructEqual::SequenceStructEqual( - const SequenceStructEqual& x) -{ - m_my_sequence_equal = x.m_my_sequence_equal; - -} - -SequenceStructEqual::SequenceStructEqual( - SequenceStructEqual&& x) noexcept -{ - m_my_sequence_equal = std::move(x.m_my_sequence_equal); - -} - -SequenceStructEqual& SequenceStructEqual::operator =( - const SequenceStructEqual& x) -{ - m_my_sequence_equal = x.m_my_sequence_equal; - - return *this; -} - -SequenceStructEqual& SequenceStructEqual::operator =( - SequenceStructEqual&& x) noexcept -{ - m_my_sequence_equal = std::move(x.m_my_sequence_equal); - - return *this; -} - -bool SequenceStructEqual::operator ==( - const SequenceStructEqual& x) const -{ - return (m_my_sequence_equal == x.m_my_sequence_equal); -} - -bool SequenceStructEqual::operator !=( - const SequenceStructEqual& x) const -{ - return !(*this == x); -} - -size_t SequenceStructEqual::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SequenceStructEqual_max_cdr_typesize; -} - -size_t SequenceStructEqual::getCdrSerializedSize( - const SequenceStructEqual& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.my_sequence_equal().size() > 0) - { - current_alignment += (data.my_sequence_equal().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - - return current_alignment - initial_alignment; -} - - -void SequenceStructEqual::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_sequence_equal; - - -} - -void SequenceStructEqual::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_sequence_equal; - - -} - - -bool SequenceStructEqual::isKeyDefined() -{ - return false; -} - -void SequenceStructEqual::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_sequence_equal - * @param _my_sequence_equal New value to be copied in member my_sequence_equal - */ -void SequenceStructEqual::my_sequence_equal( - const std::vector& _my_sequence_equal) -{ - m_my_sequence_equal = _my_sequence_equal; -} - -/*! - * @brief This function moves the value in member my_sequence_equal - * @param _my_sequence_equal New value to be moved in member my_sequence_equal - */ -void SequenceStructEqual::my_sequence_equal( - std::vector&& _my_sequence_equal) -{ - m_my_sequence_equal = std::move(_my_sequence_equal); -} - -/*! - * @brief This function returns a constant reference to member my_sequence_equal - * @return Constant reference to member my_sequence_equal - */ -const std::vector& SequenceStructEqual::my_sequence_equal() const -{ - return m_my_sequence_equal; -} - -/*! - * @brief This function returns a reference to member my_sequence_equal - * @return Reference to member my_sequence_equal - */ -std::vector& SequenceStructEqual::my_sequence_equal() -{ - return m_my_sequence_equal; -} - - - - - - - -SequenceBadStruct::SequenceBadStruct() -{ - // sequence m_my_sequence - - - // Just to register all known types - registerTypesTypes(); -} - -SequenceBadStruct::~SequenceBadStruct() -{ -} - -SequenceBadStruct::SequenceBadStruct( - const SequenceBadStruct& x) -{ - m_my_sequence = x.m_my_sequence; - -} - -SequenceBadStruct::SequenceBadStruct( - SequenceBadStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); - -} - -SequenceBadStruct& SequenceBadStruct::operator =( - const SequenceBadStruct& x) -{ - m_my_sequence = x.m_my_sequence; - - return *this; -} - -SequenceBadStruct& SequenceBadStruct::operator =( - SequenceBadStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); - - return *this; -} - -bool SequenceBadStruct::operator ==( - const SequenceBadStruct& x) const -{ - return (m_my_sequence == x.m_my_sequence); -} - -bool SequenceBadStruct::operator !=( - const SequenceBadStruct& x) const -{ - return !(*this == x); -} - -size_t SequenceBadStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SequenceBadStruct_max_cdr_typesize; -} - -size_t SequenceBadStruct::getCdrSerializedSize( - const SequenceBadStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.my_sequence().size() > 0) - { - current_alignment += (data.my_sequence().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - - return current_alignment - initial_alignment; -} - - -void SequenceBadStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_sequence; - - -} - -void SequenceBadStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_sequence; - - -} - - -bool SequenceBadStruct::isKeyDefined() -{ - return false; -} - -void SequenceBadStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ -void SequenceBadStruct::my_sequence( - const std::vector& _my_sequence) -{ - m_my_sequence = _my_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ -void SequenceBadStruct::my_sequence( - std::vector&& _my_sequence) -{ - m_my_sequence = std::move(_my_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ -const std::vector& SequenceBadStruct::my_sequence() const -{ - return m_my_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ -std::vector& SequenceBadStruct::my_sequence() -{ - return m_my_sequence; -} - - - - - - - -SequenceBoundsStruct::SequenceBoundsStruct() -{ - // sequence m_my_sequence - - - // Just to register all known types - registerTypesTypes(); -} - -SequenceBoundsStruct::~SequenceBoundsStruct() -{ -} - -SequenceBoundsStruct::SequenceBoundsStruct( - const SequenceBoundsStruct& x) -{ - m_my_sequence = x.m_my_sequence; - -} - -SequenceBoundsStruct::SequenceBoundsStruct( - SequenceBoundsStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); - -} - -SequenceBoundsStruct& SequenceBoundsStruct::operator =( - const SequenceBoundsStruct& x) -{ - m_my_sequence = x.m_my_sequence; - - return *this; -} - -SequenceBoundsStruct& SequenceBoundsStruct::operator =( - SequenceBoundsStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); - - return *this; -} - -bool SequenceBoundsStruct::operator ==( - const SequenceBoundsStruct& x) const -{ - return (m_my_sequence == x.m_my_sequence); -} - -bool SequenceBoundsStruct::operator !=( - const SequenceBoundsStruct& x) const -{ - return !(*this == x); -} - -size_t SequenceBoundsStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SequenceBoundsStruct_max_cdr_typesize; -} - -size_t SequenceBoundsStruct::getCdrSerializedSize( - const SequenceBoundsStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.my_sequence().size() > 0) - { - current_alignment += (data.my_sequence().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - - return current_alignment - initial_alignment; -} - - -void SequenceBoundsStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_sequence; - - -} - -void SequenceBoundsStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_sequence; - - -} - - -bool SequenceBoundsStruct::isKeyDefined() -{ - return false; -} - -void SequenceBoundsStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ -void SequenceBoundsStruct::my_sequence( - const std::vector& _my_sequence) -{ - m_my_sequence = _my_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ -void SequenceBoundsStruct::my_sequence( - std::vector&& _my_sequence) -{ - m_my_sequence = std::move(_my_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ -const std::vector& SequenceBoundsStruct::my_sequence() const -{ - return m_my_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ -std::vector& SequenceBoundsStruct::my_sequence() -{ - return m_my_sequence; -} - - - - - - - - - -SequenceSequenceStruct::SequenceSequenceStruct() -{ - // sequence, 3> m_my_sequence_sequence - - - // Just to register all known types - registerTypesTypes(); -} - -SequenceSequenceStruct::~SequenceSequenceStruct() -{ -} - -SequenceSequenceStruct::SequenceSequenceStruct( - const SequenceSequenceStruct& x) -{ - m_my_sequence_sequence = x.m_my_sequence_sequence; - -} - -SequenceSequenceStruct::SequenceSequenceStruct( - SequenceSequenceStruct&& x) noexcept -{ - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - -} - -SequenceSequenceStruct& SequenceSequenceStruct::operator =( - const SequenceSequenceStruct& x) -{ - m_my_sequence_sequence = x.m_my_sequence_sequence; - - return *this; -} - -SequenceSequenceStruct& SequenceSequenceStruct::operator =( - SequenceSequenceStruct&& x) noexcept -{ - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - - return *this; -} - -bool SequenceSequenceStruct::operator ==( - const SequenceSequenceStruct& x) const -{ - return (m_my_sequence_sequence == x.m_my_sequence_sequence); -} - -bool SequenceSequenceStruct::operator !=( - const SequenceSequenceStruct& x) const -{ - return !(*this == x); -} - -size_t SequenceSequenceStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SequenceSequenceStruct_max_cdr_typesize; -} - -size_t SequenceSequenceStruct::getCdrSerializedSize( - const SequenceSequenceStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.my_sequence_sequence().size(); ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.my_sequence_sequence().at(a).size() > 0) - { - current_alignment += (data.my_sequence_sequence().at(a).size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - } - - - - return current_alignment - initial_alignment; -} - - -void SequenceSequenceStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_sequence_sequence; - - -} - -void SequenceSequenceStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_sequence_sequence; - - -} - - -bool SequenceSequenceStruct::isKeyDefined() -{ - return false; -} - -void SequenceSequenceStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ -void SequenceSequenceStruct::my_sequence_sequence( - const std::vector>& _my_sequence_sequence) -{ - m_my_sequence_sequence = _my_sequence_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ -void SequenceSequenceStruct::my_sequence_sequence( - std::vector>&& _my_sequence_sequence) -{ - m_my_sequence_sequence = std::move(_my_sequence_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ -const std::vector>& SequenceSequenceStruct::my_sequence_sequence() const -{ - return m_my_sequence_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ -std::vector>& SequenceSequenceStruct::my_sequence_sequence() -{ - return m_my_sequence_sequence; -} - - - - - - - - - -SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct() -{ - // sequence, 5> m_my_sequence_sequence - - - // Just to register all known types - registerTypesTypes(); -} - -SequenceSequenceBoundsStruct::~SequenceSequenceBoundsStruct() -{ -} - -SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct( - const SequenceSequenceBoundsStruct& x) -{ - m_my_sequence_sequence = x.m_my_sequence_sequence; - -} - -SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct( - SequenceSequenceBoundsStruct&& x) noexcept -{ - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - -} - -SequenceSequenceBoundsStruct& SequenceSequenceBoundsStruct::operator =( - const SequenceSequenceBoundsStruct& x) -{ - m_my_sequence_sequence = x.m_my_sequence_sequence; - - return *this; -} - -SequenceSequenceBoundsStruct& SequenceSequenceBoundsStruct::operator =( - SequenceSequenceBoundsStruct&& x) noexcept -{ - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - - return *this; -} - -bool SequenceSequenceBoundsStruct::operator ==( - const SequenceSequenceBoundsStruct& x) const -{ - return (m_my_sequence_sequence == x.m_my_sequence_sequence); -} - -bool SequenceSequenceBoundsStruct::operator !=( - const SequenceSequenceBoundsStruct& x) const -{ - return !(*this == x); -} - -size_t SequenceSequenceBoundsStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SequenceSequenceBoundsStruct_max_cdr_typesize; -} - -size_t SequenceSequenceBoundsStruct::getCdrSerializedSize( - const SequenceSequenceBoundsStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.my_sequence_sequence().size(); ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.my_sequence_sequence().at(a).size() > 0) - { - current_alignment += (data.my_sequence_sequence().at(a).size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - } - - - - return current_alignment - initial_alignment; -} - - -void SequenceSequenceBoundsStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_sequence_sequence; - - -} - -void SequenceSequenceBoundsStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_sequence_sequence; - - -} - - -bool SequenceSequenceBoundsStruct::isKeyDefined() -{ - return false; -} - -void SequenceSequenceBoundsStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ -void SequenceSequenceBoundsStruct::my_sequence_sequence( - const std::vector>& _my_sequence_sequence) -{ - m_my_sequence_sequence = _my_sequence_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ -void SequenceSequenceBoundsStruct::my_sequence_sequence( - std::vector>&& _my_sequence_sequence) -{ - m_my_sequence_sequence = std::move(_my_sequence_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ -const std::vector>& SequenceSequenceBoundsStruct::my_sequence_sequence() const -{ - return m_my_sequence_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ -std::vector>& SequenceSequenceBoundsStruct::my_sequence_sequence() -{ - return m_my_sequence_sequence; -} - - - - - - - -MapStruct::MapStruct() -{ - // map m_my_map - - - // Just to register all known types - registerTypesTypes(); -} - -MapStruct::~MapStruct() -{ -} - -MapStruct::MapStruct( - const MapStruct& x) -{ - m_my_map = x.m_my_map; - -} - -MapStruct::MapStruct( - MapStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - -} - -MapStruct& MapStruct::operator =( - const MapStruct& x) -{ - m_my_map = x.m_my_map; - - return *this; -} - -MapStruct& MapStruct::operator =( - MapStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - - return *this; -} - -bool MapStruct::operator ==( - const MapStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapStruct::operator !=( - const MapStruct& x) const -{ - return !(*this == x); -} - -size_t MapStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MapStruct_max_cdr_typesize; -} - -size_t MapStruct::getCdrSerializedSize( - const MapStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map()) - { - (void)a; - - 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 MapStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << static_cast(m_my_map.size()); - for (const auto& pair : m_my_map) - { - scdr << pair.first; - scdr << pair.second; - } - -} - -void MapStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_my_map; - - -} - - -bool MapStruct::isKeyDefined() -{ - return false; -} - -void MapStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapStruct::my_map() -{ - return m_my_map; -} - - - - - - - -MapStructEqual::MapStructEqual() -{ - // map m_my_map_equal - - - // Just to register all known types - registerTypesTypes(); -} - -MapStructEqual::~MapStructEqual() -{ -} - -MapStructEqual::MapStructEqual( - const MapStructEqual& x) -{ - m_my_map_equal = x.m_my_map_equal; - -} - -MapStructEqual::MapStructEqual( - MapStructEqual&& x) noexcept -{ - m_my_map_equal = std::move(x.m_my_map_equal); - -} - -MapStructEqual& MapStructEqual::operator =( - const MapStructEqual& x) -{ - m_my_map_equal = x.m_my_map_equal; - - return *this; -} - -MapStructEqual& MapStructEqual::operator =( - MapStructEqual&& x) noexcept -{ - m_my_map_equal = std::move(x.m_my_map_equal); - - return *this; -} - -bool MapStructEqual::operator ==( - const MapStructEqual& x) const -{ - return (m_my_map_equal == x.m_my_map_equal); -} - -bool MapStructEqual::operator !=( - const MapStructEqual& x) const -{ - return !(*this == x); -} - -size_t MapStructEqual::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MapStructEqual_max_cdr_typesize; -} - -size_t MapStructEqual::getCdrSerializedSize( - const MapStructEqual& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map_equal()) - { - (void)a; - - 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 MapStructEqual::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << static_cast(m_my_map_equal.size()); - for (const auto& pair : m_my_map_equal) - { - scdr << pair.first; - scdr << pair.second; - } - -} - -void MapStructEqual::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_my_map_equal; - - -} - - -bool MapStructEqual::isKeyDefined() -{ - return false; -} - -void MapStructEqual::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_map_equal - * @param _my_map_equal New value to be copied in member my_map_equal - */ -void MapStructEqual::my_map_equal( - const std::map& _my_map_equal) -{ - m_my_map_equal = _my_map_equal; -} - -/*! - * @brief This function moves the value in member my_map_equal - * @param _my_map_equal New value to be moved in member my_map_equal - */ -void MapStructEqual::my_map_equal( - std::map&& _my_map_equal) -{ - m_my_map_equal = std::move(_my_map_equal); -} - -/*! - * @brief This function returns a constant reference to member my_map_equal - * @return Constant reference to member my_map_equal - */ -const std::map& MapStructEqual::my_map_equal() const -{ - return m_my_map_equal; -} - -/*! - * @brief This function returns a reference to member my_map_equal - * @return Reference to member my_map_equal - */ -std::map& MapStructEqual::my_map_equal() -{ - return m_my_map_equal; -} - - - - - - - -MapBadKeyStruct::MapBadKeyStruct() -{ - // map m_my_map - - - // Just to register all known types - registerTypesTypes(); -} - -MapBadKeyStruct::~MapBadKeyStruct() -{ -} - -MapBadKeyStruct::MapBadKeyStruct( - const MapBadKeyStruct& x) -{ - m_my_map = x.m_my_map; - -} - -MapBadKeyStruct::MapBadKeyStruct( - MapBadKeyStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - -} - -MapBadKeyStruct& MapBadKeyStruct::operator =( - const MapBadKeyStruct& x) -{ - m_my_map = x.m_my_map; - - return *this; -} - -MapBadKeyStruct& MapBadKeyStruct::operator =( - MapBadKeyStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - - return *this; -} - -bool MapBadKeyStruct::operator ==( - const MapBadKeyStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapBadKeyStruct::operator !=( - const MapBadKeyStruct& x) const -{ - return !(*this == x); -} - -size_t MapBadKeyStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MapBadKeyStruct_max_cdr_typesize; -} - -size_t MapBadKeyStruct::getCdrSerializedSize( - const MapBadKeyStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map()) - { - (void)a; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - } - - - return current_alignment - initial_alignment; -} - - -void MapBadKeyStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << static_cast(m_my_map.size()); - for (const auto& pair : m_my_map) - { - scdr << pair.first; - scdr << pair.second; - } - -} - -void MapBadKeyStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_my_map; - - -} - - -bool MapBadKeyStruct::isKeyDefined() -{ - return false; -} - -void MapBadKeyStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapBadKeyStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapBadKeyStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapBadKeyStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapBadKeyStruct::my_map() -{ - return m_my_map; -} - - - - - - - -MapBadElemStruct::MapBadElemStruct() -{ - // map m_my_map - - - // Just to register all known types - registerTypesTypes(); -} - -MapBadElemStruct::~MapBadElemStruct() -{ -} - -MapBadElemStruct::MapBadElemStruct( - const MapBadElemStruct& x) -{ - m_my_map = x.m_my_map; - -} - -MapBadElemStruct::MapBadElemStruct( - MapBadElemStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - -} - -MapBadElemStruct& MapBadElemStruct::operator =( - const MapBadElemStruct& x) -{ - m_my_map = x.m_my_map; - - return *this; -} - -MapBadElemStruct& MapBadElemStruct::operator =( - MapBadElemStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - - return *this; -} - -bool MapBadElemStruct::operator ==( - const MapBadElemStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapBadElemStruct::operator !=( - const MapBadElemStruct& x) const -{ - return !(*this == x); -} - -size_t MapBadElemStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MapBadElemStruct_max_cdr_typesize; -} - -size_t MapBadElemStruct::getCdrSerializedSize( - const MapBadElemStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map()) - { - (void)a; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - } - - - return current_alignment - initial_alignment; -} - - -void MapBadElemStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << static_cast(m_my_map.size()); - for (const auto& pair : m_my_map) - { - scdr << pair.first; - scdr << pair.second; - } - -} - -void MapBadElemStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_my_map; - - -} - - -bool MapBadElemStruct::isKeyDefined() -{ - return false; -} - -void MapBadElemStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapBadElemStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapBadElemStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapBadElemStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapBadElemStruct::my_map() -{ - return m_my_map; -} - - - - - - - -MapBoundsStruct::MapBoundsStruct() -{ - // map m_my_map - - - // Just to register all known types - registerTypesTypes(); -} - -MapBoundsStruct::~MapBoundsStruct() -{ -} - -MapBoundsStruct::MapBoundsStruct( - const MapBoundsStruct& x) -{ - m_my_map = x.m_my_map; - -} - -MapBoundsStruct::MapBoundsStruct( - MapBoundsStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - -} - -MapBoundsStruct& MapBoundsStruct::operator =( - const MapBoundsStruct& x) -{ - m_my_map = x.m_my_map; - - return *this; -} - -MapBoundsStruct& MapBoundsStruct::operator =( - MapBoundsStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - - return *this; -} - -bool MapBoundsStruct::operator ==( - const MapBoundsStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapBoundsStruct::operator !=( - const MapBoundsStruct& x) const -{ - return !(*this == x); -} - -size_t MapBoundsStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MapBoundsStruct_max_cdr_typesize; -} - -size_t MapBoundsStruct::getCdrSerializedSize( - const MapBoundsStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map()) - { - (void)a; - - 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 MapBoundsStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << static_cast(m_my_map.size()); - for (const auto& pair : m_my_map) - { - scdr << pair.first; - scdr << pair.second; - } - -} - -void MapBoundsStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_my_map; - - -} - - -bool MapBoundsStruct::isKeyDefined() -{ - return false; -} - -void MapBoundsStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapBoundsStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapBoundsStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapBoundsStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapBoundsStruct::my_map() -{ - return m_my_map; -} - - - - - - - - - -MapMapStruct::MapMapStruct() -{ - // map> m_my_map_map - - - // Just to register all known types - registerTypesTypes(); -} - -MapMapStruct::~MapMapStruct() -{ -} - -MapMapStruct::MapMapStruct( - const MapMapStruct& x) -{ - m_my_map_map = x.m_my_map_map; - -} - -MapMapStruct::MapMapStruct( - MapMapStruct&& x) noexcept -{ - m_my_map_map = std::move(x.m_my_map_map); - -} - -MapMapStruct& MapMapStruct::operator =( - const MapMapStruct& x) -{ - m_my_map_map = x.m_my_map_map; - - return *this; -} - -MapMapStruct& MapMapStruct::operator =( - MapMapStruct&& x) noexcept -{ - m_my_map_map = std::move(x.m_my_map_map); - - return *this; -} - -bool MapMapStruct::operator ==( - const MapMapStruct& x) const -{ - return (m_my_map_map == x.m_my_map_map); -} - -bool MapMapStruct::operator !=( - const MapMapStruct& x) const -{ - return !(*this == x); -} - -size_t MapMapStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MapMapStruct_max_cdr_typesize; -} - -size_t MapMapStruct::getCdrSerializedSize( - const MapMapStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map_map()) - { - (void)a; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto b : a.second) - { - (void)b; - - 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 MapMapStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << static_cast(m_my_map_map.size()); - for (const auto& pair : m_my_map_map) - { - scdr << pair.first; - scdr << pair.second; - } - -} - -void MapMapStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_my_map_map; - - -} - - -bool MapMapStruct::isKeyDefined() -{ - return false; -} - -void MapMapStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ -void MapMapStruct::my_map_map( - const std::map>& _my_map_map) -{ - m_my_map_map = _my_map_map; -} - -/*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ -void MapMapStruct::my_map_map( - std::map>&& _my_map_map) -{ - m_my_map_map = std::move(_my_map_map); -} - -/*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ -const std::map>& MapMapStruct::my_map_map() const -{ - return m_my_map_map; -} - -/*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ -std::map>& MapMapStruct::my_map_map() -{ - return m_my_map_map; -} - - - - - - - - - -MapMapBoundsStruct::MapMapBoundsStruct() -{ - // map> m_my_map_map - - - // Just to register all known types - registerTypesTypes(); -} - -MapMapBoundsStruct::~MapMapBoundsStruct() -{ -} - -MapMapBoundsStruct::MapMapBoundsStruct( - const MapMapBoundsStruct& x) -{ - m_my_map_map = x.m_my_map_map; - -} - -MapMapBoundsStruct::MapMapBoundsStruct( - MapMapBoundsStruct&& x) noexcept -{ - m_my_map_map = std::move(x.m_my_map_map); - -} - -MapMapBoundsStruct& MapMapBoundsStruct::operator =( - const MapMapBoundsStruct& x) -{ - m_my_map_map = x.m_my_map_map; - - return *this; -} - -MapMapBoundsStruct& MapMapBoundsStruct::operator =( - MapMapBoundsStruct&& x) noexcept -{ - m_my_map_map = std::move(x.m_my_map_map); - - return *this; -} - -bool MapMapBoundsStruct::operator ==( - const MapMapBoundsStruct& x) const -{ - return (m_my_map_map == x.m_my_map_map); -} - -bool MapMapBoundsStruct::operator !=( - const MapMapBoundsStruct& x) const -{ - return !(*this == x); -} - -size_t MapMapBoundsStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MapMapBoundsStruct_max_cdr_typesize; -} - -size_t MapMapBoundsStruct::getCdrSerializedSize( - const MapMapBoundsStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map_map()) - { - (void)a; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto b : a.second) - { - (void)b; - - 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 MapMapBoundsStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << static_cast(m_my_map_map.size()); - for (const auto& pair : m_my_map_map) - { - scdr << pair.first; - scdr << pair.second; - } - -} - -void MapMapBoundsStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_my_map_map; - - -} - - -bool MapMapBoundsStruct::isKeyDefined() -{ - return false; -} - -void MapMapBoundsStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ -void MapMapBoundsStruct::my_map_map( - const std::map>& _my_map_map) -{ - m_my_map_map = _my_map_map; -} - -/*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ -void MapMapBoundsStruct::my_map_map( - std::map>&& _my_map_map) -{ - m_my_map_map = std::move(_my_map_map); -} - -/*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ -const std::map>& MapMapBoundsStruct::my_map_map() const -{ - return m_my_map_map; -} - -/*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ -std::map>& MapMapBoundsStruct::my_map_map() -{ - return m_my_map_map; -} - - - - - -SimpleUnion::SimpleUnion() -{ - m__d = A; - // long m_first - m_first = 0; - // long long m_second - m_second = 0; -} - -SimpleUnion::~SimpleUnion() -{ -} - -SimpleUnion::SimpleUnion( - const SimpleUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleUnion::SimpleUnion( - SimpleUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleUnion& SimpleUnion::operator =( - const SimpleUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleUnion& SimpleUnion::operator =( - SimpleUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleUnion::operator ==( - const SimpleUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case B: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleUnion::operator !=( - const SimpleUnion& x) const -{ - return !(*this == x); -} - -void SimpleUnion::_d( - int32_t __d) -{ - bool b = false; - - switch(m__d) - { - case A: - switch(__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch(__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleUnion::_d() const -{ - return m__d; -} - -int32_t& SimpleUnion::_d() -{ - return m__d; -} - -void SimpleUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = A; - -} - -int32_t SimpleUnion::first() const -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& SimpleUnion::first() -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = B; - -} - -int64_t SimpleUnion::second() const -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleUnion::second() -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - -// TODO(Ricardo) Review -size_t SimpleUnion::getCdrSerializedSize( - const SimpleUnion& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - switch(data.m__d) - { - case A: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - - - case B: - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void SimpleUnion::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m__d; - - switch(m__d) - { - case A: - scdr << m_first; - - break; - - - case B: - scdr << m_second; - - break; - - default: - break; - } -} - -void SimpleUnion::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m__d; - - - switch(m__d) - { - case A: - dcdr >> m_first; - - - break; - - - case B: - dcdr >> m_second; - - - break; - - default: - break; - } -} - - - - - -SimpleUnionNames::SimpleUnionNames() -{ - m__d = A; - // long m_first_case - m_first_case = 0; - // long long m_second_case - m_second_case = 0; -} - -SimpleUnionNames::~SimpleUnionNames() -{ -} - -SimpleUnionNames::SimpleUnionNames( - const SimpleUnionNames& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } -} - -SimpleUnionNames::SimpleUnionNames( - SimpleUnionNames&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } -} - -SimpleUnionNames& SimpleUnionNames::operator =( - const SimpleUnionNames& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } - - return *this; -} - -SimpleUnionNames& SimpleUnionNames::operator =( - SimpleUnionNames&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } - - return *this; -} - -bool SimpleUnionNames::operator ==( - const SimpleUnionNames& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case A: - return (m_first_case == x.m_first_case); - break; - - - case B: - return (m_second_case == x.m_second_case); - break; - - default: - break; - } - return false; -} - -bool SimpleUnionNames::operator !=( - const SimpleUnionNames& x) const -{ - return !(*this == x); -} - -void SimpleUnionNames::_d( - int32_t __d) -{ - bool b = false; - - switch(m__d) - { - case A: - switch(__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch(__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleUnionNames::_d() const -{ - return m__d; -} - -int32_t& SimpleUnionNames::_d() -{ - return m__d; -} - -void SimpleUnionNames::first_case( - int32_t _first_case) -{ - m_first_case = _first_case; - m__d = A; - -} - -int32_t SimpleUnionNames::first_case() const -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first_case; -} - -int32_t& SimpleUnionNames::first_case() -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first_case; -} - - -void SimpleUnionNames::second_case( - int64_t _second_case) -{ - m_second_case = _second_case; - m__d = B; - -} - -int64_t SimpleUnionNames::second_case() const -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second_case; -} - -int64_t& SimpleUnionNames::second_case() -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second_case; -} - - -// TODO(Ricardo) Review -size_t SimpleUnionNames::getCdrSerializedSize( - const SimpleUnionNames& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - switch(data.m__d) - { - case A: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - - - case B: - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void SimpleUnionNames::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m__d; - - switch(m__d) - { - case A: - scdr << m_first_case; - - break; - - - case B: - scdr << m_second_case; - - break; - - default: - break; - } -} - -void SimpleUnionNames::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m__d; - - - switch(m__d) - { - case A: - dcdr >> m_first_case; - - - break; - - - case B: - dcdr >> m_second_case; - - - break; - - default: - break; - } -} - - - - - -SimpleTypeUnion::SimpleTypeUnion() -{ - m__d = A; - // octet m_first - m_first = 0; - // long long m_second - m_second = 0; -} - -SimpleTypeUnion::~SimpleTypeUnion() -{ -} - -SimpleTypeUnion::SimpleTypeUnion( - const SimpleTypeUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleTypeUnion::SimpleTypeUnion( - SimpleTypeUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleTypeUnion& SimpleTypeUnion::operator =( - const SimpleTypeUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleTypeUnion& SimpleTypeUnion::operator =( - SimpleTypeUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleTypeUnion::operator ==( - const SimpleTypeUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case B: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleTypeUnion::operator !=( - const SimpleTypeUnion& x) const -{ - return !(*this == x); -} - -void SimpleTypeUnion::_d( - int32_t __d) -{ - bool b = false; - - switch(m__d) - { - case A: - switch(__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch(__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleTypeUnion::_d() const -{ - return m__d; -} - -int32_t& SimpleTypeUnion::_d() -{ - return m__d; -} - -void SimpleTypeUnion::first( - uint8_t _first) -{ - m_first = _first; - m__d = A; - -} - -uint8_t SimpleTypeUnion::first() const -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -uint8_t& SimpleTypeUnion::first() -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleTypeUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = B; - -} - -int64_t SimpleTypeUnion::second() const -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleTypeUnion::second() -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - -// TODO(Ricardo) Review -size_t SimpleTypeUnion::getCdrSerializedSize( - const SimpleTypeUnion& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - switch(data.m__d) - { - case A: - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - break; - - - case B: - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void SimpleTypeUnion::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m__d; - - switch(m__d) - { - case A: - scdr << m_first; - - break; - - - case B: - scdr << m_second; - - break; - - default: - break; - } -} - -void SimpleTypeUnion::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m__d; - - - switch(m__d) - { - case A: - dcdr >> m_first; - - - break; - - - case B: - dcdr >> m_second; - - - break; - - default: - break; - } -} - - - - - -SimpleBadUnion::SimpleBadUnion() -{ - m__d = A; - // long m_first - m_first = 0; - // long long m_second - m_second = 0; -} - -SimpleBadUnion::~SimpleBadUnion() -{ -} - -SimpleBadUnion::SimpleBadUnion( - const SimpleBadUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadUnion::SimpleBadUnion( - SimpleBadUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadUnion& SimpleBadUnion::operator =( - const SimpleBadUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleBadUnion& SimpleBadUnion::operator =( - SimpleBadUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleBadUnion::operator ==( - const SimpleBadUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case C: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleBadUnion::operator !=( - const SimpleBadUnion& x) const -{ - return !(*this == x); -} - -void SimpleBadUnion::_d( - int32_t __d) -{ - bool b = false; - - switch(m__d) - { - case A: - switch(__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case C: - switch(__d) - { - case C: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleBadUnion::_d() const -{ - return m__d; -} - -int32_t& SimpleBadUnion::_d() -{ - return m__d; -} - -void SimpleBadUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = A; - -} - -int32_t SimpleBadUnion::first() const -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& SimpleBadUnion::first() -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleBadUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = C; - -} - -int64_t SimpleBadUnion::second() const -{ - bool b = false; - - switch(m__d) - { - case C: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleBadUnion::second() -{ - bool b = false; - - switch(m__d) - { - case C: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - -// TODO(Ricardo) Review -size_t SimpleBadUnion::getCdrSerializedSize( - const SimpleBadUnion& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - switch(data.m__d) - { - case A: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - - - case C: - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void SimpleBadUnion::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m__d; - - switch(m__d) - { - case A: - scdr << m_first; - - break; - - - case C: - scdr << m_second; - - break; - - default: - break; - } -} - -void SimpleBadUnion::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m__d; - - - switch(m__d) - { - case A: - dcdr >> m_first; - - - break; - - - case C: - dcdr >> m_second; - - - break; - - default: - break; - } -} - - - - - -SimpleBadDiscUnion::SimpleBadDiscUnion() -{ - m__d = 0; - // long m_first - m_first = 0; - // long long m_second - m_second = 0; -} - -SimpleBadDiscUnion::~SimpleBadDiscUnion() -{ -} - -SimpleBadDiscUnion::SimpleBadDiscUnion( - const SimpleBadDiscUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadDiscUnion::SimpleBadDiscUnion( - SimpleBadDiscUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadDiscUnion& SimpleBadDiscUnion::operator =( - const SimpleBadDiscUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleBadDiscUnion& SimpleBadDiscUnion::operator =( - SimpleBadDiscUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleBadDiscUnion::operator ==( - const SimpleBadDiscUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case 0: - return (m_first == x.m_first); - break; - - - case 1: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleBadDiscUnion::operator !=( - const SimpleBadDiscUnion& x) const -{ - return !(*this == x); -} - -void SimpleBadDiscUnion::_d( - uint8_t __d) -{ - bool b = false; - - switch(m__d) - { - case 0: - switch(__d) - { - case 0: - b = true; - break; - default: - break; - } - break; - - - case 1: - switch(__d) - { - case 1: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -uint8_t SimpleBadDiscUnion::_d() const -{ - return m__d; -} - -uint8_t& SimpleBadDiscUnion::_d() -{ - return m__d; -} - -void SimpleBadDiscUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = 0; - -} - -int32_t SimpleBadDiscUnion::first() const -{ - bool b = false; - - switch(m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& SimpleBadDiscUnion::first() -{ - bool b = false; - - switch(m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleBadDiscUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = 1; - -} - -int64_t SimpleBadDiscUnion::second() const -{ - bool b = false; - - switch(m__d) - { - case 1: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleBadDiscUnion::second() -{ - bool b = false; - - switch(m__d) - { - case 1: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - -// TODO(Ricardo) Review -size_t SimpleBadDiscUnion::getCdrSerializedSize( - const SimpleBadDiscUnion& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - switch(data.m__d) - { - case 0: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - - - case 1: - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void SimpleBadDiscUnion::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m__d; - - switch(m__d) - { - case 0: - scdr << m_first; - - break; - - - case 1: - scdr << m_second; - - break; - - default: - break; - } -} - -void SimpleBadDiscUnion::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m__d; - - - switch(m__d) - { - case 0: - dcdr >> m_first; - - - break; - - - case 1: - dcdr >> m_second; - - - break; - - default: - break; - } -} - - - - - -SimpleUnionStruct::SimpleUnionStruct() -{ - // SimpleUnion m_my_union - - - // Just to register all known types - registerTypesTypes(); -} - -SimpleUnionStruct::~SimpleUnionStruct() -{ -} - -SimpleUnionStruct::SimpleUnionStruct( - const SimpleUnionStruct& x) -{ - m_my_union = x.m_my_union; - -} - -SimpleUnionStruct::SimpleUnionStruct( - SimpleUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - -} - -SimpleUnionStruct& SimpleUnionStruct::operator =( - const SimpleUnionStruct& x) -{ - m_my_union = x.m_my_union; - - return *this; -} - -SimpleUnionStruct& SimpleUnionStruct::operator =( - SimpleUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - - return *this; -} - -bool SimpleUnionStruct::operator ==( - const SimpleUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleUnionStruct::operator !=( - const SimpleUnionStruct& x) const -{ - return !(*this == x); -} - -size_t SimpleUnionStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SimpleUnionStruct_max_cdr_typesize; -} - -size_t SimpleUnionStruct::getCdrSerializedSize( - const SimpleUnionStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += SimpleUnion::getCdrSerializedSize(data.my_union(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void SimpleUnionStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_union; - -} - -void SimpleUnionStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_union; - - -} - - -bool SimpleUnionStruct::isKeyDefined() -{ - return false; -} - -void SimpleUnionStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleUnionStruct::my_union( - const SimpleUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleUnionStruct::my_union( - SimpleUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleUnion& SimpleUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleUnion& SimpleUnionStruct::my_union() -{ - return m_my_union; -} - - - - - -SimpleUnionStructEqual::SimpleUnionStructEqual() -{ - // SimpleUnion m_my_union_equal - - - // Just to register all known types - registerTypesTypes(); -} - -SimpleUnionStructEqual::~SimpleUnionStructEqual() -{ -} - -SimpleUnionStructEqual::SimpleUnionStructEqual( - const SimpleUnionStructEqual& x) -{ - m_my_union_equal = x.m_my_union_equal; - -} - -SimpleUnionStructEqual::SimpleUnionStructEqual( - SimpleUnionStructEqual&& x) noexcept -{ - m_my_union_equal = std::move(x.m_my_union_equal); - -} - -SimpleUnionStructEqual& SimpleUnionStructEqual::operator =( - const SimpleUnionStructEqual& x) -{ - m_my_union_equal = x.m_my_union_equal; - - return *this; -} - -SimpleUnionStructEqual& SimpleUnionStructEqual::operator =( - SimpleUnionStructEqual&& x) noexcept -{ - m_my_union_equal = std::move(x.m_my_union_equal); - - return *this; -} - -bool SimpleUnionStructEqual::operator ==( - const SimpleUnionStructEqual& x) const -{ - return (m_my_union_equal == x.m_my_union_equal); -} - -bool SimpleUnionStructEqual::operator !=( - const SimpleUnionStructEqual& x) const -{ - return !(*this == x); -} - -size_t SimpleUnionStructEqual::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SimpleUnionStructEqual_max_cdr_typesize; -} - -size_t SimpleUnionStructEqual::getCdrSerializedSize( - const SimpleUnionStructEqual& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += SimpleUnion::getCdrSerializedSize(data.my_union_equal(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void SimpleUnionStructEqual::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_union_equal; - -} - -void SimpleUnionStructEqual::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_union_equal; - - -} - - -bool SimpleUnionStructEqual::isKeyDefined() -{ - return false; -} - -void SimpleUnionStructEqual::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_union_equal - * @param _my_union_equal New value to be copied in member my_union_equal - */ -void SimpleUnionStructEqual::my_union_equal( - const SimpleUnion& _my_union_equal) -{ - m_my_union_equal = _my_union_equal; -} - -/*! - * @brief This function moves the value in member my_union_equal - * @param _my_union_equal New value to be moved in member my_union_equal - */ -void SimpleUnionStructEqual::my_union_equal( - SimpleUnion&& _my_union_equal) -{ - m_my_union_equal = std::move(_my_union_equal); -} - -/*! - * @brief This function returns a constant reference to member my_union_equal - * @return Constant reference to member my_union_equal - */ -const SimpleUnion& SimpleUnionStructEqual::my_union_equal() const -{ - return m_my_union_equal; -} - -/*! - * @brief This function returns a reference to member my_union_equal - * @return Reference to member my_union_equal - */ -SimpleUnion& SimpleUnionStructEqual::my_union_equal() -{ - return m_my_union_equal; -} - - - - - -SimpleUnionNamesStruct::SimpleUnionNamesStruct() -{ - // SimpleUnionNames m_my_union - - - // Just to register all known types - registerTypesTypes(); -} - -SimpleUnionNamesStruct::~SimpleUnionNamesStruct() -{ -} - -SimpleUnionNamesStruct::SimpleUnionNamesStruct( - const SimpleUnionNamesStruct& x) -{ - m_my_union = x.m_my_union; - -} - -SimpleUnionNamesStruct::SimpleUnionNamesStruct( - SimpleUnionNamesStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - -} - -SimpleUnionNamesStruct& SimpleUnionNamesStruct::operator =( - const SimpleUnionNamesStruct& x) -{ - m_my_union = x.m_my_union; - - return *this; -} - -SimpleUnionNamesStruct& SimpleUnionNamesStruct::operator =( - SimpleUnionNamesStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - - return *this; -} - -bool SimpleUnionNamesStruct::operator ==( - const SimpleUnionNamesStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleUnionNamesStruct::operator !=( - const SimpleUnionNamesStruct& x) const -{ - return !(*this == x); -} - -size_t SimpleUnionNamesStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SimpleUnionNamesStruct_max_cdr_typesize; -} - -size_t SimpleUnionNamesStruct::getCdrSerializedSize( - const SimpleUnionNamesStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += SimpleUnionNames::getCdrSerializedSize(data.my_union(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void SimpleUnionNamesStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_union; - -} - -void SimpleUnionNamesStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_union; - - -} - - -bool SimpleUnionNamesStruct::isKeyDefined() -{ - return false; -} - -void SimpleUnionNamesStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleUnionNamesStruct::my_union( - const SimpleUnionNames& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleUnionNamesStruct::my_union( - SimpleUnionNames&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleUnionNames& SimpleUnionNamesStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleUnionNames& SimpleUnionNamesStruct::my_union() -{ - return m_my_union; -} - - - - - -SimpleTypeUnionStruct::SimpleTypeUnionStruct() -{ - // SimpleTypeUnion m_my_union - - - // Just to register all known types - registerTypesTypes(); -} - -SimpleTypeUnionStruct::~SimpleTypeUnionStruct() -{ -} - -SimpleTypeUnionStruct::SimpleTypeUnionStruct( - const SimpleTypeUnionStruct& x) -{ - m_my_union = x.m_my_union; - -} - -SimpleTypeUnionStruct::SimpleTypeUnionStruct( - SimpleTypeUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - -} - -SimpleTypeUnionStruct& SimpleTypeUnionStruct::operator =( - const SimpleTypeUnionStruct& x) -{ - m_my_union = x.m_my_union; - - return *this; -} - -SimpleTypeUnionStruct& SimpleTypeUnionStruct::operator =( - SimpleTypeUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - - return *this; -} - -bool SimpleTypeUnionStruct::operator ==( - const SimpleTypeUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleTypeUnionStruct::operator !=( - const SimpleTypeUnionStruct& x) const -{ - return !(*this == x); -} - -size_t SimpleTypeUnionStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SimpleTypeUnionStruct_max_cdr_typesize; -} - -size_t SimpleTypeUnionStruct::getCdrSerializedSize( - const SimpleTypeUnionStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += SimpleTypeUnion::getCdrSerializedSize(data.my_union(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void SimpleTypeUnionStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_union; - -} - -void SimpleTypeUnionStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_union; - - -} - - -bool SimpleTypeUnionStruct::isKeyDefined() -{ - return false; -} - -void SimpleTypeUnionStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleTypeUnionStruct::my_union( - const SimpleTypeUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleTypeUnionStruct::my_union( - SimpleTypeUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleTypeUnion& SimpleTypeUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleTypeUnion& SimpleTypeUnionStruct::my_union() -{ - return m_my_union; -} - - - - - -SimpleBadUnionStruct::SimpleBadUnionStruct() -{ - // SimpleBadUnion m_my_union - - - // Just to register all known types - registerTypesTypes(); -} - -SimpleBadUnionStruct::~SimpleBadUnionStruct() -{ -} - -SimpleBadUnionStruct::SimpleBadUnionStruct( - const SimpleBadUnionStruct& x) -{ - m_my_union = x.m_my_union; - -} - -SimpleBadUnionStruct::SimpleBadUnionStruct( - SimpleBadUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - -} - -SimpleBadUnionStruct& SimpleBadUnionStruct::operator =( - const SimpleBadUnionStruct& x) -{ - m_my_union = x.m_my_union; - - return *this; -} - -SimpleBadUnionStruct& SimpleBadUnionStruct::operator =( - SimpleBadUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - - return *this; -} - -bool SimpleBadUnionStruct::operator ==( - const SimpleBadUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleBadUnionStruct::operator !=( - const SimpleBadUnionStruct& x) const -{ - return !(*this == x); -} - -size_t SimpleBadUnionStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SimpleBadUnionStruct_max_cdr_typesize; -} - -size_t SimpleBadUnionStruct::getCdrSerializedSize( - const SimpleBadUnionStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += SimpleBadUnion::getCdrSerializedSize(data.my_union(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void SimpleBadUnionStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_union; - -} - -void SimpleBadUnionStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_union; - - -} - - -bool SimpleBadUnionStruct::isKeyDefined() -{ - return false; -} - -void SimpleBadUnionStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleBadUnionStruct::my_union( - const SimpleBadUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleBadUnionStruct::my_union( - SimpleBadUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleBadUnion& SimpleBadUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleBadUnion& SimpleBadUnionStruct::my_union() -{ - return m_my_union; -} - - - - - -SimplBadDiscUnionStruct::SimplBadDiscUnionStruct() -{ - // SimpleBadDiscUnion m_my_union - - - // Just to register all known types - registerTypesTypes(); -} - -SimplBadDiscUnionStruct::~SimplBadDiscUnionStruct() -{ -} - -SimplBadDiscUnionStruct::SimplBadDiscUnionStruct( - const SimplBadDiscUnionStruct& x) -{ - m_my_union = x.m_my_union; - -} - -SimplBadDiscUnionStruct::SimplBadDiscUnionStruct( - SimplBadDiscUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - -} - -SimplBadDiscUnionStruct& SimplBadDiscUnionStruct::operator =( - const SimplBadDiscUnionStruct& x) -{ - m_my_union = x.m_my_union; - - return *this; -} - -SimplBadDiscUnionStruct& SimplBadDiscUnionStruct::operator =( - SimplBadDiscUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - - return *this; -} - -bool SimplBadDiscUnionStruct::operator ==( - const SimplBadDiscUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimplBadDiscUnionStruct::operator !=( - const SimplBadDiscUnionStruct& x) const -{ - return !(*this == x); -} - -size_t SimplBadDiscUnionStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SimplBadDiscUnionStruct_max_cdr_typesize; -} - -size_t SimplBadDiscUnionStruct::getCdrSerializedSize( - const SimplBadDiscUnionStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += SimpleBadDiscUnion::getCdrSerializedSize(data.my_union(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void SimplBadDiscUnionStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_union; - -} - -void SimplBadDiscUnionStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_union; - - -} - - -bool SimplBadDiscUnionStruct::isKeyDefined() -{ - return false; -} - -void SimplBadDiscUnionStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimplBadDiscUnionStruct::my_union( - const SimpleBadDiscUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimplBadDiscUnionStruct::my_union( - SimpleBadDiscUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleBadDiscUnion& SimplBadDiscUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleBadDiscUnion& SimplBadDiscUnionStruct::my_union() -{ - return m_my_union; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/unittest/xtypes/idl/Typesv1.h b/test/unittest/xtypes/idl/Typesv1.h deleted file mode 100644 index 9b6aae6ee62..00000000000 --- a/test/unittest/xtypes/idl/Typesv1.h +++ /dev/null @@ -1,6496 +0,0 @@ -// 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 Types.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_TYPES_H_ -#define _FAST_DDS_GENERATED_TYPES_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TYPES_SOURCE) -#define TYPES_DllAPI __declspec( dllexport ) -#else -#define TYPES_DllAPI __declspec( dllimport ) -#endif // TYPES_SOURCE -#else -#define TYPES_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TYPES_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -/*! - * @brief This class represents the enumeration MyEnum defined by the user in the IDL file. - * @ingroup Types - */ -enum MyEnum : uint32_t -{ - A, - B, - C -}; -/*! - * @brief This class represents the enumeration MyBadEnum defined by the user in the IDL file. - * @ingroup Types - */ -enum MyBadEnum : uint32_t -{ - A1, - B1, - C1 -}; - - -/*! - * @brief This class represents the structure MyEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyEnumStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyEnumStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyEnumStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct( - const MyEnumStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct( - MyEnumStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct& operator =( - const MyEnumStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct& operator =( - MyEnumStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyEnumStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MyEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyEnumStruct& x) const; - - /*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ - eProsima_user_DllExport void my_enum( - MyEnum _my_enum); - - /*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ - eProsima_user_DllExport MyEnum my_enum() const; - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyEnum& my_enum(); - - - /*! - * @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 MyEnumStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - MyEnum m_my_enum; - -}; - - - -/*! - * @brief This class represents the structure MyBadEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyBadEnumStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyBadEnumStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyBadEnumStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct( - const MyBadEnumStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct( - MyBadEnumStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct& operator =( - const MyBadEnumStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct& operator =( - MyBadEnumStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyBadEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyBadEnumStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MyBadEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyBadEnumStruct& x) const; - - /*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ - eProsima_user_DllExport void my_enum( - MyBadEnum _my_enum); - - /*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ - eProsima_user_DllExport MyBadEnum my_enum() const; - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyBadEnum& my_enum(); - - - /*! - * @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 MyBadEnumStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - MyBadEnum m_my_enum; - -}; - -typedef MyEnum MyAliasEnum; - - - -/*! - * @brief This class represents the structure MyAliasEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyAliasEnumStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyAliasEnumStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyAliasEnumStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct( - const MyAliasEnumStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct( - MyAliasEnumStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct& operator =( - const MyAliasEnumStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct& operator =( - MyAliasEnumStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyAliasEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyAliasEnumStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MyAliasEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyAliasEnumStruct& x) const; - - /*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ - eProsima_user_DllExport void my_enum( - MyAliasEnum _my_enum); - - /*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ - eProsima_user_DllExport MyAliasEnum my_enum() const; - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyAliasEnum& my_enum(); - - - /*! - * @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 MyAliasEnumStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - MyAliasEnum m_my_enum; - -}; - - - -/*! - * @brief This class represents the structure BasicStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct( - const BasicStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct( - BasicStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct& operator =( - const BasicStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct& operator =( - BasicStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - bool _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport bool my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - - - /*! - * @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 BasicStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - bool m_my_bool; - int32_t m_my_int32; - std::string m_my_string; - -}; - - - -/*! - * @brief This class represents the structure BasicNamesStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicNamesStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicNamesStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicNamesStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct( - const BasicNamesStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct( - BasicNamesStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct& operator =( - const BasicNamesStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct& operator =( - BasicNamesStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicNamesStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicNamesStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool_name - * @param _my_bool_name New value for member my_bool_name - */ - eProsima_user_DllExport void my_bool_name( - bool _my_bool_name); - - /*! - * @brief This function returns the value of member my_bool_name - * @return Value of member my_bool_name - */ - eProsima_user_DllExport bool my_bool_name() const; - - /*! - * @brief This function returns a reference to member my_bool_name - * @return Reference to member my_bool_name - */ - eProsima_user_DllExport bool& my_bool_name(); - - - /*! - * @brief This function sets a value in member my_int32_name - * @param _my_int32_name New value for member my_int32_name - */ - eProsima_user_DllExport void my_int32_name( - int32_t _my_int32_name); - - /*! - * @brief This function returns the value of member my_int32_name - * @return Value of member my_int32_name - */ - eProsima_user_DllExport int32_t my_int32_name() const; - - /*! - * @brief This function returns a reference to member my_int32_name - * @return Reference to member my_int32_name - */ - eProsima_user_DllExport int32_t& my_int32_name(); - - - /*! - * @brief This function copies the value in member my_string_name - * @param _my_string_name New value to be copied in member my_string_name - */ - eProsima_user_DllExport void my_string_name( - const std::string& _my_string_name); - - /*! - * @brief This function moves the value in member my_string_name - * @param _my_string_name New value to be moved in member my_string_name - */ - eProsima_user_DllExport void my_string_name( - std::string&& _my_string_name); - - /*! - * @brief This function returns a constant reference to member my_string_name - * @return Constant reference to member my_string_name - */ - eProsima_user_DllExport const std::string& my_string_name() const; - - /*! - * @brief This function returns a reference to member my_string_name - * @return Reference to member my_string_name - */ - eProsima_user_DllExport std::string& my_string_name(); - - - /*! - * @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 BasicNamesStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - bool m_my_bool_name; - int32_t m_my_int32_name; - std::string m_my_string_name; - -}; - - - -/*! - * @brief This class represents the structure BasicBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicBadStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicBadStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicBadStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct( - const BasicBadStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct( - BasicBadStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct& operator =( - const BasicBadStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct& operator =( - BasicBadStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicBadStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicBadStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicBadStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicBadStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - uint8_t _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport uint8_t my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport uint8_t& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - - - /*! - * @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 BasicBadStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint8_t m_my_bool; - int32_t m_my_int32; - std::string m_my_string; - -}; - - - -/*! - * @brief This class represents the structure BasicWideStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicWideStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicWideStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicWideStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct( - const BasicWideStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct( - BasicWideStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct& operator =( - const BasicWideStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct& operator =( - BasicWideStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicWideStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicWideStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - bool _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport bool my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - - - /*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ - eProsima_user_DllExport void new_int32( - int32_t _new_int32); - - /*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ - eProsima_user_DllExport int32_t new_int32() const; - - /*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ - eProsima_user_DllExport int32_t& new_int32(); - - - /*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ - eProsima_user_DllExport void new_string( - const std::string& _new_string); - - /*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ - eProsima_user_DllExport void new_string( - std::string&& _new_string); - - /*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ - eProsima_user_DllExport const std::string& new_string() const; - - /*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ - eProsima_user_DllExport std::string& new_string(); - - - /*! - * @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 BasicWideStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - bool m_my_bool; - int32_t m_my_int32; - std::string m_my_string; - int32_t m_new_int32; - std::string m_new_string; - -}; - - - -/*! - * @brief This class represents the structure BadBasicWideStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BadBasicWideStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BadBasicWideStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BadBasicWideStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct( - const BadBasicWideStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct( - BadBasicWideStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct& operator =( - const BadBasicWideStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct& operator =( - BadBasicWideStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BadBasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BadBasicWideStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BadBasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BadBasicWideStruct& x) const; - - /*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ - eProsima_user_DllExport void new_int32( - int32_t _new_int32); - - /*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ - eProsima_user_DllExport int32_t new_int32() const; - - /*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ - eProsima_user_DllExport int32_t& new_int32(); - - - /*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ - eProsima_user_DllExport void new_string( - const std::string& _new_string); - - /*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ - eProsima_user_DllExport void new_string( - std::string&& _new_string); - - /*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ - eProsima_user_DllExport const std::string& new_string() const; - - /*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ - eProsima_user_DllExport std::string& new_string(); - - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - bool _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport bool my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - - - /*! - * @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 BadBasicWideStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - int32_t m_new_int32; - std::string m_new_string; - bool m_my_bool; - int32_t m_my_int32; - std::string m_my_string; - -}; - - - -/*! - * @brief This class represents the structure StringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class StringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport StringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~StringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct( - const StringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct( - StringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct& operator =( - const StringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct& operator =( - StringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x StringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const StringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x StringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const StringStruct& x) const; - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - - - /*! - * @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 StringStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::string m_my_string; - -}; - - - -/*! - * @brief This class represents the structure LargeStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class LargeStringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LargeStringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LargeStringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct( - const LargeStringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct( - LargeStringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct& operator =( - const LargeStringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct& operator =( - LargeStringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LargeStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LargeStringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x LargeStringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LargeStringStruct& x) const; - - /*! - * @brief This function copies the value in member my_large_string - * @param _my_large_string New value to be copied in member my_large_string - */ - eProsima_user_DllExport void my_large_string( - const eprosima::fastcdr::fixed_string<41925>& _my_large_string); - - /*! - * @brief This function moves the value in member my_large_string - * @param _my_large_string New value to be moved in member my_large_string - */ - eProsima_user_DllExport void my_large_string( - eprosima::fastcdr::fixed_string<41925>&& _my_large_string); - - /*! - * @brief This function returns a constant reference to member my_large_string - * @return Constant reference to member my_large_string - */ - eProsima_user_DllExport const eprosima::fastcdr::fixed_string<41925>& my_large_string() const; - - /*! - * @brief This function returns a reference to member my_large_string - * @return Reference to member my_large_string - */ - eProsima_user_DllExport eprosima::fastcdr::fixed_string<41925>& my_large_string(); - - - /*! - * @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 LargeStringStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - eprosima::fastcdr::fixed_string<41925> m_my_large_string; - -}; - - - -/*! - * @brief This class represents the structure WStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class WStringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport WStringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~WStringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct( - const WStringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct( - WStringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct& operator =( - const WStringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct& operator =( - WStringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x WStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const WStringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x WStringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const WStringStruct& x) const; - - /*! - * @brief This function copies the value in member my_wstring - * @param _my_wstring New value to be copied in member my_wstring - */ - eProsima_user_DllExport void my_wstring( - const std::wstring& _my_wstring); - - /*! - * @brief This function moves the value in member my_wstring - * @param _my_wstring New value to be moved in member my_wstring - */ - eProsima_user_DllExport void my_wstring( - std::wstring&& _my_wstring); - - /*! - * @brief This function returns a constant reference to member my_wstring - * @return Constant reference to member my_wstring - */ - eProsima_user_DllExport const std::wstring& my_wstring() const; - - /*! - * @brief This function returns a reference to member my_wstring - * @return Reference to member my_wstring - */ - eProsima_user_DllExport std::wstring& my_wstring(); - - - /*! - * @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 WStringStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::wstring m_my_wstring; - -}; - - - -/*! - * @brief This class represents the structure LargeWStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class LargeWStringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LargeWStringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LargeWStringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct( - const LargeWStringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct( - LargeWStringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct& operator =( - const LargeWStringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct& operator =( - LargeWStringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LargeWStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LargeWStringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x LargeWStringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LargeWStringStruct& x) const; - - /*! - * @brief This function copies the value in member my_large_wstring - * @param _my_large_wstring New value to be copied in member my_large_wstring - */ - eProsima_user_DllExport void my_large_wstring( - const std::wstring& _my_large_wstring); - - /*! - * @brief This function moves the value in member my_large_wstring - * @param _my_large_wstring New value to be moved in member my_large_wstring - */ - eProsima_user_DllExport void my_large_wstring( - std::wstring&& _my_large_wstring); - - /*! - * @brief This function returns a constant reference to member my_large_wstring - * @return Constant reference to member my_large_wstring - */ - eProsima_user_DllExport const std::wstring& my_large_wstring() const; - - /*! - * @brief This function returns a reference to member my_large_wstring - * @return Reference to member my_large_wstring - */ - eProsima_user_DllExport std::wstring& my_large_wstring(); - - - /*! - * @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 LargeWStringStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::wstring m_my_large_wstring; - -}; - - - -/*! - * @brief This class represents the structure ArrayStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct( - const ArrayStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct( - ArrayStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct& operator =( - const ArrayStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct& operator =( - ArrayStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array& my_array(); - - - /*! - * @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 ArrayStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::array m_my_array; - -}; - - - -/*! - * @brief This class represents the structure ArrayStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual( - const ArrayStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual( - ArrayStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual& operator =( - const ArrayStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual& operator =( - ArrayStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_array_equal - * @param _my_array_equal New value to be copied in member my_array_equal - */ - eProsima_user_DllExport void my_array_equal( - const std::array& _my_array_equal); - - /*! - * @brief This function moves the value in member my_array_equal - * @param _my_array_equal New value to be moved in member my_array_equal - */ - eProsima_user_DllExport void my_array_equal( - std::array&& _my_array_equal); - - /*! - * @brief This function returns a constant reference to member my_array_equal - * @return Constant reference to member my_array_equal - */ - eProsima_user_DllExport const std::array& my_array_equal() const; - - /*! - * @brief This function returns a reference to member my_array_equal - * @return Reference to member my_array_equal - */ - eProsima_user_DllExport std::array& my_array_equal(); - - - /*! - * @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 ArrayStructEqual& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::array m_my_array_equal; - -}; - - - -/*! - * @brief This class represents the structure ArrayBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayBadStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayBadStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayBadStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct( - const ArrayBadStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct( - ArrayBadStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct& operator =( - const ArrayBadStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct& operator =( - ArrayBadStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayBadStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayBadStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayBadStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayBadStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array& my_array(); - - - /*! - * @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 ArrayBadStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::array m_my_array; - -}; - - - -/*! - * @brief This class represents the structure ArrayDimensionsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayDimensionsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayDimensionsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayDimensionsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct( - const ArrayDimensionsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct( - ArrayDimensionsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct& operator =( - const ArrayDimensionsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct& operator =( - ArrayDimensionsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayDimensionsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayDimensionsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayDimensionsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayDimensionsStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array, 2>& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array, 2>&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array, 2>& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array, 2>& my_array(); - - - /*! - * @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 ArrayDimensionsStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::array, 2> m_my_array; - -}; - - - -/*! - * @brief This class represents the structure ArraySizeStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArraySizeStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArraySizeStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArraySizeStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct( - const ArraySizeStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct( - ArraySizeStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct& operator =( - const ArraySizeStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct& operator =( - ArraySizeStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArraySizeStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArraySizeStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArraySizeStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArraySizeStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array& my_array(); - - - /*! - * @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 ArraySizeStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::array m_my_array; - -}; - - - - - -/*! - * @brief This class represents the structure SequenceStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct( - const SequenceStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct( - SequenceStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct& operator =( - const SequenceStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct& operator =( - SequenceStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - const std::vector& _my_sequence); - - /*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - std::vector&& _my_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ - eProsima_user_DllExport const std::vector& my_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ - eProsima_user_DllExport std::vector& my_sequence(); - - - /*! - * @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 SequenceStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::vector m_my_sequence; - -}; - - - - - -/*! - * @brief This class represents the structure SequenceStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual( - const SequenceStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual( - SequenceStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual& operator =( - const SequenceStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual& operator =( - SequenceStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_sequence_equal - * @param _my_sequence_equal New value to be copied in member my_sequence_equal - */ - eProsima_user_DllExport void my_sequence_equal( - const std::vector& _my_sequence_equal); - - /*! - * @brief This function moves the value in member my_sequence_equal - * @param _my_sequence_equal New value to be moved in member my_sequence_equal - */ - eProsima_user_DllExport void my_sequence_equal( - std::vector&& _my_sequence_equal); - - /*! - * @brief This function returns a constant reference to member my_sequence_equal - * @return Constant reference to member my_sequence_equal - */ - eProsima_user_DllExport const std::vector& my_sequence_equal() const; - - /*! - * @brief This function returns a reference to member my_sequence_equal - * @return Reference to member my_sequence_equal - */ - eProsima_user_DllExport std::vector& my_sequence_equal(); - - - /*! - * @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 SequenceStructEqual& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::vector m_my_sequence_equal; - -}; - - - - - -/*! - * @brief This class represents the structure SequenceBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceBadStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceBadStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceBadStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct( - const SequenceBadStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct( - SequenceBadStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct& operator =( - const SequenceBadStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct& operator =( - SequenceBadStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceBadStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceBadStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceBadStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceBadStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - const std::vector& _my_sequence); - - /*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - std::vector&& _my_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ - eProsima_user_DllExport const std::vector& my_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ - eProsima_user_DllExport std::vector& my_sequence(); - - - /*! - * @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 SequenceBadStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::vector m_my_sequence; - -}; - - - - - -/*! - * @brief This class represents the structure SequenceBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct( - const SequenceBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct( - SequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct& operator =( - const SequenceBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct& operator =( - SequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - const std::vector& _my_sequence); - - /*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - std::vector&& _my_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ - eProsima_user_DllExport const std::vector& my_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ - eProsima_user_DllExport std::vector& my_sequence(); - - - /*! - * @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 SequenceBoundsStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::vector m_my_sequence; - -}; - - - - - - - -/*! - * @brief This class represents the structure SequenceSequenceStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceSequenceStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceSequenceStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceSequenceStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct( - const SequenceSequenceStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct( - SequenceSequenceStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct& operator =( - const SequenceSequenceStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct& operator =( - SequenceSequenceStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceSequenceStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceSequenceStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - const std::vector>& _my_sequence_sequence); - - /*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - std::vector>&& _my_sequence_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ - eProsima_user_DllExport const std::vector>& my_sequence_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ - eProsima_user_DllExport std::vector>& my_sequence_sequence(); - - - /*! - * @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 SequenceSequenceStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::vector> m_my_sequence_sequence; - -}; - - - - - - - -/*! - * @brief This class represents the structure SequenceSequenceBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceSequenceBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceSequenceBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct( - const SequenceSequenceBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct( - SequenceSequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct& operator =( - const SequenceSequenceBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct& operator =( - SequenceSequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceSequenceBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceSequenceBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - const std::vector>& _my_sequence_sequence); - - /*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - std::vector>&& _my_sequence_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ - eProsima_user_DllExport const std::vector>& my_sequence_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ - eProsima_user_DllExport std::vector>& my_sequence_sequence(); - - - /*! - * @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 SequenceSequenceBoundsStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::vector> m_my_sequence_sequence; - -}; - - - - - -/*! - * @brief This class represents the structure MapStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct( - const MapStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct( - MapStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct& operator =( - const MapStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct& operator =( - MapStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - - - /*! - * @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 MapStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::map m_my_map; - -}; - - - - - -/*! - * @brief This class represents the structure MapStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class MapStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual( - const MapStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual( - MapStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual& operator =( - const MapStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual& operator =( - MapStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x MapStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_map_equal - * @param _my_map_equal New value to be copied in member my_map_equal - */ - eProsima_user_DllExport void my_map_equal( - const std::map& _my_map_equal); - - /*! - * @brief This function moves the value in member my_map_equal - * @param _my_map_equal New value to be moved in member my_map_equal - */ - eProsima_user_DllExport void my_map_equal( - std::map&& _my_map_equal); - - /*! - * @brief This function returns a constant reference to member my_map_equal - * @return Constant reference to member my_map_equal - */ - eProsima_user_DllExport const std::map& my_map_equal() const; - - /*! - * @brief This function returns a reference to member my_map_equal - * @return Reference to member my_map_equal - */ - eProsima_user_DllExport std::map& my_map_equal(); - - - /*! - * @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 MapStructEqual& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::map m_my_map_equal; - -}; - - - - - -/*! - * @brief This class represents the structure MapBadKeyStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBadKeyStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapBadKeyStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapBadKeyStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct( - const MapBadKeyStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct( - MapBadKeyStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct& operator =( - const MapBadKeyStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct& operator =( - MapBadKeyStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapBadKeyStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapBadKeyStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapBadKeyStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapBadKeyStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - - - /*! - * @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 MapBadKeyStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::map m_my_map; - -}; - - - - - -/*! - * @brief This class represents the structure MapBadElemStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBadElemStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapBadElemStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapBadElemStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct( - const MapBadElemStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct( - MapBadElemStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct& operator =( - const MapBadElemStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct& operator =( - MapBadElemStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapBadElemStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapBadElemStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapBadElemStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapBadElemStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - - - /*! - * @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 MapBadElemStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::map m_my_map; - -}; - - - - - -/*! - * @brief This class represents the structure MapBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct( - const MapBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct( - MapBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct& operator =( - const MapBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct& operator =( - MapBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - - - /*! - * @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 MapBoundsStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::map m_my_map; - -}; - - - - - - - -/*! - * @brief This class represents the structure MapMapStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapMapStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapMapStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapMapStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct( - const MapMapStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct( - MapMapStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct& operator =( - const MapMapStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct& operator =( - MapMapStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapMapStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapMapStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapMapStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapMapStruct& x) const; - - /*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - const std::map>& _my_map_map); - - /*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - std::map>&& _my_map_map); - - /*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ - eProsima_user_DllExport const std::map>& my_map_map() const; - - /*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ - eProsima_user_DllExport std::map>& my_map_map(); - - - /*! - * @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 MapMapStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::map> m_my_map_map; - -}; - - - - - - - -/*! - * @brief This class represents the structure MapMapBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapMapBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapMapBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapMapBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct( - const MapMapBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct( - MapMapBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct& operator =( - const MapMapBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct& operator =( - MapMapBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapMapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapMapBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapMapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapMapBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - const std::map>& _my_map_map); - - /*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - std::map>&& _my_map_map); - - /*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ - eProsima_user_DllExport const std::map>& my_map_map() const; - - /*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ - eProsima_user_DllExport std::map>& my_map_map(); - - - /*! - * @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 MapMapBoundsStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::map> m_my_map_map; - -}; - - - -/*! - * @brief This class represents the union SimpleUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion( - const SimpleUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion( - SimpleUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion& operator =( - const SimpleUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion& operator =( - SimpleUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - - - /*! - * @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 SimpleUnion& 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: - - int32_t m__d; - - int32_t m_first; - int64_t m_second; -}; - - - -/*! - * @brief This class represents the union SimpleUnionNames defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionNames -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionNames(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionNames(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames( - const SimpleUnionNames& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames( - SimpleUnionNames&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames& operator =( - const SimpleUnionNames& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames& operator =( - SimpleUnionNames&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNames object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionNames& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNames object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionNames& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first_case - * @param _first_case New value for member first_case - */ - eProsima_user_DllExport void first_case( - int32_t _first_case); - - /*! - * @brief This function returns the value of member first_case - * @return Value of member first_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first_case() const; - - /*! - * @brief This function returns a reference to member first_case - * @return Reference to member first_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first_case(); - - - /*! - * @brief This function sets a value in member second_case - * @param _second_case New value for member second_case - */ - eProsima_user_DllExport void second_case( - int64_t _second_case); - - /*! - * @brief This function returns the value of member second_case - * @return Value of member second_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second_case() const; - - /*! - * @brief This function returns a reference to member second_case - * @return Reference to member second_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second_case(); - - - /*! - * @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 SimpleUnionNames& 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: - - int32_t m__d; - - int32_t m_first_case; - int64_t m_second_case; -}; - - - -/*! - * @brief This class represents the union SimpleTypeUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleTypeUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleTypeUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleTypeUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion( - const SimpleTypeUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion( - SimpleTypeUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion& operator =( - const SimpleTypeUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion& operator =( - SimpleTypeUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleTypeUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleTypeUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - uint8_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - - - /*! - * @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 SimpleTypeUnion& 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: - - int32_t m__d; - - uint8_t m_first; - int64_t m_second; -}; - - - -/*! - * @brief This class represents the union SimpleBadUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleBadUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleBadUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleBadUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion( - const SimpleBadUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion( - SimpleBadUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion& operator =( - const SimpleBadUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion& operator =( - SimpleBadUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleBadUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleBadUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - - - /*! - * @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 SimpleBadUnion& 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: - - int32_t m__d; - - int32_t m_first; - int64_t m_second; -}; - - - -/*! - * @brief This class represents the union SimpleBadDiscUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleBadDiscUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleBadDiscUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleBadDiscUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion( - const SimpleBadDiscUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion( - SimpleBadDiscUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion& operator =( - const SimpleBadDiscUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion& operator =( - SimpleBadDiscUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleBadDiscUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleBadDiscUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleBadDiscUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleBadDiscUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - uint8_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport uint8_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport uint8_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - - - /*! - * @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 SimpleBadDiscUnion& 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: - - uint8_t m__d; - - int32_t m_first; - int64_t m_second; -}; - - - -/*! - * @brief This class represents the structure SimpleUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct( - const SimpleUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct( - SimpleUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct& operator =( - const SimpleUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct& operator =( - SimpleUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleUnion& my_union(); - - - /*! - * @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 SimpleUnionStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - SimpleUnion m_my_union; - -}; - - - -/*! - * @brief This class represents the structure SimpleUnionStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual( - const SimpleUnionStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual( - SimpleUnionStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual& operator =( - const SimpleUnionStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual& operator =( - SimpleUnionStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_union_equal - * @param _my_union_equal New value to be copied in member my_union_equal - */ - eProsima_user_DllExport void my_union_equal( - const SimpleUnion& _my_union_equal); - - /*! - * @brief This function moves the value in member my_union_equal - * @param _my_union_equal New value to be moved in member my_union_equal - */ - eProsima_user_DllExport void my_union_equal( - SimpleUnion&& _my_union_equal); - - /*! - * @brief This function returns a constant reference to member my_union_equal - * @return Constant reference to member my_union_equal - */ - eProsima_user_DllExport const SimpleUnion& my_union_equal() const; - - /*! - * @brief This function returns a reference to member my_union_equal - * @return Reference to member my_union_equal - */ - eProsima_user_DllExport SimpleUnion& my_union_equal(); - - - /*! - * @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 SimpleUnionStructEqual& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - SimpleUnion m_my_union_equal; - -}; - - - -/*! - * @brief This class represents the structure SimpleUnionNamesStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionNamesStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionNamesStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionNamesStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct( - const SimpleUnionNamesStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct( - SimpleUnionNamesStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct& operator =( - const SimpleUnionNamesStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct& operator =( - SimpleUnionNamesStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionNamesStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionNamesStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleUnionNames& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleUnionNames&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleUnionNames& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleUnionNames& my_union(); - - - /*! - * @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 SimpleUnionNamesStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - SimpleUnionNames m_my_union; - -}; - - - -/*! - * @brief This class represents the structure SimpleTypeUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleTypeUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleTypeUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleTypeUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct( - const SimpleTypeUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct( - SimpleTypeUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct& operator =( - const SimpleTypeUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct& operator =( - SimpleTypeUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleTypeUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleTypeUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleTypeUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleTypeUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleTypeUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleTypeUnion& my_union(); - - - /*! - * @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 SimpleTypeUnionStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - SimpleTypeUnion m_my_union; - -}; - - - -/*! - * @brief This class represents the structure SimpleBadUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleBadUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleBadUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleBadUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct( - const SimpleBadUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct( - SimpleBadUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct& operator =( - const SimpleBadUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct& operator =( - SimpleBadUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleBadUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleBadUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleBadUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleBadUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleBadUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleBadUnion& my_union(); - - - /*! - * @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 SimpleBadUnionStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - SimpleBadUnion m_my_union; - -}; - - - -/*! - * @brief This class represents the structure SimplBadDiscUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimplBadDiscUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimplBadDiscUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct( - const SimplBadDiscUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct( - SimplBadDiscUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct& operator =( - const SimplBadDiscUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct& operator =( - SimplBadDiscUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimplBadDiscUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimplBadDiscUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimplBadDiscUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimplBadDiscUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleBadDiscUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleBadDiscUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleBadDiscUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleBadDiscUnion& my_union(); - - - /*! - * @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 SimplBadDiscUnionStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - SimpleBadDiscUnion m_my_union; - -}; - - -#endif // _FAST_DDS_GENERATED_TYPES_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/unittest/xtypes/idl/WideEnum.cxx b/test/unittest/xtypes/idl/WideEnum.cxx deleted file mode 100644 index 504b70b0b4a..00000000000 --- a/test/unittest/xtypes/idl/WideEnum.cxx +++ /dev/null @@ -1,591 +0,0 @@ -// 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 WideEnum.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "WideEnum.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include "WideEnumTypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -MyEnumWideStruct::MyEnumWideStruct() -{ - // Just to register all known types - registerWideEnumTypes(); -} - -MyEnumWideStruct::~MyEnumWideStruct() -{ -} - -MyEnumWideStruct::MyEnumWideStruct( - const MyEnumWideStruct& x) -{ - m_my_enum_wide = x.m_my_enum_wide; -} - -MyEnumWideStruct::MyEnumWideStruct( - MyEnumWideStruct&& x) noexcept -{ - m_my_enum_wide = x.m_my_enum_wide; -} - -MyEnumWideStruct& MyEnumWideStruct::operator =( - const MyEnumWideStruct& x) -{ - - m_my_enum_wide = x.m_my_enum_wide; - return *this; -} - -MyEnumWideStruct& MyEnumWideStruct::operator =( - MyEnumWideStruct&& x) noexcept -{ - - m_my_enum_wide = x.m_my_enum_wide; - return *this; -} - -bool MyEnumWideStruct::operator ==( - const MyEnumWideStruct& x) const -{ - return (m_my_enum_wide == x.m_my_enum_wide); -} - -bool MyEnumWideStruct::operator !=( - const MyEnumWideStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_enum_wide - * @param _my_enum_wide New value for member my_enum_wide - */ -void MyEnumWideStruct::my_enum_wide( - MyEnumWide _my_enum_wide) -{ - m_my_enum_wide = _my_enum_wide; -} - -/*! - * @brief This function returns the value of member my_enum_wide - * @return Value of member my_enum_wide - */ -MyEnumWide MyEnumWideStruct::my_enum_wide() const -{ - return m_my_enum_wide; -} - -/*! - * @brief This function returns a reference to member my_enum_wide - * @return Reference to member my_enum_wide - */ -MyEnumWide& MyEnumWideStruct::my_enum_wide() -{ - return m_my_enum_wide; -} - - - - -SimpleWideUnion::SimpleWideUnion() -{ - m__d = A; -} - -SimpleWideUnion::~SimpleWideUnion() -{ -} - -SimpleWideUnion::SimpleWideUnion( - const SimpleWideUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - - case D: - m_third = x.m_third; - break; - - default: - break; - } -} - -SimpleWideUnion::SimpleWideUnion( - SimpleWideUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - - case D: - m_third = x.m_third; - break; - - default: - break; - } -} - -SimpleWideUnion& SimpleWideUnion::operator =( - const SimpleWideUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - - case D: - m_third = x.m_third; - break; - - default: - break; - } - - return *this; -} - -SimpleWideUnion& SimpleWideUnion::operator =( - SimpleWideUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - - case D: - m_third = x.m_third; - break; - - default: - break; - } - - return *this; -} - -bool SimpleWideUnion::operator ==( - const SimpleWideUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case B: - return (m_second == x.m_second); - break; - - - case D: - return (m_third == x.m_third); - break; - - default: - break; - } - return false; -} - -bool SimpleWideUnion::operator !=( - const SimpleWideUnion& x) const -{ - return !(*this == x); -} - -void SimpleWideUnion::_d( - int32_t __d) -{ - bool b = false; - - switch (m__d) - { - case A: - switch (__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch (__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - - case D: - switch (__d) - { - case D: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleWideUnion::_d() const -{ - return m__d; -} - -int32_t& SimpleWideUnion::_d() -{ - return m__d; -} - -void SimpleWideUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = A; - -} - -int32_t SimpleWideUnion::first() const -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& SimpleWideUnion::first() -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleWideUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = B; - -} - -int64_t SimpleWideUnion::second() const -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleWideUnion::second() -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - -void SimpleWideUnion::third( - uint8_t _third) -{ - m_third = _third; - m__d = D; - -} - -uint8_t SimpleWideUnion::third() const -{ - bool b = false; - - switch (m__d) - { - case D: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_third; -} - -uint8_t& SimpleWideUnion::third() -{ - bool b = false; - - switch (m__d) - { - case D: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_third; -} - - - - -SimpleWideUnionStruct::SimpleWideUnionStruct() -{ - // Just to register all known types - registerWideEnumTypes(); -} - -SimpleWideUnionStruct::~SimpleWideUnionStruct() -{ -} - -SimpleWideUnionStruct::SimpleWideUnionStruct( - const SimpleWideUnionStruct& x) -{ - m_my_union = x.m_my_union; -} - -SimpleWideUnionStruct::SimpleWideUnionStruct( - SimpleWideUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); -} - -SimpleWideUnionStruct& SimpleWideUnionStruct::operator =( - const SimpleWideUnionStruct& x) -{ - - m_my_union = x.m_my_union; - return *this; -} - -SimpleWideUnionStruct& SimpleWideUnionStruct::operator =( - SimpleWideUnionStruct&& x) noexcept -{ - - m_my_union = std::move(x.m_my_union); - return *this; -} - -bool SimpleWideUnionStruct::operator ==( - const SimpleWideUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleWideUnionStruct::operator !=( - const SimpleWideUnionStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleWideUnionStruct::my_union( - const SimpleWideUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleWideUnionStruct::my_union( - SimpleWideUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleWideUnion& SimpleWideUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleWideUnion& SimpleWideUnionStruct::my_union() -{ - return m_my_union; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "WideEnumCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/unittest/xtypes/idl/WideEnum.h b/test/unittest/xtypes/idl/WideEnum.h deleted file mode 100644 index 3a731aeb935..00000000000 --- a/test/unittest/xtypes/idl/WideEnum.h +++ /dev/null @@ -1,426 +0,0 @@ -// 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 WideEnum.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "WideEnumv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_WIDEENUM_H_ -#define _FAST_DDS_GENERATED_WIDEENUM_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(WIDEENUM_SOURCE) -#define WIDEENUM_DllAPI __declspec( dllexport ) -#else -#define WIDEENUM_DllAPI __declspec( dllimport ) -#endif // WIDEENUM_SOURCE -#else -#define WIDEENUM_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define WIDEENUM_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - -/*! - * @brief This class represents the enumeration MyEnumWide defined by the user in the IDL file. - * @ingroup WideEnum - */ -enum MyEnumWide : uint32_t -{ - A, - B, - C, - D -}; - - -/*! - * @brief This class represents the structure MyEnumWideStruct defined by the user in the IDL file. - * @ingroup WideEnum - */ -class MyEnumWideStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyEnumWideStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyEnumWideStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyEnumWideStruct that will be copied. - */ - eProsima_user_DllExport MyEnumWideStruct( - const MyEnumWideStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyEnumWideStruct that will be copied. - */ - eProsima_user_DllExport MyEnumWideStruct( - MyEnumWideStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyEnumWideStruct that will be copied. - */ - eProsima_user_DllExport MyEnumWideStruct& operator =( - const MyEnumWideStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyEnumWideStruct that will be copied. - */ - eProsima_user_DllExport MyEnumWideStruct& operator =( - MyEnumWideStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyEnumWideStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyEnumWideStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MyEnumWideStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyEnumWideStruct& x) const; - - /*! - * @brief This function sets a value in member my_enum_wide - * @param _my_enum_wide New value for member my_enum_wide - */ - eProsima_user_DllExport void my_enum_wide( - MyEnumWide _my_enum_wide); - - /*! - * @brief This function returns the value of member my_enum_wide - * @return Value of member my_enum_wide - */ - eProsima_user_DllExport MyEnumWide my_enum_wide() const; - - /*! - * @brief This function returns a reference to member my_enum_wide - * @return Reference to member my_enum_wide - */ - eProsima_user_DllExport MyEnumWide& my_enum_wide(); - -private: - - MyEnumWide m_my_enum_wide{::A}; - -}; - - -/*! - * @brief This class represents the union SimpleWideUnion defined by the user in the IDL file. - * @ingroup WideEnum - */ -class SimpleWideUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleWideUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleWideUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleWideUnion that will be copied. - */ - eProsima_user_DllExport SimpleWideUnion( - const SimpleWideUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleWideUnion that will be copied. - */ - eProsima_user_DllExport SimpleWideUnion( - SimpleWideUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleWideUnion that will be copied. - */ - eProsima_user_DllExport SimpleWideUnion& operator =( - const SimpleWideUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleWideUnion that will be copied. - */ - eProsima_user_DllExport SimpleWideUnion& operator =( - SimpleWideUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleWideUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleWideUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleWideUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleWideUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - - - /*! - * @brief This function sets a value in member third - * @param _third New value for member third - */ - eProsima_user_DllExport void third( - uint8_t _third); - - /*! - * @brief This function returns the value of member third - * @return Value of member third - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t third() const; - - /*! - * @brief This function returns a reference to member third - * @return Reference to member third - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t& third(); - -private: - - int32_t m__d; - - int32_t m_first{0}; - int64_t m_second{0}; - uint8_t m_third{0}; -}; - - -/*! - * @brief This class represents the structure SimpleWideUnionStruct defined by the user in the IDL file. - * @ingroup WideEnum - */ -class SimpleWideUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleWideUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleWideUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleWideUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleWideUnionStruct( - const SimpleWideUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleWideUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleWideUnionStruct( - SimpleWideUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleWideUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleWideUnionStruct& operator =( - const SimpleWideUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleWideUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleWideUnionStruct& operator =( - SimpleWideUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleWideUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleWideUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleWideUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleWideUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleWideUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleWideUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleWideUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleWideUnion& my_union(); - -private: - - SimpleWideUnion m_my_union; - -}; - -#endif // _FAST_DDS_GENERATED_WIDEENUM_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/unittest/xtypes/idl/WideEnum.idl b/test/unittest/xtypes/idl/WideEnum.idl deleted file mode 100644 index b31b2bb7070..00000000000 --- a/test/unittest/xtypes/idl/WideEnum.idl +++ /dev/null @@ -1,30 +0,0 @@ -// Enum - -enum MyEnumWide -{ - A, - B, - C, - D -}; - -struct MyEnumWideStruct -{ - MyEnumWide my_enum_wide; -}; - - -union SimpleWideUnion switch (long) -{ - case A: - long first; - case B: - long long second; - case D: - octet third; -}; - -struct SimpleWideUnionStruct -{ - SimpleWideUnion my_union; -}; \ No newline at end of file diff --git a/test/unittest/xtypes/idl/WideEnumCdrAux.hpp b/test/unittest/xtypes/idl/WideEnumCdrAux.hpp deleted file mode 100644 index 34c5600fbef..00000000000 --- a/test/unittest/xtypes/idl/WideEnumCdrAux.hpp +++ /dev/null @@ -1,63 +0,0 @@ -// 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 WideEnumCdrAux.hpp - * This source file contains some definitions of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_WIDEENUMCDRAUX_HPP_ -#define _FAST_DDS_GENERATED_WIDEENUMCDRAUX_HPP_ - -#include "WideEnum.h" - -constexpr uint32_t MyEnumWideStruct_max_cdr_typesize {8UL}; -constexpr uint32_t MyEnumWideStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t SimpleWideUnionStruct_max_cdr_typesize {24UL}; -constexpr uint32_t SimpleWideUnionStruct_max_key_cdr_typesize {0UL}; - - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MyEnumWideStruct& data); - - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleWideUnionStruct& data); - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_WIDEENUMCDRAUX_HPP_ - diff --git a/test/unittest/xtypes/idl/WideEnumCdrAux.ipp b/test/unittest/xtypes/idl/WideEnumCdrAux.ipp deleted file mode 100644 index 380b5cf4c6f..00000000000 --- a/test/unittest/xtypes/idl/WideEnumCdrAux.ipp +++ /dev/null @@ -1,320 +0,0 @@ -// 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 WideEnumCdrAux.ipp - * This source file contains some declarations of CDR related functions. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_WIDEENUMCDRAUX_IPP_ -#define _FAST_DDS_GENERATED_WIDEENUMCDRAUX_IPP_ - -#include "WideEnumCdrAux.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 MyEnumWideStruct& 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.my_enum_wide(), 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 MyEnumWideStruct& 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.my_enum_wide() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MyEnumWideStruct& 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.my_enum_wide(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MyEnumWideStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleWideUnion& 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 A: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.first(), current_alignment); - break; - - case B: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.second(), current_alignment); - break; - - case D: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), - data.third(), current_alignment); - break; - - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleWideUnion& 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 A: - scdr << eprosima::fastcdr::MemberId(1) << data.first(); - break; - - case B: - scdr << eprosima::fastcdr::MemberId(2) << data.second(); - break; - - case D: - scdr << eprosima::fastcdr::MemberId(3) << data.third(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleWideUnion& 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 A: - dcdr >> data.first(); - break; - - case B: - dcdr >> data.second(); - break; - - case D: - dcdr >> data.third(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleWideUnionStruct& 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.my_union(), 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 SimpleWideUnionStruct& 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.my_union() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleWideUnionStruct& 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.my_union(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleWideUnionStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_WIDEENUMCDRAUX_IPP_ - diff --git a/test/unittest/xtypes/idl/WideEnumPubSubTypes.cxx b/test/unittest/xtypes/idl/WideEnumPubSubTypes.cxx deleted file mode 100644 index 3e60c0cd922..00000000000 --- a/test/unittest/xtypes/idl/WideEnumPubSubTypes.cxx +++ /dev/null @@ -1,415 +0,0 @@ -// 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 WideEnumPubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#include - -#include "WideEnumPubSubTypes.h" -#include "WideEnumCdrAux.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; - - - -MyEnumWideStructPubSubType::MyEnumWideStructPubSubType() -{ - setName("MyEnumWideStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MyEnumWideStruct::getMaxCdrSerializedSize()); -#else - MyEnumWideStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = MyEnumWideStruct_max_key_cdr_typesize > 16 ? MyEnumWideStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MyEnumWideStructPubSubType::~MyEnumWideStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MyEnumWideStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MyEnumWideStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool MyEnumWideStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MyEnumWideStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function MyEnumWideStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* MyEnumWideStructPubSubType::createData() -{ - return reinterpret_cast(new MyEnumWideStruct()); -} - -void MyEnumWideStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MyEnumWideStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MyEnumWideStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MyEnumWideStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || MyEnumWideStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - - - -SimpleWideUnionStructPubSubType::SimpleWideUnionStructPubSubType() -{ - setName("SimpleWideUnionStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SimpleWideUnionStruct::getMaxCdrSerializedSize()); -#else - SimpleWideUnionStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = SimpleWideUnionStruct_max_key_cdr_typesize > 16 ? SimpleWideUnionStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SimpleWideUnionStructPubSubType::~SimpleWideUnionStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SimpleWideUnionStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SimpleWideUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool SimpleWideUnionStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SimpleWideUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function SimpleWideUnionStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* SimpleWideUnionStructPubSubType::createData() -{ - return reinterpret_cast(new SimpleWideUnionStruct()); -} - -void SimpleWideUnionStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SimpleWideUnionStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SimpleWideUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SimpleWideUnionStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || SimpleWideUnionStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - diff --git a/test/unittest/xtypes/idl/WideEnumPubSubTypes.h b/test/unittest/xtypes/idl/WideEnumPubSubTypes.h deleted file mode 100644 index 2769b1414f3..00000000000 --- a/test/unittest/xtypes/idl/WideEnumPubSubTypes.h +++ /dev/null @@ -1,226 +0,0 @@ -// 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 WideEnumPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_WIDEENUM_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_WIDEENUM_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "WideEnum.h" - - -#if !defined(GEN_API_VER) || (GEN_API_VER != 2) -#error \ - Generated WideEnum is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. -#endif // GEN_API_VER - - - - -/*! - * @brief This class represents the TopicDataType of the type MyEnumWideStruct defined by the user in the IDL file. - * @ingroup WideEnum - */ -class MyEnumWideStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MyEnumWideStruct type; - - eProsima_user_DllExport MyEnumWideStructPubSubType(); - - eProsima_user_DllExport ~MyEnumWideStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - - - -/*! - * @brief This class represents the TopicDataType of the type SimpleWideUnionStruct defined by the user in the IDL file. - * @ingroup WideEnum - */ -class SimpleWideUnionStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SimpleWideUnionStruct type; - - eProsima_user_DllExport SimpleWideUnionStructPubSubType(); - - eProsima_user_DllExport ~SimpleWideUnionStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - -#endif // _FAST_DDS_GENERATED_WIDEENUM_PUBSUBTYPES_H_ - diff --git a/test/unittest/xtypes/idl/WideEnumTypeObject.cxx b/test/unittest/xtypes/idl/WideEnumTypeObject.cxx deleted file mode 100644 index ad42489b38d..00000000000 --- a/test/unittest/xtypes/idl/WideEnumTypeObject.cxx +++ /dev/null @@ -1,959 +0,0 @@ -// 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 WideEnumTypeObject.cpp - * This source file contains the definition of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { char dummy; } -#endif - -#include "WideEnum.h" -#include "WideEnumTypeObject.h" - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -using namespace eprosima::fastrtps::rtps; - -void registerWideEnumTypes() -{ - static std::once_flag once_flag; - std::call_once(once_flag, []() - { - TypeObjectFactory *factory = TypeObjectFactory::get_instance(); - factory->add_type_object("MyEnumWide", GetMyEnumWideIdentifier(true), - GetMyEnumWideObject(true)); - factory->add_type_object("MyEnumWide", GetMyEnumWideIdentifier(false), - GetMyEnumWideObject(false)); - - - factory->add_type_object("MyEnumWideStruct", GetMyEnumWideStructIdentifier(true), - GetMyEnumWideStructObject(true)); - factory->add_type_object("MyEnumWideStruct", GetMyEnumWideStructIdentifier(false), - GetMyEnumWideStructObject(false)); - - - factory->add_type_object("SimpleWideUnion", GetSimpleWideUnionIdentifier(true), - GetSimpleWideUnionObject(true)); - factory->add_type_object("SimpleWideUnion", GetSimpleWideUnionIdentifier(false), - GetSimpleWideUnionObject(false)); - - - factory->add_type_object("SimpleWideUnionStruct", GetSimpleWideUnionStructIdentifier(true), - GetSimpleWideUnionStructObject(true)); - factory->add_type_object("SimpleWideUnionStruct", GetSimpleWideUnionStructIdentifier(false), - GetSimpleWideUnionStructObject(false)); - - }); -} - -const TypeIdentifier* GetMyEnumWideIdentifier(bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyEnumWide", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyEnumWideObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyEnumWide", complete); -} - -const TypeObject* GetMyEnumWideObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnumWide", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyEnumWideObject(); - } - // else - return GetMinimalMyEnumWideObject(); -} - -const TypeObject* GetMinimalMyEnumWideObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnumWide", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ENUM); - - // No flags apply - //type_object->minimal().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->minimal().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->minimal().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->minimal().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - - uint32_t value = 0; - MinimalEnumeratedLiteral mel_A; - mel_A.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_A.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_A.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_A.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_A.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_A.common().flags().IS_KEY(false); // Doesn't apply - mel_A.common().flags().IS_DEFAULT(false); - mel_A.common().value(value++); - MD5 A_hash("A"); - for(int i = 0; i < 4; ++i) - { - mel_A.detail().name_hash()[i] = A_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_A); - - MinimalEnumeratedLiteral mel_B; - mel_B.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_B.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_B.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_B.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_B.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_B.common().flags().IS_KEY(false); // Doesn't apply - mel_B.common().flags().IS_DEFAULT(false); - mel_B.common().value(value++); - MD5 B_hash("B"); - for(int i = 0; i < 4; ++i) - { - mel_B.detail().name_hash()[i] = B_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_B); - - MinimalEnumeratedLiteral mel_C; - mel_C.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_C.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_C.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_C.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_C.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_C.common().flags().IS_KEY(false); // Doesn't apply - mel_C.common().flags().IS_DEFAULT(false); - mel_C.common().value(value++); - MD5 C_hash("C"); - for(int i = 0; i < 4; ++i) - { - mel_C.detail().name_hash()[i] = C_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_C); - - MinimalEnumeratedLiteral mel_D; - mel_D.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_D.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_D.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_D.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_D.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_D.common().flags().IS_KEY(false); // Doesn't apply - mel_D.common().flags().IS_DEFAULT(false); - mel_D.common().value(value++); - MD5 D_hash("D"); - for(int i = 0; i < 4; ++i) - { - mel_D.detail().name_hash()[i] = D_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_D); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().enumerated_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyEnumWide", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyEnumWide", false); -} - -const TypeObject* GetCompleteMyEnumWideObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnumWide", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ENUM); - - // No flags apply - //type_object->complete().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->complete().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->complete().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->complete().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - type_object->complete().enumerated_type().header().detail().type_name("MyEnumWide"); - - uint32_t value = 0; - CompleteEnumeratedLiteral cel_A; - cel_A.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_A.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_A.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_A.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_A.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_A.common().flags().IS_KEY(false); // Doesn't apply - cel_A.common().flags().IS_DEFAULT(false); - cel_A.common().value(value++); - cel_A.detail().name("A"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_A); - - CompleteEnumeratedLiteral cel_B; - cel_B.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_B.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_B.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_B.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_B.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_B.common().flags().IS_KEY(false); // Doesn't apply - cel_B.common().flags().IS_DEFAULT(false); - cel_B.common().value(value++); - cel_B.detail().name("B"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_B); - - CompleteEnumeratedLiteral cel_C; - cel_C.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_C.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_C.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_C.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_C.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_C.common().flags().IS_KEY(false); // Doesn't apply - cel_C.common().flags().IS_DEFAULT(false); - cel_C.common().value(value++); - cel_C.detail().name("C"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_C); - - CompleteEnumeratedLiteral cel_D; - cel_D.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_D.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_D.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_D.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_D.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_D.common().flags().IS_KEY(false); // Doesn't apply - cel_D.common().flags().IS_DEFAULT(false); - cel_D.common().value(value++); - cel_D.detail().name("D"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_D); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().enumerated_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyEnumWide", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyEnumWide", true); -} - - - -const TypeIdentifier* GetMyEnumWideStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyEnumWideStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyEnumWideStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyEnumWideStruct", complete); -} - -const TypeObject* GetMyEnumWideStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnumWideStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyEnumWideStructObject(); - } - //else - return GetMinimalMyEnumWideStructObject(); -} - -const TypeObject* GetMinimalMyEnumWideStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnumWideStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_enum_wide; - mst_my_enum_wide.common().member_id(memberId++); - mst_my_enum_wide.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_enum_wide.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_enum_wide.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_enum_wide.common().member_flags().IS_OPTIONAL(false); - mst_my_enum_wide.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_enum_wide.common().member_flags().IS_KEY(false); - mst_my_enum_wide.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_enum_wide.common().member_type_id(*GetMyEnumWideIdentifier(false)); - - MD5 my_enum_wide_hash("my_enum_wide"); - for(int i = 0; i < 4; ++i) - { - mst_my_enum_wide.detail().name_hash()[i] = my_enum_wide_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_enum_wide); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyEnumWideStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyEnumWideStruct", false); -} - -const TypeObject* GetCompleteMyEnumWideStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnumWideStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_enum_wide; - cst_my_enum_wide.common().member_id(memberId++); - cst_my_enum_wide.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_enum_wide.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_enum_wide.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_enum_wide.common().member_flags().IS_OPTIONAL(false); - cst_my_enum_wide.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_enum_wide.common().member_flags().IS_KEY(false); - cst_my_enum_wide.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_enum_wide.common().member_type_id(*GetMyEnumWideIdentifier(true)); - - cst_my_enum_wide.detail().name("my_enum_wide"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_enum_wide); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MyEnumWideStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyEnumWideStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyEnumWideStruct", true); -} - - - -const TypeIdentifier* GetSimpleWideUnionIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleWideUnion", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleWideUnionObject(complete); - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleWideUnion", complete); -} - -const TypeObject* GetSimpleWideUnionObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleWideUnion", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleWideUnionObject(); - } - // else - return GetMinimalSimpleWideUnionObject(); -} - -const TypeObject* GetMinimalSimpleWideUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleWideUnion", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_UNION); - - type_object->minimal().union_type().union_flags().IS_FINAL(false); - type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); - type_object->minimal().union_type().union_flags().IS_MUTABLE(false); - type_object->minimal().union_type().union_flags().IS_NESTED(false); - type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->minimal().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - MinimalUnionMember mst_first; - mst_first.common().member_id(memberId++); - mst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_first.common().member_flags().IS_KEY(false); // Doesn't apply - mst_first.common().member_flags().IS_DEFAULT(false); - mst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - mst_first.common().label_seq().emplace_back(A); - - MD5 first_hash("first"); - for(int i = 0; i < 4; ++i) - { - mst_first.detail().name_hash()[i] = first_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_first); - - MinimalUnionMember mst_second; - mst_second.common().member_id(memberId++); - mst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_second.common().member_flags().IS_KEY(false); // Doesn't apply - mst_second.common().member_flags().IS_DEFAULT(false); - mst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - mst_second.common().label_seq().emplace_back(B); - - MD5 second_hash("second"); - for(int i = 0; i < 4; ++i) - { - mst_second.detail().name_hash()[i] = second_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_second); - - MinimalUnionMember mst_third; - mst_third.common().member_id(memberId++); - mst_third.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_third.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_third.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_third.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_third.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_third.common().member_flags().IS_KEY(false); // Doesn't apply - mst_third.common().member_flags().IS_DEFAULT(false); - mst_third.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - - mst_third.common().label_seq().emplace_back(D); - - MD5 third_hash("third"); - for(int i = 0; i < 4; ++i) - { - mst_third.detail().name_hash()[i] = third_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_third); - - - // Header - //type_object->minimal().union_type().header().detail()... // Empty - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleWideUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleWideUnion", false); -} - -const TypeObject* GetCompleteSimpleWideUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleWideUnion", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_UNION); - - type_object->complete().union_type().union_flags().IS_FINAL(false); - type_object->complete().union_type().union_flags().IS_APPENDABLE(false); - type_object->complete().union_type().union_flags().IS_MUTABLE(false); - type_object->complete().union_type().union_flags().IS_NESTED(false); - type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->complete().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - CompleteUnionMember cst_first; - cst_first.common().member_id(memberId++); - cst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_first.common().member_flags().IS_KEY(false); // Doesn't apply - cst_first.common().member_flags().IS_DEFAULT(false); - cst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - cst_first.common().label_seq().emplace_back(A); - - - cst_first.detail().name("first"); - - type_object->complete().union_type().member_seq().emplace_back(cst_first); - - CompleteUnionMember cst_second; - cst_second.common().member_id(memberId++); - cst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_second.common().member_flags().IS_KEY(false); // Doesn't apply - cst_second.common().member_flags().IS_DEFAULT(false); - cst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - cst_second.common().label_seq().emplace_back(B); - - - cst_second.detail().name("second"); - - type_object->complete().union_type().member_seq().emplace_back(cst_second); - - CompleteUnionMember cst_third; - cst_third.common().member_id(memberId++); - cst_third.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_third.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_third.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_third.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_third.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_third.common().member_flags().IS_KEY(false); // Doesn't apply - cst_third.common().member_flags().IS_DEFAULT(false); - cst_third.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - cst_third.common().label_seq().emplace_back(D); - - - cst_third.detail().name("third"); - - type_object->complete().union_type().member_seq().emplace_back(cst_third); - - - // Header - type_object->complete().union_type().header().detail().type_name("SimpleWideUnion"); - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleWideUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleWideUnion", true); -} - - - -const TypeIdentifier* GetSimpleWideUnionStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleWideUnionStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleWideUnionStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleWideUnionStruct", complete); -} - -const TypeObject* GetSimpleWideUnionStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleWideUnionStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleWideUnionStructObject(); - } - //else - return GetMinimalSimpleWideUnionStructObject(); -} - -const TypeObject* GetMinimalSimpleWideUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleWideUnionStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_union; - mst_my_union.common().member_id(memberId++); - mst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union.common().member_flags().IS_OPTIONAL(false); - mst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union.common().member_flags().IS_KEY(false); - mst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union.common().member_type_id(*GetSimpleWideUnionIdentifier(false)); - - MD5 my_union_hash("my_union"); - for(int i = 0; i < 4; ++i) - { - mst_my_union.detail().name_hash()[i] = my_union_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleWideUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleWideUnionStruct", false); -} - -const TypeObject* GetCompleteSimpleWideUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleWideUnionStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_union; - cst_my_union.common().member_id(memberId++); - cst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union.common().member_flags().IS_OPTIONAL(false); - cst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union.common().member_flags().IS_KEY(false); - cst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union.common().member_type_id(*GetSimpleWideUnionIdentifier(true)); - - cst_my_union.detail().name("my_union"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SimpleWideUnionStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleWideUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleWideUnionStruct", true); -} diff --git a/test/unittest/xtypes/idl/WideEnumTypeObject.h b/test/unittest/xtypes/idl/WideEnumTypeObject.h deleted file mode 100644 index 34ea60df451..00000000000 --- a/test/unittest/xtypes/idl/WideEnumTypeObject.h +++ /dev/null @@ -1,84 +0,0 @@ -// 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 WideEnumTypeObject.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_WIDEENUM_TYPE_OBJECT_H_ -#define _FAST_DDS_GENERATED_WIDEENUM_TYPE_OBJECT_H_ - - -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif -#else -#define eProsima_user_DllExport -#endif - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(WideEnum_SOURCE) -#define WideEnum_DllAPI __declspec( dllexport ) -#else -#define WideEnum_DllAPI __declspec( dllimport ) -#endif // WideEnum_SOURCE -#else -#define WideEnum_DllAPI -#endif -#else -#define WideEnum_DllAPI -#endif // _WIN32 - -using namespace eprosima::fastrtps::types; - -eProsima_user_DllExport void registerWideEnumTypes(); - -eProsima_user_DllExport const TypeIdentifier* GetMyEnumWideIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyEnumWideObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyEnumWideObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyEnumWideObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetMyEnumWideStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyEnumWideStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyEnumWideStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyEnumWideStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleWideUnionIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleWideUnionObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleWideUnionObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleWideUnionObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleWideUnionStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleWideUnionStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleWideUnionStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleWideUnionStructObject(); - - -#endif // _FAST_DDS_GENERATED_WIDEENUM_TYPE_OBJECT_H_ \ No newline at end of file diff --git a/test/unittest/xtypes/idl/WideEnumv1.cxx b/test/unittest/xtypes/idl/WideEnumv1.cxx deleted file mode 100644 index a49be8dfc84..00000000000 --- a/test/unittest/xtypes/idl/WideEnumv1.cxx +++ /dev/null @@ -1,858 +0,0 @@ -// 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 WideEnum.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "WideEnum.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include "WideEnumTypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define MyEnumWideStruct_max_cdr_typesize 8ULL; - -#define SimpleWideUnionStruct_max_cdr_typesize 24ULL; - - - - - -MyEnumWideStruct::MyEnumWideStruct() -{ - // MyEnumWide m_my_enum_wide - m_my_enum_wide = ::A; - - // Just to register all known types - registerWideEnumTypes(); -} - -MyEnumWideStruct::~MyEnumWideStruct() -{ -} - -MyEnumWideStruct::MyEnumWideStruct( - const MyEnumWideStruct& x) -{ - m_my_enum_wide = x.m_my_enum_wide; - -} - -MyEnumWideStruct::MyEnumWideStruct( - MyEnumWideStruct&& x) noexcept -{ - m_my_enum_wide = x.m_my_enum_wide; - -} - -MyEnumWideStruct& MyEnumWideStruct::operator =( - const MyEnumWideStruct& x) -{ - m_my_enum_wide = x.m_my_enum_wide; - - return *this; -} - -MyEnumWideStruct& MyEnumWideStruct::operator =( - MyEnumWideStruct&& x) noexcept -{ - m_my_enum_wide = x.m_my_enum_wide; - - return *this; -} - -bool MyEnumWideStruct::operator ==( - const MyEnumWideStruct& x) const -{ - return (m_my_enum_wide == x.m_my_enum_wide); -} - -bool MyEnumWideStruct::operator !=( - const MyEnumWideStruct& x) const -{ - return !(*this == x); -} - -size_t MyEnumWideStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MyEnumWideStruct_max_cdr_typesize; -} - -size_t MyEnumWideStruct::getCdrSerializedSize( - const MyEnumWideStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void MyEnumWideStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << (uint32_t)m_my_enum_wide; - -} - -void MyEnumWideStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_my_enum_wide = (MyEnumWide)enum_value; - } - - -} - - -bool MyEnumWideStruct::isKeyDefined() -{ - return false; -} - -void MyEnumWideStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_enum_wide - * @param _my_enum_wide New value for member my_enum_wide - */ -void MyEnumWideStruct::my_enum_wide( - MyEnumWide _my_enum_wide) -{ - m_my_enum_wide = _my_enum_wide; -} - -/*! - * @brief This function returns the value of member my_enum_wide - * @return Value of member my_enum_wide - */ -MyEnumWide MyEnumWideStruct::my_enum_wide() const -{ - return m_my_enum_wide; -} - -/*! - * @brief This function returns a reference to member my_enum_wide - * @return Reference to member my_enum_wide - */ -MyEnumWide& MyEnumWideStruct::my_enum_wide() -{ - return m_my_enum_wide; -} - - - - - -SimpleWideUnion::SimpleWideUnion() -{ - m__d = A; - // long m_first - m_first = 0; - // long long m_second - m_second = 0; - // octet m_third - m_third = 0; -} - -SimpleWideUnion::~SimpleWideUnion() -{ -} - -SimpleWideUnion::SimpleWideUnion( - const SimpleWideUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - - case D: - m_third = x.m_third; - break; - - default: - break; - } -} - -SimpleWideUnion::SimpleWideUnion( - SimpleWideUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - - case D: - m_third = x.m_third; - break; - - default: - break; - } -} - -SimpleWideUnion& SimpleWideUnion::operator =( - const SimpleWideUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - - case D: - m_third = x.m_third; - break; - - default: - break; - } - - return *this; -} - -SimpleWideUnion& SimpleWideUnion::operator =( - SimpleWideUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - - case D: - m_third = x.m_third; - break; - - default: - break; - } - - return *this; -} - -bool SimpleWideUnion::operator ==( - const SimpleWideUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case B: - return (m_second == x.m_second); - break; - - - case D: - return (m_third == x.m_third); - break; - - default: - break; - } - return false; -} - -bool SimpleWideUnion::operator !=( - const SimpleWideUnion& x) const -{ - return !(*this == x); -} - -void SimpleWideUnion::_d( - int32_t __d) -{ - bool b = false; - - switch(m__d) - { - case A: - switch(__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch(__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - - case D: - switch(__d) - { - case D: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleWideUnion::_d() const -{ - return m__d; -} - -int32_t& SimpleWideUnion::_d() -{ - return m__d; -} - -void SimpleWideUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = A; - -} - -int32_t SimpleWideUnion::first() const -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& SimpleWideUnion::first() -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleWideUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = B; - -} - -int64_t SimpleWideUnion::second() const -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleWideUnion::second() -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - -void SimpleWideUnion::third( - uint8_t _third) -{ - m_third = _third; - m__d = D; - -} - -uint8_t SimpleWideUnion::third() const -{ - bool b = false; - - switch(m__d) - { - case D: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_third; -} - -uint8_t& SimpleWideUnion::third() -{ - bool b = false; - - switch(m__d) - { - case D: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_third; -} - - -// TODO(Ricardo) Review -size_t SimpleWideUnion::getCdrSerializedSize( - const SimpleWideUnion& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - switch(data.m__d) - { - case A: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - - - case B: - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - break; - - - case D: - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void SimpleWideUnion::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m__d; - - switch(m__d) - { - case A: - scdr << m_first; - - break; - - - case B: - scdr << m_second; - - break; - - - case D: - scdr << m_third; - - break; - - default: - break; - } -} - -void SimpleWideUnion::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m__d; - - - switch(m__d) - { - case A: - dcdr >> m_first; - - - break; - - - case B: - dcdr >> m_second; - - - break; - - - case D: - dcdr >> m_third; - - - break; - - default: - break; - } -} - - - - - -SimpleWideUnionStruct::SimpleWideUnionStruct() -{ - // SimpleWideUnion m_my_union - - - // Just to register all known types - registerWideEnumTypes(); -} - -SimpleWideUnionStruct::~SimpleWideUnionStruct() -{ -} - -SimpleWideUnionStruct::SimpleWideUnionStruct( - const SimpleWideUnionStruct& x) -{ - m_my_union = x.m_my_union; - -} - -SimpleWideUnionStruct::SimpleWideUnionStruct( - SimpleWideUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - -} - -SimpleWideUnionStruct& SimpleWideUnionStruct::operator =( - const SimpleWideUnionStruct& x) -{ - m_my_union = x.m_my_union; - - return *this; -} - -SimpleWideUnionStruct& SimpleWideUnionStruct::operator =( - SimpleWideUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - - return *this; -} - -bool SimpleWideUnionStruct::operator ==( - const SimpleWideUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleWideUnionStruct::operator !=( - const SimpleWideUnionStruct& x) const -{ - return !(*this == x); -} - -size_t SimpleWideUnionStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SimpleWideUnionStruct_max_cdr_typesize; -} - -size_t SimpleWideUnionStruct::getCdrSerializedSize( - const SimpleWideUnionStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += SimpleWideUnion::getCdrSerializedSize(data.my_union(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void SimpleWideUnionStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_union; - -} - -void SimpleWideUnionStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_union; - - -} - - -bool SimpleWideUnionStruct::isKeyDefined() -{ - return false; -} - -void SimpleWideUnionStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleWideUnionStruct::my_union( - const SimpleWideUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleWideUnionStruct::my_union( - SimpleWideUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleWideUnion& SimpleWideUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleWideUnion& SimpleWideUnionStruct::my_union() -{ - return m_my_union; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/unittest/xtypes/idl/WideEnumv1.h b/test/unittest/xtypes/idl/WideEnumv1.h deleted file mode 100644 index 9624f24e48f..00000000000 --- a/test/unittest/xtypes/idl/WideEnumv1.h +++ /dev/null @@ -1,560 +0,0 @@ -// 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 WideEnum.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_WIDEENUM_H_ -#define _FAST_DDS_GENERATED_WIDEENUM_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(WIDEENUM_SOURCE) -#define WIDEENUM_DllAPI __declspec( dllexport ) -#else -#define WIDEENUM_DllAPI __declspec( dllimport ) -#endif // WIDEENUM_SOURCE -#else -#define WIDEENUM_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define WIDEENUM_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -/*! - * @brief This class represents the enumeration MyEnumWide defined by the user in the IDL file. - * @ingroup WideEnum - */ -enum MyEnumWide : uint32_t -{ - A, - B, - C, - D -}; - - -/*! - * @brief This class represents the structure MyEnumWideStruct defined by the user in the IDL file. - * @ingroup WideEnum - */ -class MyEnumWideStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyEnumWideStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyEnumWideStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyEnumWideStruct that will be copied. - */ - eProsima_user_DllExport MyEnumWideStruct( - const MyEnumWideStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyEnumWideStruct that will be copied. - */ - eProsima_user_DllExport MyEnumWideStruct( - MyEnumWideStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyEnumWideStruct that will be copied. - */ - eProsima_user_DllExport MyEnumWideStruct& operator =( - const MyEnumWideStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyEnumWideStruct that will be copied. - */ - eProsima_user_DllExport MyEnumWideStruct& operator =( - MyEnumWideStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyEnumWideStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyEnumWideStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MyEnumWideStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyEnumWideStruct& x) const; - - /*! - * @brief This function sets a value in member my_enum_wide - * @param _my_enum_wide New value for member my_enum_wide - */ - eProsima_user_DllExport void my_enum_wide( - MyEnumWide _my_enum_wide); - - /*! - * @brief This function returns the value of member my_enum_wide - * @return Value of member my_enum_wide - */ - eProsima_user_DllExport MyEnumWide my_enum_wide() const; - - /*! - * @brief This function returns a reference to member my_enum_wide - * @return Reference to member my_enum_wide - */ - eProsima_user_DllExport MyEnumWide& my_enum_wide(); - - - /*! - * @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 MyEnumWideStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - MyEnumWide m_my_enum_wide; - -}; - - - -/*! - * @brief This class represents the union SimpleWideUnion defined by the user in the IDL file. - * @ingroup WideEnum - */ -class SimpleWideUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleWideUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleWideUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleWideUnion that will be copied. - */ - eProsima_user_DllExport SimpleWideUnion( - const SimpleWideUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleWideUnion that will be copied. - */ - eProsima_user_DllExport SimpleWideUnion( - SimpleWideUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleWideUnion that will be copied. - */ - eProsima_user_DllExport SimpleWideUnion& operator =( - const SimpleWideUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleWideUnion that will be copied. - */ - eProsima_user_DllExport SimpleWideUnion& operator =( - SimpleWideUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleWideUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleWideUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleWideUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleWideUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - - - /*! - * @brief This function sets a value in member third - * @param _third New value for member third - */ - eProsima_user_DllExport void third( - uint8_t _third); - - /*! - * @brief This function returns the value of member third - * @return Value of member third - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t third() const; - - /*! - * @brief This function returns a reference to member third - * @return Reference to member third - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t& third(); - - - /*! - * @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 SimpleWideUnion& 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: - - int32_t m__d; - - int32_t m_first; - int64_t m_second; - uint8_t m_third; -}; - - - -/*! - * @brief This class represents the structure SimpleWideUnionStruct defined by the user in the IDL file. - * @ingroup WideEnum - */ -class SimpleWideUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleWideUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleWideUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleWideUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleWideUnionStruct( - const SimpleWideUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleWideUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleWideUnionStruct( - SimpleWideUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleWideUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleWideUnionStruct& operator =( - const SimpleWideUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleWideUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleWideUnionStruct& operator =( - SimpleWideUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleWideUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleWideUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleWideUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleWideUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleWideUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleWideUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleWideUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleWideUnion& my_union(); - - - /*! - * @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 SimpleWideUnionStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - SimpleWideUnion m_my_union; - -}; - - -#endif // _FAST_DDS_GENERATED_WIDEENUM_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/xtypes/CMakeLists.txt b/test/xtypes/CMakeLists.txt deleted file mode 100644 index 35620b51bf4..00000000000 --- a/test/xtypes/CMakeLists.txt +++ /dev/null @@ -1,44 +0,0 @@ -# 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. -if(WIN32) - add_definitions( - -D_WIN32_WINNT=0x0601 - -D_CRT_SECURE_NO_WARNINGS - ) -endif() - -############################################################################### -# Unit tests -############################################################################### -set(XTYPES_TESTS_SOURCE XTypesTests.cpp - idl/Types.cxx - idl/Typesv1.cxx - idl/TypesPubSubTypes.cxx - idl/TypesTypeObject.cxx - TestPublisher.cpp - TestSubscriber.cpp - ) - -add_executable(XTypesBlackBoxTests ${XTYPES_TESTS_SOURCE}) -target_compile_definitions(XTypesBlackBoxTests PRIVATE - EPROSIMA_SHAPES_DLL_EXPORT - BUILD_SHARED_LIBS - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) -target_include_directories(XTypesBlackBoxTests PRIVATE ${Asio_INCLUDE_DIR}) -target_link_libraries(XTypesBlackBoxTests fastdds fastcdr GTest::gtest) -gtest_discover_tests(XTypesBlackBoxTests) diff --git a/test/xtypes/TestPublisher.cpp b/test/xtypes/TestPublisher.cpp deleted file mode 100644 index ce6530b15b6..00000000000 --- a/test/xtypes/TestPublisher.cpp +++ /dev/null @@ -1,355 +0,0 @@ -// 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 TestPublisher.cpp - * - */ - -#include "TestPublisher.h" - -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -using namespace eprosima::fastdds::dds; -using namespace eprosima::fastdds::dds::xtypes; -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::rtps; - -TestPublisher::TestPublisher() - : m_iSamples(-1) - , m_sentSamples(0) - , m_iWaitTime(1000) - , m_Data(nullptr) - , m_bInitialized(false) - , using_typelookup_(false) - , tls_callback_called_(false) - , mp_participant(nullptr) - , mp_publisher(nullptr) - , writer_(nullptr) - , part_listener_(this) - , m_pubListener(this) - -{ -} - -bool TestPublisher::init( - const std::string& topicName, - int domain, - eprosima::fastdds::dds::TypeSupport type, - const eprosima::fastrtps::types::TypeObject* type_object, - const eprosima::fastrtps::types::TypeIdentifier* type_identifier, - const eprosima::fastrtps::types::TypeInformation* type_info, - const std::string& name, - const eprosima::fastdds::dds::DataRepresentationQosPolicy* dataRepresentationQos, - bool use_typelookup) -{ - m_Name = name; - m_Type.swap(type); - using_typelookup_ = use_typelookup; - - DomainParticipantQos pqos; - pqos.wire_protocol().builtin.discovery_config.leaseDuration = c_TimeInfinite; - pqos.wire_protocol().builtin.discovery_config.leaseDuration_announcementperiod = Duration_t(1, 0); - pqos.wire_protocol().builtin.typelookup_config.use_client = using_typelookup_; - pqos.wire_protocol().builtin.typelookup_config.use_server = using_typelookup_; - pqos.name(m_Name.c_str()); - - //Do not enable entities on creation - DomainParticipantFactoryQos factory_qos; - factory_qos.entity_factory().autoenable_created_entities = false; - DomainParticipantFactory::get_instance()->set_qos(factory_qos); - - mp_participant = DomainParticipantFactory::get_instance()->create_participant(domain, pqos, &part_listener_); - if (mp_participant == nullptr) - { - return false; - } - mp_participant->enable(); - - // CREATE THE PUBLISHER - std::string data_type = m_Type != nullptr ? m_Type->getName() : ""; - DataWriterQos wqos; - - //REGISTER THE TYPE - if (m_Type != nullptr) - { - m_Type->auto_fill_type_information(false); - m_Type->auto_fill_type_object(false); - if (type_object != nullptr) - { - m_Type->type_object(*type_object); - } - if (type_identifier != nullptr) - { - m_Type->type_identifier(*type_identifier); - } - if (type_info != nullptr) - { - m_Type->type_information(*type_info); - } - m_Type.register_type(mp_participant); - } - - std::ostringstream t; - t << topicName << "_" << asio::ip::host_name() << "_" << domain; - topic_name_ = t.str(); - - if (dataRepresentationQos != nullptr) - { - wqos.representation(*dataRepresentationQos); - } - - if (m_Type != nullptr) - { - mp_publisher = mp_participant->create_publisher(PUBLISHER_QOS_DEFAULT, nullptr); - if (mp_publisher == nullptr) - { - return false; - } - - mp_topic = mp_participant->create_topic(t.str(), data_type, TOPIC_QOS_DEFAULT); - if (mp_topic == nullptr) - { - return false; - } - - writer_ = mp_publisher->create_datawriter(mp_topic, wqos, &m_pubListener); - - m_Data = m_Type->createData(); - } - - m_bInitialized = true; - writer_qos = wqos; - - return true; -} - -TestPublisher::~TestPublisher() -{ - if (m_Type) - { - m_Type->deleteData(m_Data); - } - if (writer_) - { - mp_publisher->delete_datawriter(writer_); - } - if (mp_publisher) - { - mp_participant->delete_publisher(mp_publisher); - } - if (mp_topic) - { - mp_participant->delete_topic(mp_topic); - } - DomainParticipantFactory::get_instance()->delete_participant(mp_participant); -} - -void TestPublisher::waitDiscovery( - bool expectMatch, - int maxWait) -{ - std::unique_lock lock(m_mDiscovery); - - if (m_pubListener.n_matched == 0) - { - m_cvDiscovery.wait_for(lock, std::chrono::seconds(maxWait)); - } - - if (expectMatch) - { - ASSERT_GE(m_pubListener.n_matched, 1); - } - else - { - ASSERT_EQ(m_pubListener.n_matched, 0); - } -} - -void TestPublisher::waitTypeDiscovery( - bool expectMatch, - int maxWait) -{ - std::unique_lock lock(mtx_type_discovery_); - - if (!part_listener_.discovered_) - { - cv_type_discovery_.wait_for(lock, std::chrono::seconds(maxWait)); - } - - if (expectMatch) - { - ASSERT_TRUE(part_listener_.discovered_); - } - else - { - ASSERT_FALSE(part_listener_.discovered_); - } -} - -void TestPublisher::matched() -{ - std::unique_lock lock(m_mDiscovery); - ++m_pubListener.n_matched; - if (m_pubListener.n_matched >= 1) - { - m_cvDiscovery.notify_one(); - } -} - -TestPublisher::PubListener::PubListener( - TestPublisher* parent) - : mParent(parent) - , n_matched(0) -{ -} - -void TestPublisher::PubListener::on_publication_matched( - eprosima::fastdds::dds::DataWriter*, - const eprosima::fastdds::dds::PublicationMatchedStatus& info) -{ - if (info.current_count_change > 0) - { - std::cout << mParent->m_Name << " matched." << std::endl; - mParent->matched(); - } - else - { - std::cout << mParent->m_Name << " unmatched." << std::endl; - } -} - -void TestPublisher::PartListener::on_type_discovery( - eprosima::fastdds::dds::DomainParticipant*, - const rtps::SampleIdentity&, - const eprosima::fastcdr::string_255& topic, - const eprosima::fastrtps::types::TypeIdentifier*, - const eprosima::fastrtps::types::TypeObject*, - eprosima::fastrtps::types::DynamicType_ptr dyn_type) -{ - if (!parent_->using_typelookup_ || parent_->tls_callback_called_) - { - std::cout << "Discovered type: " << dyn_type->get_name() << " on topic: " << topic << std::endl; - std::lock_guard lock(parent_->mtx_type_discovery_); - discovered_ = true; - parent_->disc_type_ = dyn_type; - parent_->cv_type_discovery_.notify_one(); - } -} - -void TestPublisher::PartListener::on_type_information_received( - eprosima::fastdds::dds::DomainParticipant*, - const eprosima::fastcdr::string_255 topic_name, - const eprosima::fastcdr::string_255 type_name, - const eprosima::fastrtps::types::TypeInformation& type_information) -{ - std::function callback = - [this, topic_name](const std::string&, const types::DynamicType_ptr type) - { - std::cout << "Callback for type: " << type->get_name() << " on topic: " << topic_name << std::endl; - parent_->tls_callback_called_ = true; - on_type_discovery(nullptr, rtps::SampleIdentity(), topic_name, nullptr, nullptr, type); - parent_->tls_callback_called_ = false; - }; - - std::cout << "Received type information: " << type_name << " on topic: " << topic_name << std::endl; - parent_->mp_participant->register_remote_type(type_information, type_name.to_string(), callback); -} - -void TestPublisher::runThread() -{ - int iPrevCount = 0; - std::cout << m_Name << " running..." << std::endl; - while (!publish() && iPrevCount < m_iSamples) - { - std::this_thread::sleep_for(std::chrono::milliseconds(m_iWaitTime)); - ++iPrevCount; - } -} - -void TestPublisher::run() -{ - std::thread thread(&TestPublisher::runThread, this); - thread.join(); -} - -bool TestPublisher::publish() -{ - if (m_pubListener.n_matched > 0) - { - if (writer_->write(m_Data)) - { - ++m_sentSamples; - //std::cout << m_Name << " sent a total of " << m_sentSamples << " samples." << std::endl; - return true; - } - //else - //{ - // std::cout << m_Name << " failed to send " << (m_sentSamples + 1) << " sample." << std::endl; - //} - } - return false; -} - -DataWriter* TestPublisher::create_datawriter() -{ - if (mp_publisher == nullptr) - { - mp_publisher = mp_participant->create_publisher(PUBLISHER_QOS_DEFAULT, nullptr); - - if (mp_publisher == nullptr) - { - return nullptr; - } - } - mp_topic = mp_participant->create_topic(topic_name_, disc_type_->get_name(), TOPIC_QOS_DEFAULT); - if (mp_topic == nullptr) - { - return nullptr; - } - return mp_publisher->create_datawriter(mp_topic, writer_qos, &m_pubListener); - -} - -void TestPublisher::delete_datawriter( - eprosima::fastdds::dds::DataWriter* writer) -{ - mp_publisher->delete_datawriter(writer); -} - -bool TestPublisher::register_discovered_type() -{ - TypeSupport type(disc_type_); - type->auto_fill_type_object(true); - type->auto_fill_type_information(true); - return type.register_type(mp_participant, disc_type_->get_name()) == ReturnCode_t::RETCODE_OK; -} diff --git a/test/xtypes/TestPublisher.h b/test/xtypes/TestPublisher.h deleted file mode 100644 index 1e1d1f000d6..00000000000 --- a/test/xtypes/TestPublisher.h +++ /dev/null @@ -1,209 +0,0 @@ -// 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 TestPublisher.h - * - */ - -#ifndef _TEST_PUBLISHER_H_ -#define _TEST_PUBLISHER_H_ - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -class TestPublisher -{ -public: - - TestPublisher(); - - virtual ~TestPublisher(); - - //!Initialize - bool init( - const std::string& topicName, - int domain, - eprosima::fastdds::dds::TypeSupport type, - const eprosima::fastrtps::types::TypeObject* type_object, - const eprosima::fastrtps::types::TypeIdentifier* type_identifier, - const eprosima::fastrtps::types::TypeInformation* type_info, - const std::string& name, - const eprosima::fastdds::dds::DataRepresentationQosPolicy* dataRepresentationQos, - bool use_typelookup = false); - - //!Publish a sample - bool publish(); - - //!Run for number samples - void run(); - - // Auxiliar test methods - bool isInitialized() const - { - return m_bInitialized; - } - - void waitDiscovery( - bool expectMatch = true, - int maxWait = 10); - - void waitTypeDiscovery( - bool expectMatch = true, - int maxWait = 10); - - void matched(); - - bool isMatched() - { - return m_pubListener.n_matched > 0; - } - - void send() - { - waitDiscovery(); publish(); - } - - eprosima::fastrtps::types::DynamicType_ptr discovered_type() const - { - return disc_type_; - } - - eprosima::fastdds::dds::DataWriter* create_datawriter(); - - void delete_datawriter( - eprosima::fastdds::dds::DataWriter* writer); - - bool register_discovered_type(); - - eprosima::fastdds::dds::TypeSupport m_Type; - -private: - - std::string m_Name; - - std::string topic_name_; - - - - int m_iSamples; - - int m_sentSamples; - - int m_iWaitTime; - - void* m_Data; - - bool m_bInitialized; - - bool using_typelookup_; - - bool tls_callback_called_; - - std::mutex m_mDiscovery; - - std::mutex mtx_type_discovery_; - - std::condition_variable m_cvDiscovery; - - std::condition_variable cv_type_discovery_; - - eprosima::fastdds::dds::DomainParticipant* mp_participant; - - eprosima::fastdds::dds::Publisher* mp_publisher; - - eprosima::fastdds::dds::Topic* mp_topic; - - eprosima::fastdds::dds::DataWriter* writer_; - - eprosima::fastrtps::types::DynamicType_ptr disc_type_; - - eprosima::fastdds::dds::DataWriterQos writer_qos; - - class PartListener : public eprosima::fastdds::dds::DomainParticipantListener - { - public: - - PartListener( - TestPublisher* parent) - : parent_(parent) - , discovered_(false) - { - } - - ~PartListener() override - { - } - - void on_type_discovery( - eprosima::fastdds::dds::DomainParticipant* participant, - const eprosima::fastrtps::rtps::SampleIdentity& request_sample_id, - const eprosima::fastcdr::string_255& topic, - const eprosima::fastrtps::types::TypeIdentifier* identifier, - const eprosima::fastrtps::types::TypeObject* object, - eprosima::fastrtps::types::DynamicType_ptr dyn_type) override; - - void on_type_information_received( - eprosima::fastdds::dds::DomainParticipant* participant, - const eprosima::fastcdr::string_255 topic_name, - const eprosima::fastcdr::string_255 type_name, - const eprosima::fastrtps::types::TypeInformation& type_information) override; - - TestPublisher* parent_; - std::atomic discovered_; - - } - part_listener_; - - class PubListener : public eprosima::fastdds::dds::DataWriterListener - { - public: - - PubListener() - { - } - - PubListener( - TestPublisher* parent); - - ~PubListener() override - { - } - - void on_publication_matched( - eprosima::fastdds::dds::DataWriter* writer, - const eprosima::fastdds::dds::PublicationMatchedStatus& info) override; - - TestPublisher* mParent; - int n_matched; - } - m_pubListener; - - void runThread(); -}; - - - -#endif /* _TEST_PUBLISHER_H_ */ diff --git a/test/xtypes/TestSubscriber.cpp b/test/xtypes/TestSubscriber.cpp deleted file mode 100644 index 8c670d5c04a..00000000000 --- a/test/xtypes/TestSubscriber.cpp +++ /dev/null @@ -1,376 +0,0 @@ -// 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 TestSubscriber.cpp - * - */ - -#include "TestSubscriber.h" - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace eprosima::fastdds::dds; -using namespace eprosima::fastrtps; -using namespace eprosima::fastrtps::rtps; - -TestSubscriber::TestSubscriber() - : mp_participant(nullptr) - , mp_subscriber(nullptr) - , reader_(nullptr) - , topic_(nullptr) - , m_Data(nullptr) - , m_bInitialized(false) - , using_typelookup_(false) - , tls_callback_called_(false) - , dataRepresentationQos_(nullptr) - , typeConsistencyQos_(nullptr) - , part_listener_(this) - , m_subListener(this) -{ -} - -bool TestSubscriber::init( - const std::string& topicName, - int domain, - eprosima::fastdds::dds::TypeSupport type, - const eprosima::fastrtps::types::TypeObject* type_object, - const eprosima::fastrtps::types::TypeIdentifier* type_identifier, - const eprosima::fastrtps::types::TypeInformation* type_info, - const std::string& name, - const eprosima::fastdds::dds::DataRepresentationQosPolicy* dataRepresentationQos, - const eprosima::fastdds::dds::TypeConsistencyEnforcementQosPolicy* typeConsistencyQos, - bool use_typelookup) -{ - dataRepresentationQos_ = dataRepresentationQos; - typeConsistencyQos_ = typeConsistencyQos; - - m_Name = name; - m_Type.swap(type); - using_typelookup_ = use_typelookup; - DomainParticipantQos pqos; - pqos.wire_protocol().builtin.discovery_config.leaseDuration = c_TimeInfinite; - pqos.wire_protocol().builtin.discovery_config.leaseDuration_announcementperiod = Duration_t(1, 0); - pqos.wire_protocol().builtin.typelookup_config.use_client = using_typelookup_; - pqos.wire_protocol().builtin.typelookup_config.use_server = using_typelookup_; - pqos.name(m_Name.c_str()); - - //Do not enable entities on creation - DomainParticipantFactoryQos factory_qos; - factory_qos.entity_factory().autoenable_created_entities = false; - DomainParticipantFactory::get_instance()->set_qos(factory_qos); - - mp_participant = DomainParticipantFactory::get_instance()->create_participant(domain, pqos, &part_listener_); - if (mp_participant == nullptr) - { - std::cout << "ERROR" << std::endl; - return false; - } - mp_participant->enable(); - - std::ostringstream t; - t << topicName << "_" << asio::ip::host_name() << "_" << domain; - topic_name_ = t.str(); - - //REGISTER THE TYPE - if (m_Type != nullptr) - { - if (type_object != nullptr) - { - m_Type->type_object(*type_object); - } - if (type_identifier != nullptr) - { - m_Type->type_identifier(*type_identifier); - } - if (type_info != nullptr) - { - m_Type->type_information(*type_info); - } - - m_Type->auto_fill_type_information(false); - m_Type->auto_fill_type_object(false); - m_Type.register_type(mp_participant); - - //CREATE THE TOPIC - topic_ = mp_participant->create_topic( - topic_name_, - m_Type->getName(), - TOPIC_QOS_DEFAULT); - - if (topic_ == nullptr) - { - return false; - } - - //CREATE THE SUBSCRIBER - mp_subscriber = mp_participant->create_subscriber(SUBSCRIBER_QOS_DEFAULT, nullptr); - - if (mp_subscriber == nullptr) - { - return false; - } - - //CREATE THE DATAREADER - reader_qos = mp_subscriber->get_default_datareader_qos(); - if (typeConsistencyQos_ != nullptr) - { - reader_qos.type_consistency().type_consistency = *typeConsistencyQos_; - } - if (dataRepresentationQos_ != nullptr) - { - reader_qos.type_consistency().representation = *dataRepresentationQos_; - } - reader_ = mp_subscriber->create_datareader(topic_, reader_qos, &m_subListener); - - if (reader_ == nullptr) - { - return false; - } - - m_Data = m_Type->createData(); - } - m_bInitialized = true; - - return true; -} - -TestSubscriber::~TestSubscriber() -{ - if (m_Type != nullptr) - { - m_Type->deleteData(m_Data); - } - - if (reader_ != nullptr) - { - mp_subscriber->delete_datareader(reader_); - } - if (mp_subscriber != nullptr) - { - mp_participant->delete_subscriber(mp_subscriber); - } - if (topic_ != nullptr) - { - mp_participant->delete_topic(topic_); - } - DomainParticipantFactory::get_instance()->delete_participant(mp_participant); -} - -TestSubscriber::SubListener::SubListener( - TestSubscriber* parent) - : mParent(parent) - , n_matched(0) - , n_samples(0) -{ -} - -void TestSubscriber::waitDiscovery( - bool expectMatch, - int maxWait) -{ - std::unique_lock lock(m_mDiscovery); - - if (m_subListener.n_matched == 0) - { - m_cvDiscovery.wait_for(lock, std::chrono::seconds(maxWait)); - } - - if (expectMatch) - { - ASSERT_GE(m_subListener.n_matched, 1); - } - else - { - ASSERT_EQ(m_subListener.n_matched, 0); - } -} - -void TestSubscriber::waitTypeDiscovery( - bool expectMatch, - int maxWait) -{ - std::unique_lock lock(mtx_type_discovery_); - - if (!part_listener_.discovered_) - { - cv_type_discovery_.wait_for(lock, std::chrono::seconds(maxWait)); - } - - if (expectMatch) - { - ASSERT_TRUE(part_listener_.discovered_); - } - else - { - ASSERT_FALSE(part_listener_.discovered_); - } -} - -void TestSubscriber::matched( - bool unmatched) -{ - std::unique_lock lock(m_mDiscovery); - if (unmatched) - { - --m_subListener.n_matched; - } - else - { - ++m_subListener.n_matched; - } - if (m_subListener.n_matched >= 1) - { - m_cvDiscovery.notify_one(); - } -} - -void TestSubscriber::SubListener::on_subscription_matched( - eprosima::fastdds::dds::DataReader*, - const eprosima::fastdds::dds::SubscriptionMatchedStatus& info) -{ - if (info.current_count_change > 0) - { - mParent->matched(); - std::cout << mParent->m_Name << " matched." << std::endl; - } - else if (info.current_count_change < 0) - { - mParent->matched(true); - std::cout << mParent->m_Name << " unmatched." << std::endl; - } -} - -void TestSubscriber::SubListener::on_data_available( - eprosima::fastdds::dds::DataReader* reader) -{ - SampleInfo info; - if (!!reader->take_next_sample(mParent->m_Data, &info)) - { - if (info.valid_data) - { - ++n_samples; - mParent->cv_.notify_one(); - //std::cout << mParent->m_Name << " received a total of " << n_samples << " samples." << std::endl; - } - } -} - -void TestSubscriber::PartListener::on_type_discovery( - eprosima::fastdds::dds::DomainParticipant*, - const rtps::SampleIdentity&, - const eprosima::fastcdr::string_255& topic, - const eprosima::fastrtps::types::TypeIdentifier*, - const eprosima::fastrtps::types::TypeObject*, - eprosima::fastrtps::types::DynamicType_ptr dyn_type) -{ - if (!parent_->using_typelookup_ || parent_->tls_callback_called_) - { - std::cout << "Discovered type: " << dyn_type->get_name() << " on topic: " << topic << std::endl; - std::lock_guard lock(parent_->mtx_type_discovery_); - discovered_ = true; - parent_->disc_type_ = dyn_type; - parent_->cv_type_discovery_.notify_one(); - } -} - -void TestSubscriber::PartListener::on_type_information_received( - eprosima::fastdds::dds::DomainParticipant*, - const eprosima::fastcdr::string_255 topic_name, - const eprosima::fastcdr::string_255 type_name, - const eprosima::fastrtps::types::TypeInformation& type_information) -{ - std::function callback = - [this, topic_name](const std::string&, const types::DynamicType_ptr type) - { - std::cout << "Callback for type: " << type->get_name() << " on topic: " << topic_name << std::endl; - parent_->tls_callback_called_ = true; - on_type_discovery(nullptr, rtps::SampleIdentity(), topic_name, nullptr, nullptr, type); - parent_->tls_callback_called_ = false; - }; - - std::cout << "Received type information: " << type_name << " on topic: " << topic_name << std::endl; - parent_->mp_participant->register_remote_type(type_information, type_name.to_string(), callback); -} - -DataReader* TestSubscriber::create_datareader() -{ - assert (topic_ == nullptr); - assert (mp_subscriber == nullptr); - - //CREATE THE TOPIC - topic_ = mp_participant->create_topic( - topic_name_, - disc_type_->get_name(), - TOPIC_QOS_DEFAULT); - - if (topic_ == nullptr) - { - return nullptr; - } - - mp_subscriber = mp_participant->create_subscriber(SUBSCRIBER_QOS_DEFAULT, nullptr); - - if (mp_subscriber == nullptr) - { - return nullptr; - } - - reader_qos = mp_subscriber->get_default_datareader_qos(); - if (typeConsistencyQos_ != nullptr) - { - reader_qos.type_consistency().type_consistency = *typeConsistencyQos_; - } - if (dataRepresentationQos_ != nullptr) - { - reader_qos.type_consistency().representation = *dataRepresentationQos_; - } - reader_ = mp_subscriber->create_datareader(topic_, reader_qos, &m_subListener); - return reader_; -} - -void TestSubscriber::delete_datareader( - eprosima::fastdds::dds::DataReader* reader) -{ - mp_subscriber->delete_datareader(reader); -} - -bool TestSubscriber::register_discovered_type() -{ - TypeSupport type(disc_type_); - type->auto_fill_type_object(true); - type->auto_fill_type_information(true); - return type.register_type(mp_participant, disc_type_->get_name()) == ReturnCode_t::RETCODE_OK; -} - -void TestSubscriber::run() -{ - std::cout << m_Name << " running..." << std::endl; - std::cin.ignore(); -} diff --git a/test/xtypes/TestSubscriber.h b/test/xtypes/TestSubscriber.h deleted file mode 100644 index ae6603b3c33..00000000000 --- a/test/xtypes/TestSubscriber.h +++ /dev/null @@ -1,188 +0,0 @@ -// 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 TestSubscriber.h - * - */ - -#ifndef _TEST_SUBSCRIBER_H_ -#define _TEST_SUBSCRIBER_H_ - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -class TestSubscriber -{ -public: - - TestSubscriber(); - - virtual ~TestSubscriber(); - - //!Initialize the subscriber - bool init( - const std::string& topicName, - int domain, - eprosima::fastdds::dds::TypeSupport type, - const eprosima::fastrtps::types::TypeObject* type_object, - const eprosima::fastrtps::types::TypeIdentifier* type_identifier, - const eprosima::fastrtps::types::TypeInformation* type_info, - const std::string& name, - const eprosima::fastdds::dds::DataRepresentationQosPolicy* dataRepresentationQos, - const eprosima::fastdds::dds::TypeConsistencyEnforcementQosPolicy* typeConsistencyQos, - bool use_typelookup = false); - - //!RUN the subscriber - void run(); - - // Auxiliar test methods - bool isInitialized() const - { - return m_bInitialized; - } - - void waitDiscovery( - bool expectMatch = true, - int maxWait = 10); - void waitTypeDiscovery( - bool expectMatch = true, - int maxWait = 10); - void matched( - bool unmatched = false); - bool isMatched() - { - return m_subListener.n_matched > 0; - } - - uint32_t samplesReceived() - { - return m_subListener.n_samples; - } - - eprosima::fastrtps::types::DynamicType_ptr discovered_type() const - { - return disc_type_; - } - - bool register_discovered_type(); - - eprosima::fastdds::dds::DataReader* create_datareader(); - - void delete_datareader( - eprosima::fastdds::dds::DataReader* reader); - - eprosima::fastdds::dds::TypeSupport m_Type; - -private: - - std::string m_Name; - - eprosima::fastdds::dds::DomainParticipant* mp_participant; - eprosima::fastdds::dds::Subscriber* mp_subscriber; - eprosima::fastdds::dds::DataReader* reader_; - eprosima::fastdds::dds::Topic* topic_; - void* m_Data; - bool m_bInitialized; - std::mutex m_mDiscovery; - std::mutex mtx_type_discovery_; - std::condition_variable m_cvDiscovery; - std::condition_variable cv_type_discovery_; - std::condition_variable cv_; - eprosima::fastrtps::types::DynamicType_ptr disc_type_; - eprosima::fastdds::dds::DataReaderQos reader_qos; - bool using_typelookup_; - bool tls_callback_called_; - std::string topic_name_; - const eprosima::fastdds::dds::DataRepresentationQosPolicy* dataRepresentationQos_; - const eprosima::fastdds::dds::TypeConsistencyEnforcementQosPolicy* typeConsistencyQos_; - -public: - - class PartListener : public eprosima::fastdds::dds::DomainParticipantListener - { - public: - - PartListener( - TestSubscriber* parent) - : parent_(parent) - , discovered_(false) - { - } - - ~PartListener() override - { - } - - void on_type_discovery( - eprosima::fastdds::dds::DomainParticipant* participant, - const eprosima::fastrtps::rtps::SampleIdentity& request_sample_id, - const eprosima::fastcdr::string_255& topic, - const eprosima::fastrtps::types::TypeIdentifier* identifier, - const eprosima::fastrtps::types::TypeObject* object, - eprosima::fastrtps::types::DynamicType_ptr dyn_type) override; - - void on_type_information_received( - eprosima::fastdds::dds::DomainParticipant* participant, - const eprosima::fastcdr::string_255 topic_name, - const eprosima::fastcdr::string_255 type_name, - const eprosima::fastrtps::types::TypeInformation& type_information) override; - - TestSubscriber* parent_; - std::atomic discovered_; - - } - part_listener_; - - class SubListener : public eprosima::fastdds::dds::DataReaderListener - { - public: - - SubListener() - { - } - - SubListener( - TestSubscriber* parent); - - ~SubListener() override - { - } - - void on_subscription_matched( - eprosima::fastdds::dds::DataReader* reader, - const eprosima::fastdds::dds::SubscriptionMatchedStatus& info) override; - - void on_data_available( - eprosima::fastdds::dds::DataReader* reader) override; - - TestSubscriber* mParent; - int n_matched; - uint32_t n_samples; - } - m_subListener; -}; - -#endif /* _TEST_SUBSCRIBER_H_ */ diff --git a/test/xtypes/XTypesTests.cpp b/test/xtypes/XTypesTests.cpp deleted file mode 100644 index eef8b80109d..00000000000 --- a/test/xtypes/XTypesTests.cpp +++ /dev/null @@ -1,1682 +0,0 @@ -// 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. - -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#define GET_PID _getpid -#include -#else -#define GET_PID getpid -#include -#include -#endif // if defined(_WIN32) - -#include -#include -#include -#include -#include - -#include "idl/TypesPubSubTypes.h" -#include "idl/TypesTypeObject.h" -#include "TestPublisher.h" -#include "TestSubscriber.h" - -using namespace eprosima::fastdds::dds; -using namespace eprosima::fastrtps::rtps; - -static int DOMAIN_ID_ = 10; - -// TODO - Remove DISABLED when XTYPES are implemented. - -class xtypestests : public ::testing::Test -{ -public: - - xtypestests() - { - //Log::SetVerbosity(eprosima::fastdds::dds::Log::Info); - //Log::SetCategoryFilter(std::regex("(SECURITY)")); - - DOMAIN_ID_ = static_cast(GET_PID()) % 230; - registerTypesTypes(); - } - - ~xtypestests() - { - //Log::Reset(); - eprosima::fastdds::dds::Log::KillThread(); - ++DOMAIN_ID_; - DOMAIN_ID_ %= 230; - } - -}; - -/**** NO TYPE OBJECT ****/ - -/* - * Both endpoints share the same type without DataRepresentationQos, so they must match. - * This represents classical match. - */ -TEST_F(xtypestests, NoTypeObjectSameType) -{ - TypeSupport type(new BasicStructPubSubType()); - TestPublisher pub; - TestSubscriber sub; - - ASSERT_TRUE(type != nullptr); - ASSERT_FALSE(type == nullptr); - - pub.init("NoTypeObjectSameType", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Pub1", nullptr); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("NoTypeObjectSameType", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Sub1", nullptr, nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/* - * Both endpoints share the same type without DataRepresentationQosm, but they force type validation, - * so they must not match. - */ -TEST_F(xtypestests, NoTypeObjectSameTypeForce) -{ - TypeSupport type(new BasicStructPubSubType()); - TestPublisher pub; - TestSubscriber sub; - - TypeConsistencyEnforcementQosPolicy typeConQos; - //typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - typeConQos.m_force_type_validation = true; - - pub.init("NoTypeObjectSameTypeForce", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Pub1", nullptr); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("NoTypeObjectSameTypeForce", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Sub1", nullptr, - &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * The endpoints have different types without DataRepresentationQos, so they must not match. - * This represents classical mismatch. - */ -TEST_F(xtypestests, NoTypeObjectDifferentType) -{ - TypeSupport type(new BasicStructPubSubType()); - TypeSupport type2(new BasicNamesStructPubSubType()); - TestPublisher pub; - TestSubscriber sub; - - pub.init("NoTypeObjectDifferentType", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Pub1", nullptr); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("NoTypeObjectDifferentType", DOMAIN_ID_, type2, nullptr, nullptr, nullptr, "Sub1", nullptr, - nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/**** TYPE OBJECT V1 ****/ - -/* - * Both endpoints share the same type using XCDR1 so they must match. - * This represents classical match. - */ -TEST_F(xtypestests, TypeObjectV1SameType) -{ - TypeSupport type(new BasicStructPubSubType()); - const TypeObject* type_obj = GetMinimalBasicStructObject(); - const TypeIdentifier* type_id = GetBasicStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - //TypeConsistencyEnforcementQosPolicy typeConQos; - //typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1SameType", DOMAIN_ID_, type, type_obj, type_id, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1SameType", DOMAIN_ID_, type, type_obj, type_id, nullptr, "Sub1", &dataRepQos, - nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 30); - pub.waitDiscovery(true, 30); -} - -/* - * TEST TYPE DISCOVERY - * RETRIEVE PUB's TYPE - */ -TEST_F(xtypestests, TypeDiscoverySubs) -{ - TypeSupport type(new BasicStructPubSubType()); - const TypeObject* type_obj = GetCompleteBasicStructObject(); - const TypeIdentifier* type_id = GetBasicStructIdentifier(true); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - //TypeConsistencyEnforcementQosPolicy typeConQos; - //typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeDiscoverySubs", DOMAIN_ID_, type, type_obj, type_id, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeDiscoverySubs", DOMAIN_ID_, TypeSupport( - nullptr), nullptr, nullptr, nullptr, "Sub1", &dataRepQos, nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitTypeDiscovery(true, 3); - - eprosima::fastrtps::types::DynamicType_ptr disc_type = sub.discovered_type(); - ASSERT_TRUE(disc_type != nullptr); - - sub.register_discovered_type(); - sub.create_datareader(); - - pub.waitDiscovery(true, 3); - sub.waitDiscovery(true, 3); -} - -/* - * TEST TYPE DISCOVERY - * RETRIEVE SUB's TYPE - */ -TEST_F(xtypestests, TypeDiscoveryPubs) -{ - TypeSupport type(new BasicStructPubSubType()); - const TypeObject* type_obj = GetCompleteBasicStructObject(); - const TypeIdentifier* type_id = GetBasicStructIdentifier(true); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - //TypeConsistencyEnforcementQosPolicy typeConQos; - //typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeDiscoveryPubs", DOMAIN_ID_, TypeSupport(nullptr), nullptr, nullptr, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeDiscoveryPubs", DOMAIN_ID_, type, type_obj, type_id, nullptr, "Sub1", &dataRepQos, nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - pub.waitTypeDiscovery(true, 3); - - eprosima::fastrtps::types::DynamicType_ptr disc_type = pub.discovered_type(); - ASSERT_TRUE(disc_type != nullptr); - - pub.register_discovered_type(); - DataWriter* writer = pub.create_datawriter(); - - pub.waitDiscovery(true, 3); - sub.waitDiscovery(true, 3); - - writer->set_listener(nullptr); - pub.delete_datawriter(writer); -} - -/* - * Both endpoints different types using XCDR1 so they must not match even with full coercion allowed. - */ -TEST_F(xtypestests, TypeObjectV1DifferentType) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BasicBadStructPubSubType()); - const TypeObject* type_obj1 = GetMinimalBasicStructObject(); - const TypeIdentifier* type_id1 = GetBasicStructIdentifier(false); - const TypeObject* type_obj2 = GetMinimalBasicBadStructObject(); - const TypeIdentifier* type_id2 = GetBasicBadStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - typeConQos.m_ignore_sequence_bounds = true; - typeConQos.m_ignore_string_bounds = true; - typeConQos.m_ignore_member_names = true; - typeConQos.m_prevent_type_widening = false; - typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1DifferentType", DOMAIN_ID_, type1, type_obj1, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1DifferentType", DOMAIN_ID_, type2, type_obj2, type_id2, nullptr, "Sub1", &dataRepQos, - &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * BasicStruct and BasicNamesStruct are similar structures, but with different names in members. - * This test checks failure at the member names through TypeIdentifier's hashes. The endpoints must not match. - */ -TEST_F(xtypestests, TypeObjectV1NamesManaged) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BasicNamesStructPubSubType()); - const TypeObject* type_obj1 = GetMinimalBasicStructObject(); - const TypeIdentifier* type_id1 = GetBasicStructIdentifier(false); - const TypeObject* type_obj2 = GetMinimalBasicNamesStructObject(); - const TypeIdentifier* type_id2 = GetBasicNamesStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - typeConQos.m_ignore_member_names = false; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1NamesManaged", DOMAIN_ID_, type1, type_obj1, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1NamesManaged", DOMAIN_ID_, type2, type_obj2, type_id2, nullptr, "Sub1", &dataRepQos, - &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * BasicStruct and BasicNamesStruct are similar structures, but with different names in struct and members. - * This test checks ignoring at the member names through TypeIdentifier's hashes. The endpoints must match. - */ -TEST_F(xtypestests, DISABLED_TypeObjectV1NamesIgnored) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BasicNamesStructPubSubType()); - const TypeObject* type_obj1 = GetMinimalBasicStructObject(); - const TypeIdentifier* type_id1 = GetBasicStructIdentifier(false); - const TypeObject* type_obj2 = GetMinimalBasicNamesStructObject(); - const TypeIdentifier* type_id2 = GetBasicNamesStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1NamesIgnored", DOMAIN_ID_, type1, type_obj1, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1NamesIgnored", DOMAIN_ID_, type2, type_obj2, type_id2, nullptr, "Sub1", &dataRepQos, - &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/* - * BasicStruct and BasicNamesStruct are similar structures, but with different names in struct and members. - * This test checks ignoring at the member names when disallowed type coercion has no effect. - * The endpoints must not match. - */ -TEST_F(xtypestests, TypeObjectV1NamesIgnoredDisallow) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BasicNamesStructPubSubType()); - const TypeObject* type_obj1 = GetMinimalBasicStructObject(); - const TypeIdentifier* type_id1 = GetBasicStructIdentifier(false); - const TypeObject* type_obj2 = GetMinimalBasicNamesStructObject(); - const TypeIdentifier* type_id2 = GetBasicNamesStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - //typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1NamesIgnoredDisallow", DOMAIN_ID_, type1, type_obj1, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1NamesIgnoredDisallow", DOMAIN_ID_, type2, type_obj2, type_id2, nullptr, "Sub1", - &dataRepQos, &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * BasicStruct and BasicWideStruct are similar structures, but with "Wide" adds a member. - * This test checks type widening. The endpoints must match. - */ -TEST_F(xtypestests, DISABLED_TypeObjectV1TypeWidening) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BasicWideStructPubSubType()); - const TypeObject* type_obj1 = GetMinimalBasicStructObject(); - const TypeIdentifier* type_id1 = GetBasicStructIdentifier(false); - const TypeObject* type_obj2 = GetMinimalBasicWideStructObject(); - const TypeIdentifier* type_id2 = GetBasicWideStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1TypeWidening", DOMAIN_ID_, type1, type_obj1, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1TypeWidening", DOMAIN_ID_, type2, type_obj2, type_id2, nullptr, "Sub1", &dataRepQos, - &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/* - * BasicStruct and BadBasicWideStruct are similar structures, but with "Wide" adds a member, and in this case - * modifies the type of other member. The endpoints must not match. - */ -TEST_F(xtypestests, TypeObjectV1BadTypeWidening) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BadBasicWideStructPubSubType()); - const TypeObject* type_obj1 = GetMinimalBasicStructObject(); - const TypeIdentifier* type_id1 = GetBasicStructIdentifier(false); - const TypeObject* type_obj2 = GetMinimalBadBasicWideStructObject(); - const TypeIdentifier* type_id2 = GetBadBasicWideStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1BadTypeWidening", DOMAIN_ID_, type1, type_obj1, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1BadTypeWidening", DOMAIN_ID_, type2, type_obj2, type_id2, nullptr, "Sub1", - &dataRepQos, &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * BasicStruct and BasicWideStruct are similar structures, but with "Wide" adds a member. - * This test checks prevent type widening when assigning narrow to wide. The endpoints must match. - */ -TEST_F(xtypestests, DISABLED_TypeObjectV1TypeWideningPreventedNarrowToWide) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BasicWideStructPubSubType()); - const TypeObject* type_obj1 = GetMinimalBasicStructObject(); - const TypeIdentifier* type_id1 = GetBasicStructIdentifier(false); - const TypeObject* type_obj2 = GetMinimalBasicWideStructObject(); - const TypeIdentifier* type_id2 = GetBasicWideStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - typeConQos.m_prevent_type_widening = true; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1TypeWideningPreventedNarrowToWide", DOMAIN_ID_, type1, type_obj1, type_id1, nullptr, "Pub1", - &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1TypeWideningPreventedNarrowToWide", DOMAIN_ID_, type2, type_obj2, type_id2, nullptr, - "Sub1", &dataRepQos, &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/* - * BasicStruct and BasicWideStruct are similar structures, but with "Wide" adds a member. - * This test checks prevent type widening when assining from wide to narrow. The endpoints must not match. - */ -TEST_F(xtypestests, TypeObjectV1TypeWideningPreventedWideToNarrow) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BasicWideStructPubSubType()); - const TypeObject* type_obj1 = GetMinimalBasicStructObject(); - const TypeIdentifier* type_id1 = GetBasicStructIdentifier(false); - const TypeObject* type_obj2 = GetMinimalBasicWideStructObject(); - const TypeIdentifier* type_id2 = GetBasicWideStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - typeConQos.m_prevent_type_widening = true; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1TypeWideningPreventedWideToNarrow", DOMAIN_ID_, type2, type_obj2, type_id2, nullptr, "Pub1", - &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1TypeWideningPreventedWideToNarrow", DOMAIN_ID_, type1, type_obj1, type_id1, nullptr, - "Sub1", &dataRepQos, &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * BasicStruct and BasicWideStruct are similar structures, but with "Wide" adds a member, but coercion is disallowed. - * This test checks type widening. The endpoints must match. - */ -TEST_F(xtypestests, TypeObjectV1TypeWideningDisallow) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BasicWideStructPubSubType()); - const TypeObject* type_obj1 = GetMinimalBasicStructObject(); - const TypeIdentifier* type_id1 = GetBasicStructIdentifier(false); - const TypeObject* type_obj2 = GetMinimalBasicWideStructObject(); - const TypeIdentifier* type_id2 = GetBasicWideStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - //typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1TypeWideningDisallow", DOMAIN_ID_, type1, type_obj1, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1TypeWideningDisallow", DOMAIN_ID_, type2, type_obj2, type_id2, nullptr, "Sub1", - &dataRepQos, &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * SequenceStruct and SequenceBoundsStruct are similar structures, but with "Bounds" the size of the sequence is bigger. - * This test checks sequence bounds. The endpoints must match. - */ -TEST_F(xtypestests, DISABLED_TypeObjectV1SequenceBoundsIgnored) -{ - TypeSupport type1(new SequenceStructPubSubType()); - TypeSupport type2(new SequenceBoundsStructPubSubType()); - const TypeObject* type_obj1 = GetMinimalSequenceStructObject(); - const TypeIdentifier* type_id1 = GetSequenceStructIdentifier(false); - const TypeObject* type_obj2 = GetMinimalSequenceBoundsStructObject(); - const TypeIdentifier* type_id2 = GetSequenceBoundsStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1SequenceBoundsIgnored", DOMAIN_ID_, type1, type_obj1, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1SequenceBoundsIgnored", DOMAIN_ID_, type2, type_obj2, type_id2, nullptr, "Sub1", - &dataRepQos, &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/* - * SequenceStruct and SequenceBoundsStruct are similar structures, but with "Bounds" the size of the sequence is bigger. - * This test checks sequence bounds. The endpoints must not match. - */ -TEST_F(xtypestests, TypeObjectV1SequenceBoundsManaged) -{ - TypeSupport type1(new SequenceStructPubSubType()); - TypeSupport type2(new SequenceBoundsStructPubSubType()); - const TypeObject* type_obj1 = GetMinimalSequenceStructObject(); - const TypeIdentifier* type_id1 = GetSequenceStructIdentifier(false); - const TypeObject* type_obj2 = GetMinimalSequenceBoundsStructObject(); - const TypeIdentifier* type_id2 = GetSequenceBoundsStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - typeConQos.m_ignore_sequence_bounds = false; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1SequenceBoundsManaged", DOMAIN_ID_, type1, type_obj1, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1SequenceBoundsManaged", DOMAIN_ID_, type2, type_obj2, type_id2, nullptr, "Sub1", - &dataRepQos, &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * StringStruct and LargeStringStruct are similar structures, but with "Large" the size of the string is bigger. - * Names are ignored because the member is named different. - * This test checks string bounds. The endpoints must match. - */ -TEST_F(xtypestests, DISABLED_TypeObjectV1LargeStringIgnored) -{ - TypeSupport type1(new StringStructPubSubType()); - TypeSupport type2(new LargeStringStructPubSubType()); - const TypeObject* type_obj1 = GetMinimalStringStructObject(); - const TypeIdentifier* type_id1 = GetStringStructIdentifier(false); - const TypeObject* type_obj2 = GetMinimalLargeStringStructObject(); - const TypeIdentifier* type_id2 = GetLargeStringStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - typeConQos.m_ignore_string_bounds = true; - typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1LargeStringIgnored", DOMAIN_ID_, type1, type_obj1, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1LargeStringIgnored", DOMAIN_ID_, type2, type_obj2, type_id2, nullptr, "Sub1", - &dataRepQos, &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/* - * StringStruct and LargeStringStruct are similar structures, but with "Large" the size of the string is bigger. - * Names are ignored because the member is named different. - * This test checks string bounds. The endpoints must not match. - */ -TEST_F(xtypestests, TypeObjectV1LargeStringManaged) -{ - TypeSupport type1(new StringStructPubSubType()); - TypeSupport type2(new LargeStringStructPubSubType()); - const TypeObject* type_obj1 = GetMinimalStringStructObject(); - const TypeIdentifier* type_id1 = GetStringStructIdentifier(false); - const TypeObject* type_obj2 = GetMinimalLargeStringStructObject(); - const TypeIdentifier* type_id2 = GetLargeStringStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = false; - typeConQos.m_ignore_string_bounds = false; - typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1LargeStringManaged", DOMAIN_ID_, type1, type_obj1, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1LargeStringManaged", DOMAIN_ID_, type2, type_obj2, type_id2, nullptr, "Sub1", - &dataRepQos, &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * Both endpoints share the same type using XCDR1 so they must match, in this case using Complete. - */ -TEST_F(xtypestests, TypeObjectV1SameTypeComplete) -{ - TypeSupport type(new BasicStructPubSubType()); - const TypeObject* type_obj = GetCompleteBasicStructObject(); - const TypeIdentifier* type_id = GetBasicStructIdentifier(true); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - //TypeConsistencyEnforcementQosPolicy typeConQos; - //typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1SameTypeComplete", DOMAIN_ID_, type, type_obj, type_id, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1SameTypeComplete", DOMAIN_ID_, type, type_obj, type_id, nullptr, "Sub1", &dataRepQos, - nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/* - * Both endpoints use compatible but different types using XCDR1 but without coercion so they must not match, - * in this case using Complete. - */ -TEST_F(xtypestests, TypeObjectV1InvalidComplete) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BasicNamesStructPubSubType()); - const TypeObject* type_obj1 = GetCompleteBasicStructObject(); - const TypeIdentifier* type_id1 = GetBasicStructIdentifier(true); - const TypeObject* type_obj2 = GetCompleteBasicNamesStructObject(); - const TypeIdentifier* type_id2 = GetBasicNamesStructIdentifier(true); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - //TypeConsistencyEnforcementQosPolicy typeConQos; - //typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeObjectV1InvalidComplete", DOMAIN_ID_, type1, type_obj1, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObjectV1InvalidComplete", DOMAIN_ID_, type2, type_obj2, type_id2, nullptr, "Sub1", - &dataRepQos, nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * Both endpoints the same type using XCDR1 but one using minimal and the other complete. - * They shouldn't match. - */ -TEST_F(xtypestests, MixingMinimalAndComplete) -{ - TypeSupport type1(new BasicStructPubSubType()); - const TypeObject* type_obj1 = GetMinimalBasicStructObject(); - const TypeIdentifier* type_id1 = GetBasicStructIdentifier(false); - const TypeObject* type_obj2 = GetCompleteBasicStructObject(); - const TypeIdentifier* type_id2 = GetBasicStructIdentifier(true); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - //TypeConsistencyEnforcementQosPolicy typeConQos; - //typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("MixingMinimalAndComplete", DOMAIN_ID_, type1, type_obj1, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("MixingMinimalAndComplete", DOMAIN_ID_, type1, type_obj2, type_id2, nullptr, "Sub1", &dataRepQos, - nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/**** TYPE IDENTIFIER ****/ - -/* - * Both endpoints share the same type using XCDR1 so they must match. - * This represents classical match. - */ -TEST_F(xtypestests, TypeIdentifierSameType) -{ - TypeSupport type(new BasicStructPubSubType()); - const TypeIdentifier* type_id = GetBasicStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - //TypeConsistencyEnforcementQosPolicy typeConQos; - //typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeIdentifierSameType", DOMAIN_ID_, type, nullptr, type_id, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeIdentifierSameType", DOMAIN_ID_, type, nullptr, type_id, nullptr, "Sub1", &dataRepQos, - nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/* - * Both endpoints different types using XCDR1 so they must not match even with full coercion allowed. - */ -TEST_F(xtypestests, TypeIdentifierDifferentType) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BasicBadStructPubSubType()); - const TypeIdentifier* type_id1 = GetBasicStructIdentifier(false); - const TypeIdentifier* type_id2 = GetBasicBadStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - typeConQos.m_ignore_sequence_bounds = true; - typeConQos.m_ignore_string_bounds = true; - typeConQos.m_ignore_member_names = true; - typeConQos.m_prevent_type_widening = false; - typeConQos.m_force_type_validation = false; - - pub.init("TypeIdentifierDifferentType", DOMAIN_ID_, type1, nullptr, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeIdentifierDifferentType", DOMAIN_ID_, type2, nullptr, type_id2, nullptr, "Sub1", &dataRepQos, - &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * BasicStruct and BasicNamesStruct are similar structures, but with different names in members. - * This test checks failure at the member names through TypeIdentifier's hashes. The endpoints must not match. - */ -TEST_F(xtypestests, TypeIdentifierNamesManaged) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BasicNamesStructPubSubType()); - const TypeIdentifier* type_id1 = GetBasicStructIdentifier(false); - const TypeIdentifier* type_id2 = GetBasicNamesStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - typeConQos.m_ignore_member_names = false; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeIdentifierNamesManaged", DOMAIN_ID_, type1, nullptr, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeIdentifierNamesManaged", DOMAIN_ID_, type2, nullptr, type_id2, nullptr, "Sub1", &dataRepQos, - &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * BasicStruct and BasicNamesStruct are similar structures, but with different names in struct and members. - * This test checks ignoring at the member names through TypeIdentifier's hashes. The endpoints must match. - */ -TEST_F(xtypestests, DISABLED_TypeIdentifierNamesIgnored) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BasicNamesStructPubSubType()); - const TypeIdentifier* type_id1 = GetBasicStructIdentifier(false); - const TypeIdentifier* type_id2 = GetBasicNamesStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeIdentifierNamesIgnored", DOMAIN_ID_, type1, nullptr, type_id1, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeIdentifierNamesIgnored", DOMAIN_ID_, type2, nullptr, type_id2, nullptr, "Sub1", &dataRepQos, - &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/**** TYPE INFORMATION ****/ - -/* - * Both endpoints share the same type using XCDR1 so they must match. - * This represents classical match. - */ -TEST_F(xtypestests, TypeInformationSameType) -{ - TypeSupport type(new BasicStructPubSubType()); - const TypeInformation* type_info = TypeObjectFactory::get_instance()->get_type_information("BasicStruct"); - TestPublisher pub; - TestSubscriber sub; - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - //TypeConsistencyEnforcementQosPolicy typeConQos; - //typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - //typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeInformationSameType", DOMAIN_ID_, type, nullptr, nullptr, type_info, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeInformationSameType", DOMAIN_ID_, type, nullptr, nullptr, type_info, "Sub1", &dataRepQos, - nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/* - * Both endpoints different types using XCDR1 so they must not match even with full coercion allowed. - */ -TEST_F(xtypestests, TypeInformationDifferentType) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BasicBadStructPubSubType()); - const TypeInformation* type_info1 = TypeObjectFactory::get_instance()->get_type_information("BasicStruct"); - const TypeInformation* type_info2 = TypeObjectFactory::get_instance()->get_type_information("BasicBadStruct"); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - typeConQos.m_ignore_sequence_bounds = true; - typeConQos.m_ignore_string_bounds = true; - typeConQos.m_ignore_member_names = true; - typeConQos.m_prevent_type_widening = false; - typeConQos.m_force_type_validation = false; - - pub.init("TypeInformationDifferentType", DOMAIN_ID_, type1, nullptr, nullptr, type_info1, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeInformationDifferentType", DOMAIN_ID_, type2, nullptr, nullptr, type_info2, "Sub1", - &dataRepQos, &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * BasicStruct and BasicNamesStruct are similar structures, but with different names in members. - * This test checks failure at the member names through TypeInformation's hashes. The endpoints must not match. - */ -TEST_F(xtypestests, TypeInformationNamesManaged) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BasicNamesStructPubSubType()); - const TypeInformation* type_info1 = TypeObjectFactory::get_instance()->get_type_information("BasicStruct"); - const TypeInformation* type_info2 = TypeObjectFactory::get_instance()->get_type_information("BasicNamesStruct"); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - typeConQos.m_ignore_member_names = false; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeInformationNamesManaged", DOMAIN_ID_, type1, nullptr, nullptr, type_info1, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeInformationNamesManaged", DOMAIN_ID_, type2, nullptr, nullptr, type_info2, "Sub1", - &dataRepQos, &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * BasicStruct and BasicNamesStruct are similar structures, but with different names in struct and members. - * This test checks ignoring at the member names through TypeInformation's hashes. The endpoints must match. - */ -TEST_F(xtypestests, DISABLED_TypeInformationNamesIgnored) -{ - TypeSupport type1(new BasicStructPubSubType()); - TypeSupport type2(new BasicNamesStructPubSubType()); - const TypeInformation* type_info1 = TypeObjectFactory::get_instance()->get_type_information("BasicStruct"); - const TypeInformation* type_info2 = TypeObjectFactory::get_instance()->get_type_information("BasicNamesStruct"); - TestPublisher pub; - TestSubscriber sub; - //TypeInformation* type_info = nullptr; // Not using it - - DataRepresentationQosPolicy dataRepQos; - dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - //typeConQos.m_kind = TypeConsistencyKind::DISALLOW_TYPE_COERCION; - //typeConQos.m_ignore_sequence_bounds = true; - //typeConQos.m_ignore_string_bounds = true; - typeConQos.m_ignore_member_names = true; - //typeConQos.m_prevent_type_widening = false; - //typeConQos.m_force_type_validation = false; - - pub.init("TypeInformationNamesIgnored", DOMAIN_ID_, type1, nullptr, nullptr, type_info1, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeInformationNamesIgnored", DOMAIN_ID_, type2, nullptr, nullptr, type_info2, "Sub1", - &dataRepQos, &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/**** Mixing TypeObject, TypeInformation and TypeIdentifier ****/ - -TEST_F(xtypestests, TypeIdentifier_TypeObject) -{ - TypeSupport type(new BasicStructPubSubType()); - TypeSupport type1(new BasicStructPubSubType()); - const TypeObject* type_obj = GetMinimalBasicStructObject(); - const TypeIdentifier* type_id = GetBasicStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - typeConQos.m_force_type_validation = true; - - pub.init("TypeIdentifier_TypeObject", DOMAIN_ID_, type, nullptr, type_id, nullptr, "Pub1", nullptr); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeIdentifier_TypeObject", DOMAIN_ID_, type1, type_obj, nullptr, nullptr, "Sub1", nullptr, - &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -TEST_F(xtypestests, TypeIdentifier_TypeInformation) -{ - TypeSupport type(new BasicStructPubSubType()); - TypeSupport type1(new BasicStructPubSubType()); - const TypeIdentifier* type_id = GetBasicStructIdentifier(false); - TestPublisher pub; - TestSubscriber sub; - const TypeInformation* type_info = TypeObjectFactory::get_instance()->get_type_information("BasicStruct"); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - typeConQos.m_force_type_validation = true; - - pub.init("TypeIdentifier_TypeInformation", DOMAIN_ID_, type, nullptr, type_id, nullptr, "Pub1", nullptr); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeIdentifier_TypeInformation", DOMAIN_ID_, type1, nullptr, nullptr, type_info, "Sub1", nullptr, - &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -TEST_F(xtypestests, TypeObject_TypeInformation) -{ - TypeSupport type(new BasicStructPubSubType()); - TypeSupport type1(new BasicStructPubSubType()); - const TypeObject* type_obj = GetMinimalBasicStructObject(); - TestPublisher pub; - TestSubscriber sub; - const TypeInformation* type_info = TypeObjectFactory::get_instance()->get_type_information("BasicStruct"); - - TypeConsistencyEnforcementQosPolicy typeConQos; - typeConQos.m_kind = TypeConsistencyKind::ALLOW_TYPE_COERCION; - typeConQos.m_force_type_validation = true; - - pub.init("TypeObject_TypeInformation", DOMAIN_ID_, type, type_obj, nullptr, nullptr, "Pub1", nullptr); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("TypeObject_TypeInformation", DOMAIN_ID_, type1, nullptr, nullptr, type_info, "Sub1", nullptr, - &typeConQos); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/**** TODO - Enable when implemented - DataRepresentation Compatibility tests ****/ - -/* - * Empty-Empty - */ -TEST_F(xtypestests, DISABLED_DataRepQoSEE) -{ - TypeSupport type(new BasicStructPubSubType()); - TestPublisher pub; - TestSubscriber sub; - - DataRepresentationQosPolicy dataRepQos; - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - pub.init("DataRepQoSEE", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Pub1", &dataRepQos); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("DataRepQoSEE", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Sub1", &dataRepQos, nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/* - * Empty-XCDR1 - */ -TEST_F(xtypestests, DISABLED_DataRepQoSE1) -{ - TypeSupport type(new BasicStructPubSubType()); - TestPublisher pub; - TestSubscriber sub; - - DataRepresentationQosPolicy dataRepQos1; - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - DataRepresentationQosPolicy dataRepQos2; - dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - pub.init("DataRepQoSE1", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Pub1", &dataRepQos1); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("DataRepQoSE1", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Sub1", &dataRepQos2, nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/* - * Empty-XCDR2 - */ -TEST_F(xtypestests, DISABLED_DataRepQoSE2) -{ - TypeSupport type(new BasicStructPubSubType()); - TestPublisher pub; - TestSubscriber sub; - - DataRepresentationQosPolicy dataRepQos1; - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - DataRepresentationQosPolicy dataRepQos2; - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - pub.init("DataRepQoSE2", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Pub1", &dataRepQos1); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("DataRepQoSE2", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Sub1", &dataRepQos2, nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/* - * Empty-XML - */ -TEST_F(xtypestests, DISABLED_DataRepQoSEX) -{ - TypeSupport type(new BasicStructPubSubType()); - TestPublisher pub; - TestSubscriber sub; - - DataRepresentationQosPolicy dataRepQos1; - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - DataRepresentationQosPolicy dataRepQos2; - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - dataRepQos2.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - pub.init("DataRepQoSEX", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Pub1", &dataRepQos1); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("DataRepQoSEX", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Sub1", &dataRepQos2, nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * Empty-XCDR12 - */ -TEST_F(xtypestests, DISABLED_DataRepQoSE12) -{ - TypeSupport type(new BasicStructPubSubType()); - TestPublisher pub; - TestSubscriber sub; - - DataRepresentationQosPolicy dataRepQos1; - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - DataRepresentationQosPolicy dataRepQos2; - dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - pub.init("DataRepQoSE12", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Pub1", &dataRepQos1); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("DataRepQoSE12", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Sub1", &dataRepQos2, nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/* - * XCDR1-XCDR2 - */ -TEST_F(xtypestests, DISABLED_DataRepQoS12) -{ - TypeSupport type(new BasicStructPubSubType()); - TestPublisher pub; - TestSubscriber sub; - - DataRepresentationQosPolicy dataRepQos1; - dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - DataRepresentationQosPolicy dataRepQos2; - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - pub.init("DataRepQoS12", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Pub1", &dataRepQos1); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("DataRepQoS12", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Sub1", &dataRepQos2, nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/* - * XCDR2-Empty - */ -TEST_F(xtypestests, DISABLED_DataRepQoS2E) -{ - TypeSupport type(new BasicStructPubSubType()); - TestPublisher pub; - TestSubscriber sub; - - DataRepresentationQosPolicy dataRepQos1; - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - DataRepresentationQosPolicy dataRepQos2; - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - pub.init("DataRepQoS21", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Pub1", &dataRepQos2); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("DataRepQoS21", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Sub1", &dataRepQos1, nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * XCDR2-XCDR1 - */ -TEST_F(xtypestests, DISABLED_DataRepQoS21) -{ - TypeSupport type(new BasicStructPubSubType()); - TestPublisher pub; - TestSubscriber sub; - - DataRepresentationQosPolicy dataRepQos1; - dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - DataRepresentationQosPolicy dataRepQos2; - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - pub.init("DataRepQoS21", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Pub1", &dataRepQos2); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("DataRepQoS21", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Sub1", &dataRepQos1, nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * XCDR2-XCDR2 - */ -TEST_F(xtypestests, DISABLED_DataRepQoS22) -{ - TypeSupport type(new BasicStructPubSubType()); - TestPublisher pub; - TestSubscriber sub; - - DataRepresentationQosPolicy dataRepQos2; - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - pub.init("DataRepQoS22", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Pub1", &dataRepQos2); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("DataRepQoS22", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Sub1", &dataRepQos2, nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(true, 3); - pub.waitDiscovery(true, 3); -} - -/* - * XML-Empty - */ -TEST_F(xtypestests, DISABLED_DataRepQoSXE) -{ - TypeSupport type(new BasicStructPubSubType()); - TestPublisher pub; - TestSubscriber sub; - - DataRepresentationQosPolicy dataRepQos1; - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - DataRepresentationQosPolicy dataRepQos2; - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - dataRepQos2.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - pub.init("DataRepQoSXE", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Pub1", &dataRepQos2); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("DataRepQoSXE", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Sub1", &dataRepQos1, nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -/* - * XML-XML - Fails until supported. - */ -TEST_F(xtypestests, DISABLED_DataRepQoSXX) -{ - TypeSupport type(new BasicStructPubSubType()); - TestPublisher pub; - TestSubscriber sub; - - DataRepresentationQosPolicy dataRepQos1; - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - dataRepQos1.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos1.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - DataRepresentationQosPolicy dataRepQos2; - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR_DATA_REPRESENTATION); - dataRepQos2.m_value.push_back(DataRepresentationId_t::XML_DATA_REPRESENTATION); - //dataRepQos2.m_value.push_back(DataRepresentationId_t::XCDR2_DATA_REPRESENTATION); - - pub.init("DataRepQoSXE", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Pub1", &dataRepQos2); - ASSERT_TRUE(pub.isInitialized()); - - sub.init("DataRepQoSXE", DOMAIN_ID_, type, nullptr, nullptr, nullptr, "Sub1", &dataRepQos1, nullptr); - ASSERT_TRUE(sub.isInitialized()); - - // Wait for discovery. - sub.waitDiscovery(false, 3); - pub.waitDiscovery(false, 3); -} - -int main( - int argc, - char** argv) -{ - testing::InitGoogleTest(&argc, argv); - - return RUN_ALL_TESTS(); -} diff --git a/test/xtypes/idl/Types.cxx b/test/xtypes/idl/Types.cxx deleted file mode 100644 index d0ee9153b8d..00000000000 --- a/test/xtypes/idl/Types.cxx +++ /dev/null @@ -1,5244 +0,0 @@ -// 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 Types.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Types.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#include "TypesTypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - - - - -MyEnumStruct::MyEnumStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MyEnumStruct::~MyEnumStruct() -{ -} - -MyEnumStruct::MyEnumStruct( - const MyEnumStruct& x) -{ - m_my_enum = x.m_my_enum; -} - -MyEnumStruct::MyEnumStruct( - MyEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; -} - -MyEnumStruct& MyEnumStruct::operator =( - const MyEnumStruct& x) -{ - - m_my_enum = x.m_my_enum; - return *this; -} - -MyEnumStruct& MyEnumStruct::operator =( - MyEnumStruct&& x) noexcept -{ - - m_my_enum = x.m_my_enum; - return *this; -} - -bool MyEnumStruct::operator ==( - const MyEnumStruct& x) const -{ - return (m_my_enum == x.m_my_enum); -} - -bool MyEnumStruct::operator !=( - const MyEnumStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ -void MyEnumStruct::my_enum( - MyEnum _my_enum) -{ - m_my_enum = _my_enum; -} - -/*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ -MyEnum MyEnumStruct::my_enum() const -{ - return m_my_enum; -} - -/*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ -MyEnum& MyEnumStruct::my_enum() -{ - return m_my_enum; -} - - - - -MyBadEnumStruct::MyBadEnumStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MyBadEnumStruct::~MyBadEnumStruct() -{ -} - -MyBadEnumStruct::MyBadEnumStruct( - const MyBadEnumStruct& x) -{ - m_my_enum = x.m_my_enum; -} - -MyBadEnumStruct::MyBadEnumStruct( - MyBadEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; -} - -MyBadEnumStruct& MyBadEnumStruct::operator =( - const MyBadEnumStruct& x) -{ - - m_my_enum = x.m_my_enum; - return *this; -} - -MyBadEnumStruct& MyBadEnumStruct::operator =( - MyBadEnumStruct&& x) noexcept -{ - - m_my_enum = x.m_my_enum; - return *this; -} - -bool MyBadEnumStruct::operator ==( - const MyBadEnumStruct& x) const -{ - return (m_my_enum == x.m_my_enum); -} - -bool MyBadEnumStruct::operator !=( - const MyBadEnumStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ -void MyBadEnumStruct::my_enum( - MyBadEnum _my_enum) -{ - m_my_enum = _my_enum; -} - -/*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ -MyBadEnum MyBadEnumStruct::my_enum() const -{ - return m_my_enum; -} - -/*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ -MyBadEnum& MyBadEnumStruct::my_enum() -{ - return m_my_enum; -} - - - - - -MyAliasEnumStruct::MyAliasEnumStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MyAliasEnumStruct::~MyAliasEnumStruct() -{ -} - -MyAliasEnumStruct::MyAliasEnumStruct( - const MyAliasEnumStruct& x) -{ - m_my_enum = x.m_my_enum; -} - -MyAliasEnumStruct::MyAliasEnumStruct( - MyAliasEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; -} - -MyAliasEnumStruct& MyAliasEnumStruct::operator =( - const MyAliasEnumStruct& x) -{ - - m_my_enum = x.m_my_enum; - return *this; -} - -MyAliasEnumStruct& MyAliasEnumStruct::operator =( - MyAliasEnumStruct&& x) noexcept -{ - - m_my_enum = x.m_my_enum; - return *this; -} - -bool MyAliasEnumStruct::operator ==( - const MyAliasEnumStruct& x) const -{ - return (m_my_enum == x.m_my_enum); -} - -bool MyAliasEnumStruct::operator !=( - const MyAliasEnumStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ -void MyAliasEnumStruct::my_enum( - MyAliasEnum _my_enum) -{ - m_my_enum = _my_enum; -} - -/*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ -MyAliasEnum MyAliasEnumStruct::my_enum() const -{ - return m_my_enum; -} - -/*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ -MyAliasEnum& MyAliasEnumStruct::my_enum() -{ - return m_my_enum; -} - - - - -BasicStruct::BasicStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -BasicStruct::~BasicStruct() -{ -} - -BasicStruct::BasicStruct( - const BasicStruct& x) -{ - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; -} - -BasicStruct::BasicStruct( - BasicStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); -} - -BasicStruct& BasicStruct::operator =( - const BasicStruct& x) -{ - - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; - return *this; -} - -BasicStruct& BasicStruct::operator =( - BasicStruct&& x) noexcept -{ - - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); - return *this; -} - -bool BasicStruct::operator ==( - const BasicStruct& x) const -{ - return (m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string); -} - -bool BasicStruct::operator !=( - const BasicStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BasicStruct::my_bool( - bool _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -bool BasicStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -bool& BasicStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BasicStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BasicStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BasicStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BasicStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BasicStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BasicStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BasicStruct::my_string() -{ - return m_my_string; -} - - - - -BasicNamesStruct::BasicNamesStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -BasicNamesStruct::~BasicNamesStruct() -{ -} - -BasicNamesStruct::BasicNamesStruct( - const BasicNamesStruct& x) -{ - m_my_bool_name = x.m_my_bool_name; - m_my_int32_name = x.m_my_int32_name; - m_my_string_name = x.m_my_string_name; -} - -BasicNamesStruct::BasicNamesStruct( - BasicNamesStruct&& x) noexcept -{ - m_my_bool_name = x.m_my_bool_name; - m_my_int32_name = x.m_my_int32_name; - m_my_string_name = std::move(x.m_my_string_name); -} - -BasicNamesStruct& BasicNamesStruct::operator =( - const BasicNamesStruct& x) -{ - - m_my_bool_name = x.m_my_bool_name; - m_my_int32_name = x.m_my_int32_name; - m_my_string_name = x.m_my_string_name; - return *this; -} - -BasicNamesStruct& BasicNamesStruct::operator =( - BasicNamesStruct&& x) noexcept -{ - - m_my_bool_name = x.m_my_bool_name; - m_my_int32_name = x.m_my_int32_name; - m_my_string_name = std::move(x.m_my_string_name); - return *this; -} - -bool BasicNamesStruct::operator ==( - const BasicNamesStruct& x) const -{ - return (m_my_bool_name == x.m_my_bool_name && - m_my_int32_name == x.m_my_int32_name && - m_my_string_name == x.m_my_string_name); -} - -bool BasicNamesStruct::operator !=( - const BasicNamesStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_bool_name - * @param _my_bool_name New value for member my_bool_name - */ -void BasicNamesStruct::my_bool_name( - bool _my_bool_name) -{ - m_my_bool_name = _my_bool_name; -} - -/*! - * @brief This function returns the value of member my_bool_name - * @return Value of member my_bool_name - */ -bool BasicNamesStruct::my_bool_name() const -{ - return m_my_bool_name; -} - -/*! - * @brief This function returns a reference to member my_bool_name - * @return Reference to member my_bool_name - */ -bool& BasicNamesStruct::my_bool_name() -{ - return m_my_bool_name; -} - - -/*! - * @brief This function sets a value in member my_int32_name - * @param _my_int32_name New value for member my_int32_name - */ -void BasicNamesStruct::my_int32_name( - int32_t _my_int32_name) -{ - m_my_int32_name = _my_int32_name; -} - -/*! - * @brief This function returns the value of member my_int32_name - * @return Value of member my_int32_name - */ -int32_t BasicNamesStruct::my_int32_name() const -{ - return m_my_int32_name; -} - -/*! - * @brief This function returns a reference to member my_int32_name - * @return Reference to member my_int32_name - */ -int32_t& BasicNamesStruct::my_int32_name() -{ - return m_my_int32_name; -} - - -/*! - * @brief This function copies the value in member my_string_name - * @param _my_string_name New value to be copied in member my_string_name - */ -void BasicNamesStruct::my_string_name( - const std::string& _my_string_name) -{ - m_my_string_name = _my_string_name; -} - -/*! - * @brief This function moves the value in member my_string_name - * @param _my_string_name New value to be moved in member my_string_name - */ -void BasicNamesStruct::my_string_name( - std::string&& _my_string_name) -{ - m_my_string_name = std::move(_my_string_name); -} - -/*! - * @brief This function returns a constant reference to member my_string_name - * @return Constant reference to member my_string_name - */ -const std::string& BasicNamesStruct::my_string_name() const -{ - return m_my_string_name; -} - -/*! - * @brief This function returns a reference to member my_string_name - * @return Reference to member my_string_name - */ -std::string& BasicNamesStruct::my_string_name() -{ - return m_my_string_name; -} - - - - -BasicBadStruct::BasicBadStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -BasicBadStruct::~BasicBadStruct() -{ -} - -BasicBadStruct::BasicBadStruct( - const BasicBadStruct& x) -{ - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; -} - -BasicBadStruct::BasicBadStruct( - BasicBadStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); -} - -BasicBadStruct& BasicBadStruct::operator =( - const BasicBadStruct& x) -{ - - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; - return *this; -} - -BasicBadStruct& BasicBadStruct::operator =( - BasicBadStruct&& x) noexcept -{ - - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); - return *this; -} - -bool BasicBadStruct::operator ==( - const BasicBadStruct& x) const -{ - return (m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string); -} - -bool BasicBadStruct::operator !=( - const BasicBadStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BasicBadStruct::my_bool( - uint8_t _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -uint8_t BasicBadStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -uint8_t& BasicBadStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BasicBadStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BasicBadStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BasicBadStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BasicBadStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BasicBadStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BasicBadStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BasicBadStruct::my_string() -{ - return m_my_string; -} - - - - -BasicWideStruct::BasicWideStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -BasicWideStruct::~BasicWideStruct() -{ -} - -BasicWideStruct::BasicWideStruct( - const BasicWideStruct& x) -{ - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; - m_new_int32 = x.m_new_int32; - m_new_string = x.m_new_string; -} - -BasicWideStruct::BasicWideStruct( - BasicWideStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); - m_new_int32 = x.m_new_int32; - m_new_string = std::move(x.m_new_string); -} - -BasicWideStruct& BasicWideStruct::operator =( - const BasicWideStruct& x) -{ - - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; - m_new_int32 = x.m_new_int32; - m_new_string = x.m_new_string; - return *this; -} - -BasicWideStruct& BasicWideStruct::operator =( - BasicWideStruct&& x) noexcept -{ - - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); - m_new_int32 = x.m_new_int32; - m_new_string = std::move(x.m_new_string); - return *this; -} - -bool BasicWideStruct::operator ==( - const BasicWideStruct& x) const -{ - return (m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string && - m_new_int32 == x.m_new_int32 && - m_new_string == x.m_new_string); -} - -bool BasicWideStruct::operator !=( - const BasicWideStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BasicWideStruct::my_bool( - bool _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -bool BasicWideStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -bool& BasicWideStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BasicWideStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BasicWideStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BasicWideStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BasicWideStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BasicWideStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BasicWideStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BasicWideStruct::my_string() -{ - return m_my_string; -} - - -/*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ -void BasicWideStruct::new_int32( - int32_t _new_int32) -{ - m_new_int32 = _new_int32; -} - -/*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ -int32_t BasicWideStruct::new_int32() const -{ - return m_new_int32; -} - -/*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ -int32_t& BasicWideStruct::new_int32() -{ - return m_new_int32; -} - - -/*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ -void BasicWideStruct::new_string( - const std::string& _new_string) -{ - m_new_string = _new_string; -} - -/*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ -void BasicWideStruct::new_string( - std::string&& _new_string) -{ - m_new_string = std::move(_new_string); -} - -/*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ -const std::string& BasicWideStruct::new_string() const -{ - return m_new_string; -} - -/*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ -std::string& BasicWideStruct::new_string() -{ - return m_new_string; -} - - - - -BadBasicWideStruct::BadBasicWideStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -BadBasicWideStruct::~BadBasicWideStruct() -{ -} - -BadBasicWideStruct::BadBasicWideStruct( - const BadBasicWideStruct& x) -{ - m_new_int32 = x.m_new_int32; - m_new_string = x.m_new_string; - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; -} - -BadBasicWideStruct::BadBasicWideStruct( - BadBasicWideStruct&& x) noexcept -{ - m_new_int32 = x.m_new_int32; - m_new_string = std::move(x.m_new_string); - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); -} - -BadBasicWideStruct& BadBasicWideStruct::operator =( - const BadBasicWideStruct& x) -{ - - m_new_int32 = x.m_new_int32; - m_new_string = x.m_new_string; - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = x.m_my_string; - return *this; -} - -BadBasicWideStruct& BadBasicWideStruct::operator =( - BadBasicWideStruct&& x) noexcept -{ - - m_new_int32 = x.m_new_int32; - m_new_string = std::move(x.m_new_string); - m_my_bool = x.m_my_bool; - m_my_int32 = x.m_my_int32; - m_my_string = std::move(x.m_my_string); - return *this; -} - -bool BadBasicWideStruct::operator ==( - const BadBasicWideStruct& x) const -{ - return (m_new_int32 == x.m_new_int32 && - m_new_string == x.m_new_string && - m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string); -} - -bool BadBasicWideStruct::operator !=( - const BadBasicWideStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ -void BadBasicWideStruct::new_int32( - int32_t _new_int32) -{ - m_new_int32 = _new_int32; -} - -/*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ -int32_t BadBasicWideStruct::new_int32() const -{ - return m_new_int32; -} - -/*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ -int32_t& BadBasicWideStruct::new_int32() -{ - return m_new_int32; -} - - -/*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ -void BadBasicWideStruct::new_string( - const std::string& _new_string) -{ - m_new_string = _new_string; -} - -/*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ -void BadBasicWideStruct::new_string( - std::string&& _new_string) -{ - m_new_string = std::move(_new_string); -} - -/*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ -const std::string& BadBasicWideStruct::new_string() const -{ - return m_new_string; -} - -/*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ -std::string& BadBasicWideStruct::new_string() -{ - return m_new_string; -} - - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BadBasicWideStruct::my_bool( - bool _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -bool BadBasicWideStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -bool& BadBasicWideStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BadBasicWideStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BadBasicWideStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BadBasicWideStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BadBasicWideStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BadBasicWideStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BadBasicWideStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BadBasicWideStruct::my_string() -{ - return m_my_string; -} - - - - -StringStruct::StringStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -StringStruct::~StringStruct() -{ -} - -StringStruct::StringStruct( - const StringStruct& x) -{ - m_my_string = x.m_my_string; -} - -StringStruct::StringStruct( - StringStruct&& x) noexcept -{ - m_my_string = std::move(x.m_my_string); -} - -StringStruct& StringStruct::operator =( - const StringStruct& x) -{ - - m_my_string = x.m_my_string; - return *this; -} - -StringStruct& StringStruct::operator =( - StringStruct&& x) noexcept -{ - - m_my_string = std::move(x.m_my_string); - return *this; -} - -bool StringStruct::operator ==( - const StringStruct& x) const -{ - return (m_my_string == x.m_my_string); -} - -bool StringStruct::operator !=( - const StringStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void StringStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void StringStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& StringStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& StringStruct::my_string() -{ - return m_my_string; -} - - - - -LargeStringStruct::LargeStringStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -LargeStringStruct::~LargeStringStruct() -{ -} - -LargeStringStruct::LargeStringStruct( - const LargeStringStruct& x) -{ - m_my_large_string = x.m_my_large_string; -} - -LargeStringStruct::LargeStringStruct( - LargeStringStruct&& x) noexcept -{ - m_my_large_string = std::move(x.m_my_large_string); -} - -LargeStringStruct& LargeStringStruct::operator =( - const LargeStringStruct& x) -{ - - m_my_large_string = x.m_my_large_string; - return *this; -} - -LargeStringStruct& LargeStringStruct::operator =( - LargeStringStruct&& x) noexcept -{ - - m_my_large_string = std::move(x.m_my_large_string); - return *this; -} - -bool LargeStringStruct::operator ==( - const LargeStringStruct& x) const -{ - return (m_my_large_string == x.m_my_large_string); -} - -bool LargeStringStruct::operator !=( - const LargeStringStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_large_string - * @param _my_large_string New value to be copied in member my_large_string - */ -void LargeStringStruct::my_large_string( - const eprosima::fastcdr::fixed_string<41925>& _my_large_string) -{ - m_my_large_string = _my_large_string; -} - -/*! - * @brief This function moves the value in member my_large_string - * @param _my_large_string New value to be moved in member my_large_string - */ -void LargeStringStruct::my_large_string( - eprosima::fastcdr::fixed_string<41925>&& _my_large_string) -{ - m_my_large_string = std::move(_my_large_string); -} - -/*! - * @brief This function returns a constant reference to member my_large_string - * @return Constant reference to member my_large_string - */ -const eprosima::fastcdr::fixed_string<41925>& LargeStringStruct::my_large_string() const -{ - return m_my_large_string; -} - -/*! - * @brief This function returns a reference to member my_large_string - * @return Reference to member my_large_string - */ -eprosima::fastcdr::fixed_string<41925>& LargeStringStruct::my_large_string() -{ - return m_my_large_string; -} - - - - -WStringStruct::WStringStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -WStringStruct::~WStringStruct() -{ -} - -WStringStruct::WStringStruct( - const WStringStruct& x) -{ - m_my_wstring = x.m_my_wstring; -} - -WStringStruct::WStringStruct( - WStringStruct&& x) noexcept -{ - m_my_wstring = std::move(x.m_my_wstring); -} - -WStringStruct& WStringStruct::operator =( - const WStringStruct& x) -{ - - m_my_wstring = x.m_my_wstring; - return *this; -} - -WStringStruct& WStringStruct::operator =( - WStringStruct&& x) noexcept -{ - - m_my_wstring = std::move(x.m_my_wstring); - return *this; -} - -bool WStringStruct::operator ==( - const WStringStruct& x) const -{ - return (m_my_wstring == x.m_my_wstring); -} - -bool WStringStruct::operator !=( - const WStringStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_wstring - * @param _my_wstring New value to be copied in member my_wstring - */ -void WStringStruct::my_wstring( - const std::wstring& _my_wstring) -{ - m_my_wstring = _my_wstring; -} - -/*! - * @brief This function moves the value in member my_wstring - * @param _my_wstring New value to be moved in member my_wstring - */ -void WStringStruct::my_wstring( - std::wstring&& _my_wstring) -{ - m_my_wstring = std::move(_my_wstring); -} - -/*! - * @brief This function returns a constant reference to member my_wstring - * @return Constant reference to member my_wstring - */ -const std::wstring& WStringStruct::my_wstring() const -{ - return m_my_wstring; -} - -/*! - * @brief This function returns a reference to member my_wstring - * @return Reference to member my_wstring - */ -std::wstring& WStringStruct::my_wstring() -{ - return m_my_wstring; -} - - - - -LargeWStringStruct::LargeWStringStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -LargeWStringStruct::~LargeWStringStruct() -{ -} - -LargeWStringStruct::LargeWStringStruct( - const LargeWStringStruct& x) -{ - m_my_large_wstring = x.m_my_large_wstring; -} - -LargeWStringStruct::LargeWStringStruct( - LargeWStringStruct&& x) noexcept -{ - m_my_large_wstring = std::move(x.m_my_large_wstring); -} - -LargeWStringStruct& LargeWStringStruct::operator =( - const LargeWStringStruct& x) -{ - - m_my_large_wstring = x.m_my_large_wstring; - return *this; -} - -LargeWStringStruct& LargeWStringStruct::operator =( - LargeWStringStruct&& x) noexcept -{ - - m_my_large_wstring = std::move(x.m_my_large_wstring); - return *this; -} - -bool LargeWStringStruct::operator ==( - const LargeWStringStruct& x) const -{ - return (m_my_large_wstring == x.m_my_large_wstring); -} - -bool LargeWStringStruct::operator !=( - const LargeWStringStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_large_wstring - * @param _my_large_wstring New value to be copied in member my_large_wstring - */ -void LargeWStringStruct::my_large_wstring( - const std::wstring& _my_large_wstring) -{ - m_my_large_wstring = _my_large_wstring; -} - -/*! - * @brief This function moves the value in member my_large_wstring - * @param _my_large_wstring New value to be moved in member my_large_wstring - */ -void LargeWStringStruct::my_large_wstring( - std::wstring&& _my_large_wstring) -{ - m_my_large_wstring = std::move(_my_large_wstring); -} - -/*! - * @brief This function returns a constant reference to member my_large_wstring - * @return Constant reference to member my_large_wstring - */ -const std::wstring& LargeWStringStruct::my_large_wstring() const -{ - return m_my_large_wstring; -} - -/*! - * @brief This function returns a reference to member my_large_wstring - * @return Reference to member my_large_wstring - */ -std::wstring& LargeWStringStruct::my_large_wstring() -{ - return m_my_large_wstring; -} - - - - -ArrayStruct::ArrayStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -ArrayStruct::~ArrayStruct() -{ -} - -ArrayStruct::ArrayStruct( - const ArrayStruct& x) -{ - m_my_array = x.m_my_array; -} - -ArrayStruct::ArrayStruct( - ArrayStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); -} - -ArrayStruct& ArrayStruct::operator =( - const ArrayStruct& x) -{ - - m_my_array = x.m_my_array; - return *this; -} - -ArrayStruct& ArrayStruct::operator =( - ArrayStruct&& x) noexcept -{ - - m_my_array = std::move(x.m_my_array); - return *this; -} - -bool ArrayStruct::operator ==( - const ArrayStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArrayStruct::operator !=( - const ArrayStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArrayStruct::my_array( - const std::array& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArrayStruct::my_array( - std::array&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array& ArrayStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array& ArrayStruct::my_array() -{ - return m_my_array; -} - - - - -ArrayStructEqual::ArrayStructEqual() -{ - // Just to register all known types - registerTypesTypes(); -} - -ArrayStructEqual::~ArrayStructEqual() -{ -} - -ArrayStructEqual::ArrayStructEqual( - const ArrayStructEqual& x) -{ - m_my_array_equal = x.m_my_array_equal; -} - -ArrayStructEqual::ArrayStructEqual( - ArrayStructEqual&& x) noexcept -{ - m_my_array_equal = std::move(x.m_my_array_equal); -} - -ArrayStructEqual& ArrayStructEqual::operator =( - const ArrayStructEqual& x) -{ - - m_my_array_equal = x.m_my_array_equal; - return *this; -} - -ArrayStructEqual& ArrayStructEqual::operator =( - ArrayStructEqual&& x) noexcept -{ - - m_my_array_equal = std::move(x.m_my_array_equal); - return *this; -} - -bool ArrayStructEqual::operator ==( - const ArrayStructEqual& x) const -{ - return (m_my_array_equal == x.m_my_array_equal); -} - -bool ArrayStructEqual::operator !=( - const ArrayStructEqual& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_array_equal - * @param _my_array_equal New value to be copied in member my_array_equal - */ -void ArrayStructEqual::my_array_equal( - const std::array& _my_array_equal) -{ - m_my_array_equal = _my_array_equal; -} - -/*! - * @brief This function moves the value in member my_array_equal - * @param _my_array_equal New value to be moved in member my_array_equal - */ -void ArrayStructEqual::my_array_equal( - std::array&& _my_array_equal) -{ - m_my_array_equal = std::move(_my_array_equal); -} - -/*! - * @brief This function returns a constant reference to member my_array_equal - * @return Constant reference to member my_array_equal - */ -const std::array& ArrayStructEqual::my_array_equal() const -{ - return m_my_array_equal; -} - -/*! - * @brief This function returns a reference to member my_array_equal - * @return Reference to member my_array_equal - */ -std::array& ArrayStructEqual::my_array_equal() -{ - return m_my_array_equal; -} - - - - -ArrayBadStruct::ArrayBadStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -ArrayBadStruct::~ArrayBadStruct() -{ -} - -ArrayBadStruct::ArrayBadStruct( - const ArrayBadStruct& x) -{ - m_my_array = x.m_my_array; -} - -ArrayBadStruct::ArrayBadStruct( - ArrayBadStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); -} - -ArrayBadStruct& ArrayBadStruct::operator =( - const ArrayBadStruct& x) -{ - - m_my_array = x.m_my_array; - return *this; -} - -ArrayBadStruct& ArrayBadStruct::operator =( - ArrayBadStruct&& x) noexcept -{ - - m_my_array = std::move(x.m_my_array); - return *this; -} - -bool ArrayBadStruct::operator ==( - const ArrayBadStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArrayBadStruct::operator !=( - const ArrayBadStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArrayBadStruct::my_array( - const std::array& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArrayBadStruct::my_array( - std::array&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array& ArrayBadStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array& ArrayBadStruct::my_array() -{ - return m_my_array; -} - - - - -ArrayDimensionsStruct::ArrayDimensionsStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -ArrayDimensionsStruct::~ArrayDimensionsStruct() -{ -} - -ArrayDimensionsStruct::ArrayDimensionsStruct( - const ArrayDimensionsStruct& x) -{ - m_my_array = x.m_my_array; -} - -ArrayDimensionsStruct::ArrayDimensionsStruct( - ArrayDimensionsStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); -} - -ArrayDimensionsStruct& ArrayDimensionsStruct::operator =( - const ArrayDimensionsStruct& x) -{ - - m_my_array = x.m_my_array; - return *this; -} - -ArrayDimensionsStruct& ArrayDimensionsStruct::operator =( - ArrayDimensionsStruct&& x) noexcept -{ - - m_my_array = std::move(x.m_my_array); - return *this; -} - -bool ArrayDimensionsStruct::operator ==( - const ArrayDimensionsStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArrayDimensionsStruct::operator !=( - const ArrayDimensionsStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArrayDimensionsStruct::my_array( - const std::array, 2>& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArrayDimensionsStruct::my_array( - std::array, 2>&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array, 2>& ArrayDimensionsStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array, 2>& ArrayDimensionsStruct::my_array() -{ - return m_my_array; -} - - - - -ArraySizeStruct::ArraySizeStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -ArraySizeStruct::~ArraySizeStruct() -{ -} - -ArraySizeStruct::ArraySizeStruct( - const ArraySizeStruct& x) -{ - m_my_array = x.m_my_array; -} - -ArraySizeStruct::ArraySizeStruct( - ArraySizeStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); -} - -ArraySizeStruct& ArraySizeStruct::operator =( - const ArraySizeStruct& x) -{ - - m_my_array = x.m_my_array; - return *this; -} - -ArraySizeStruct& ArraySizeStruct::operator =( - ArraySizeStruct&& x) noexcept -{ - - m_my_array = std::move(x.m_my_array); - return *this; -} - -bool ArraySizeStruct::operator ==( - const ArraySizeStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArraySizeStruct::operator !=( - const ArraySizeStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArraySizeStruct::my_array( - const std::array& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArraySizeStruct::my_array( - std::array&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array& ArraySizeStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array& ArraySizeStruct::my_array() -{ - return m_my_array; -} - - - - - - -SequenceStruct::SequenceStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SequenceStruct::~SequenceStruct() -{ -} - -SequenceStruct::SequenceStruct( - const SequenceStruct& x) -{ - m_my_sequence = x.m_my_sequence; -} - -SequenceStruct::SequenceStruct( - SequenceStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); -} - -SequenceStruct& SequenceStruct::operator =( - const SequenceStruct& x) -{ - - m_my_sequence = x.m_my_sequence; - return *this; -} - -SequenceStruct& SequenceStruct::operator =( - SequenceStruct&& x) noexcept -{ - - m_my_sequence = std::move(x.m_my_sequence); - return *this; -} - -bool SequenceStruct::operator ==( - const SequenceStruct& x) const -{ - return (m_my_sequence == x.m_my_sequence); -} - -bool SequenceStruct::operator !=( - const SequenceStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ -void SequenceStruct::my_sequence( - const std::vector& _my_sequence) -{ - m_my_sequence = _my_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ -void SequenceStruct::my_sequence( - std::vector&& _my_sequence) -{ - m_my_sequence = std::move(_my_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ -const std::vector& SequenceStruct::my_sequence() const -{ - return m_my_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ -std::vector& SequenceStruct::my_sequence() -{ - return m_my_sequence; -} - - - - - - -SequenceStructEqual::SequenceStructEqual() -{ - // Just to register all known types - registerTypesTypes(); -} - -SequenceStructEqual::~SequenceStructEqual() -{ -} - -SequenceStructEqual::SequenceStructEqual( - const SequenceStructEqual& x) -{ - m_my_sequence_equal = x.m_my_sequence_equal; -} - -SequenceStructEqual::SequenceStructEqual( - SequenceStructEqual&& x) noexcept -{ - m_my_sequence_equal = std::move(x.m_my_sequence_equal); -} - -SequenceStructEqual& SequenceStructEqual::operator =( - const SequenceStructEqual& x) -{ - - m_my_sequence_equal = x.m_my_sequence_equal; - return *this; -} - -SequenceStructEqual& SequenceStructEqual::operator =( - SequenceStructEqual&& x) noexcept -{ - - m_my_sequence_equal = std::move(x.m_my_sequence_equal); - return *this; -} - -bool SequenceStructEqual::operator ==( - const SequenceStructEqual& x) const -{ - return (m_my_sequence_equal == x.m_my_sequence_equal); -} - -bool SequenceStructEqual::operator !=( - const SequenceStructEqual& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_sequence_equal - * @param _my_sequence_equal New value to be copied in member my_sequence_equal - */ -void SequenceStructEqual::my_sequence_equal( - const std::vector& _my_sequence_equal) -{ - m_my_sequence_equal = _my_sequence_equal; -} - -/*! - * @brief This function moves the value in member my_sequence_equal - * @param _my_sequence_equal New value to be moved in member my_sequence_equal - */ -void SequenceStructEqual::my_sequence_equal( - std::vector&& _my_sequence_equal) -{ - m_my_sequence_equal = std::move(_my_sequence_equal); -} - -/*! - * @brief This function returns a constant reference to member my_sequence_equal - * @return Constant reference to member my_sequence_equal - */ -const std::vector& SequenceStructEqual::my_sequence_equal() const -{ - return m_my_sequence_equal; -} - -/*! - * @brief This function returns a reference to member my_sequence_equal - * @return Reference to member my_sequence_equal - */ -std::vector& SequenceStructEqual::my_sequence_equal() -{ - return m_my_sequence_equal; -} - - - - - - -SequenceBadStruct::SequenceBadStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SequenceBadStruct::~SequenceBadStruct() -{ -} - -SequenceBadStruct::SequenceBadStruct( - const SequenceBadStruct& x) -{ - m_my_sequence = x.m_my_sequence; -} - -SequenceBadStruct::SequenceBadStruct( - SequenceBadStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); -} - -SequenceBadStruct& SequenceBadStruct::operator =( - const SequenceBadStruct& x) -{ - - m_my_sequence = x.m_my_sequence; - return *this; -} - -SequenceBadStruct& SequenceBadStruct::operator =( - SequenceBadStruct&& x) noexcept -{ - - m_my_sequence = std::move(x.m_my_sequence); - return *this; -} - -bool SequenceBadStruct::operator ==( - const SequenceBadStruct& x) const -{ - return (m_my_sequence == x.m_my_sequence); -} - -bool SequenceBadStruct::operator !=( - const SequenceBadStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ -void SequenceBadStruct::my_sequence( - const std::vector& _my_sequence) -{ - m_my_sequence = _my_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ -void SequenceBadStruct::my_sequence( - std::vector&& _my_sequence) -{ - m_my_sequence = std::move(_my_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ -const std::vector& SequenceBadStruct::my_sequence() const -{ - return m_my_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ -std::vector& SequenceBadStruct::my_sequence() -{ - return m_my_sequence; -} - - - - - - -SequenceBoundsStruct::SequenceBoundsStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SequenceBoundsStruct::~SequenceBoundsStruct() -{ -} - -SequenceBoundsStruct::SequenceBoundsStruct( - const SequenceBoundsStruct& x) -{ - m_my_sequence = x.m_my_sequence; -} - -SequenceBoundsStruct::SequenceBoundsStruct( - SequenceBoundsStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); -} - -SequenceBoundsStruct& SequenceBoundsStruct::operator =( - const SequenceBoundsStruct& x) -{ - - m_my_sequence = x.m_my_sequence; - return *this; -} - -SequenceBoundsStruct& SequenceBoundsStruct::operator =( - SequenceBoundsStruct&& x) noexcept -{ - - m_my_sequence = std::move(x.m_my_sequence); - return *this; -} - -bool SequenceBoundsStruct::operator ==( - const SequenceBoundsStruct& x) const -{ - return (m_my_sequence == x.m_my_sequence); -} - -bool SequenceBoundsStruct::operator !=( - const SequenceBoundsStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ -void SequenceBoundsStruct::my_sequence( - const std::vector& _my_sequence) -{ - m_my_sequence = _my_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ -void SequenceBoundsStruct::my_sequence( - std::vector&& _my_sequence) -{ - m_my_sequence = std::move(_my_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ -const std::vector& SequenceBoundsStruct::my_sequence() const -{ - return m_my_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ -std::vector& SequenceBoundsStruct::my_sequence() -{ - return m_my_sequence; -} - - - - - - - - -SequenceSequenceStruct::SequenceSequenceStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SequenceSequenceStruct::~SequenceSequenceStruct() -{ -} - -SequenceSequenceStruct::SequenceSequenceStruct( - const SequenceSequenceStruct& x) -{ - m_my_sequence_sequence = x.m_my_sequence_sequence; -} - -SequenceSequenceStruct::SequenceSequenceStruct( - SequenceSequenceStruct&& x) noexcept -{ - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); -} - -SequenceSequenceStruct& SequenceSequenceStruct::operator =( - const SequenceSequenceStruct& x) -{ - - m_my_sequence_sequence = x.m_my_sequence_sequence; - return *this; -} - -SequenceSequenceStruct& SequenceSequenceStruct::operator =( - SequenceSequenceStruct&& x) noexcept -{ - - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - return *this; -} - -bool SequenceSequenceStruct::operator ==( - const SequenceSequenceStruct& x) const -{ - return (m_my_sequence_sequence == x.m_my_sequence_sequence); -} - -bool SequenceSequenceStruct::operator !=( - const SequenceSequenceStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ -void SequenceSequenceStruct::my_sequence_sequence( - const std::vector>& _my_sequence_sequence) -{ - m_my_sequence_sequence = _my_sequence_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ -void SequenceSequenceStruct::my_sequence_sequence( - std::vector>&& _my_sequence_sequence) -{ - m_my_sequence_sequence = std::move(_my_sequence_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ -const std::vector>& SequenceSequenceStruct::my_sequence_sequence() const -{ - return m_my_sequence_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ -std::vector>& SequenceSequenceStruct::my_sequence_sequence() -{ - return m_my_sequence_sequence; -} - - - - - - - - -SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SequenceSequenceBoundsStruct::~SequenceSequenceBoundsStruct() -{ -} - -SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct( - const SequenceSequenceBoundsStruct& x) -{ - m_my_sequence_sequence = x.m_my_sequence_sequence; -} - -SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct( - SequenceSequenceBoundsStruct&& x) noexcept -{ - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); -} - -SequenceSequenceBoundsStruct& SequenceSequenceBoundsStruct::operator =( - const SequenceSequenceBoundsStruct& x) -{ - - m_my_sequence_sequence = x.m_my_sequence_sequence; - return *this; -} - -SequenceSequenceBoundsStruct& SequenceSequenceBoundsStruct::operator =( - SequenceSequenceBoundsStruct&& x) noexcept -{ - - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - return *this; -} - -bool SequenceSequenceBoundsStruct::operator ==( - const SequenceSequenceBoundsStruct& x) const -{ - return (m_my_sequence_sequence == x.m_my_sequence_sequence); -} - -bool SequenceSequenceBoundsStruct::operator !=( - const SequenceSequenceBoundsStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ -void SequenceSequenceBoundsStruct::my_sequence_sequence( - const std::vector>& _my_sequence_sequence) -{ - m_my_sequence_sequence = _my_sequence_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ -void SequenceSequenceBoundsStruct::my_sequence_sequence( - std::vector>&& _my_sequence_sequence) -{ - m_my_sequence_sequence = std::move(_my_sequence_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ -const std::vector>& SequenceSequenceBoundsStruct::my_sequence_sequence() const -{ - return m_my_sequence_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ -std::vector>& SequenceSequenceBoundsStruct::my_sequence_sequence() -{ - return m_my_sequence_sequence; -} - - - - - - -MapStruct::MapStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MapStruct::~MapStruct() -{ -} - -MapStruct::MapStruct( - const MapStruct& x) -{ - m_my_map = x.m_my_map; -} - -MapStruct::MapStruct( - MapStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); -} - -MapStruct& MapStruct::operator =( - const MapStruct& x) -{ - - m_my_map = x.m_my_map; - return *this; -} - -MapStruct& MapStruct::operator =( - MapStruct&& x) noexcept -{ - - m_my_map = std::move(x.m_my_map); - return *this; -} - -bool MapStruct::operator ==( - const MapStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapStruct::operator !=( - const MapStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapStruct::my_map() -{ - return m_my_map; -} - - - - - - -MapStructEqual::MapStructEqual() -{ - // Just to register all known types - registerTypesTypes(); -} - -MapStructEqual::~MapStructEqual() -{ -} - -MapStructEqual::MapStructEqual( - const MapStructEqual& x) -{ - m_my_map_equal = x.m_my_map_equal; -} - -MapStructEqual::MapStructEqual( - MapStructEqual&& x) noexcept -{ - m_my_map_equal = std::move(x.m_my_map_equal); -} - -MapStructEqual& MapStructEqual::operator =( - const MapStructEqual& x) -{ - - m_my_map_equal = x.m_my_map_equal; - return *this; -} - -MapStructEqual& MapStructEqual::operator =( - MapStructEqual&& x) noexcept -{ - - m_my_map_equal = std::move(x.m_my_map_equal); - return *this; -} - -bool MapStructEqual::operator ==( - const MapStructEqual& x) const -{ - return (m_my_map_equal == x.m_my_map_equal); -} - -bool MapStructEqual::operator !=( - const MapStructEqual& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_map_equal - * @param _my_map_equal New value to be copied in member my_map_equal - */ -void MapStructEqual::my_map_equal( - const std::map& _my_map_equal) -{ - m_my_map_equal = _my_map_equal; -} - -/*! - * @brief This function moves the value in member my_map_equal - * @param _my_map_equal New value to be moved in member my_map_equal - */ -void MapStructEqual::my_map_equal( - std::map&& _my_map_equal) -{ - m_my_map_equal = std::move(_my_map_equal); -} - -/*! - * @brief This function returns a constant reference to member my_map_equal - * @return Constant reference to member my_map_equal - */ -const std::map& MapStructEqual::my_map_equal() const -{ - return m_my_map_equal; -} - -/*! - * @brief This function returns a reference to member my_map_equal - * @return Reference to member my_map_equal - */ -std::map& MapStructEqual::my_map_equal() -{ - return m_my_map_equal; -} - - - - - - -MapBadKeyStruct::MapBadKeyStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MapBadKeyStruct::~MapBadKeyStruct() -{ -} - -MapBadKeyStruct::MapBadKeyStruct( - const MapBadKeyStruct& x) -{ - m_my_map = x.m_my_map; -} - -MapBadKeyStruct::MapBadKeyStruct( - MapBadKeyStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); -} - -MapBadKeyStruct& MapBadKeyStruct::operator =( - const MapBadKeyStruct& x) -{ - - m_my_map = x.m_my_map; - return *this; -} - -MapBadKeyStruct& MapBadKeyStruct::operator =( - MapBadKeyStruct&& x) noexcept -{ - - m_my_map = std::move(x.m_my_map); - return *this; -} - -bool MapBadKeyStruct::operator ==( - const MapBadKeyStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapBadKeyStruct::operator !=( - const MapBadKeyStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapBadKeyStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapBadKeyStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapBadKeyStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapBadKeyStruct::my_map() -{ - return m_my_map; -} - - - - - - -MapBadElemStruct::MapBadElemStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MapBadElemStruct::~MapBadElemStruct() -{ -} - -MapBadElemStruct::MapBadElemStruct( - const MapBadElemStruct& x) -{ - m_my_map = x.m_my_map; -} - -MapBadElemStruct::MapBadElemStruct( - MapBadElemStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); -} - -MapBadElemStruct& MapBadElemStruct::operator =( - const MapBadElemStruct& x) -{ - - m_my_map = x.m_my_map; - return *this; -} - -MapBadElemStruct& MapBadElemStruct::operator =( - MapBadElemStruct&& x) noexcept -{ - - m_my_map = std::move(x.m_my_map); - return *this; -} - -bool MapBadElemStruct::operator ==( - const MapBadElemStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapBadElemStruct::operator !=( - const MapBadElemStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapBadElemStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapBadElemStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapBadElemStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapBadElemStruct::my_map() -{ - return m_my_map; -} - - - - - - -MapBoundsStruct::MapBoundsStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MapBoundsStruct::~MapBoundsStruct() -{ -} - -MapBoundsStruct::MapBoundsStruct( - const MapBoundsStruct& x) -{ - m_my_map = x.m_my_map; -} - -MapBoundsStruct::MapBoundsStruct( - MapBoundsStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); -} - -MapBoundsStruct& MapBoundsStruct::operator =( - const MapBoundsStruct& x) -{ - - m_my_map = x.m_my_map; - return *this; -} - -MapBoundsStruct& MapBoundsStruct::operator =( - MapBoundsStruct&& x) noexcept -{ - - m_my_map = std::move(x.m_my_map); - return *this; -} - -bool MapBoundsStruct::operator ==( - const MapBoundsStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapBoundsStruct::operator !=( - const MapBoundsStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapBoundsStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapBoundsStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapBoundsStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapBoundsStruct::my_map() -{ - return m_my_map; -} - - - - - - - - -MapMapStruct::MapMapStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MapMapStruct::~MapMapStruct() -{ -} - -MapMapStruct::MapMapStruct( - const MapMapStruct& x) -{ - m_my_map_map = x.m_my_map_map; -} - -MapMapStruct::MapMapStruct( - MapMapStruct&& x) noexcept -{ - m_my_map_map = std::move(x.m_my_map_map); -} - -MapMapStruct& MapMapStruct::operator =( - const MapMapStruct& x) -{ - - m_my_map_map = x.m_my_map_map; - return *this; -} - -MapMapStruct& MapMapStruct::operator =( - MapMapStruct&& x) noexcept -{ - - m_my_map_map = std::move(x.m_my_map_map); - return *this; -} - -bool MapMapStruct::operator ==( - const MapMapStruct& x) const -{ - return (m_my_map_map == x.m_my_map_map); -} - -bool MapMapStruct::operator !=( - const MapMapStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ -void MapMapStruct::my_map_map( - const std::map>& _my_map_map) -{ - m_my_map_map = _my_map_map; -} - -/*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ -void MapMapStruct::my_map_map( - std::map>&& _my_map_map) -{ - m_my_map_map = std::move(_my_map_map); -} - -/*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ -const std::map>& MapMapStruct::my_map_map() const -{ - return m_my_map_map; -} - -/*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ -std::map>& MapMapStruct::my_map_map() -{ - return m_my_map_map; -} - - - - - - - - -MapMapBoundsStruct::MapMapBoundsStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -MapMapBoundsStruct::~MapMapBoundsStruct() -{ -} - -MapMapBoundsStruct::MapMapBoundsStruct( - const MapMapBoundsStruct& x) -{ - m_my_map_map = x.m_my_map_map; -} - -MapMapBoundsStruct::MapMapBoundsStruct( - MapMapBoundsStruct&& x) noexcept -{ - m_my_map_map = std::move(x.m_my_map_map); -} - -MapMapBoundsStruct& MapMapBoundsStruct::operator =( - const MapMapBoundsStruct& x) -{ - - m_my_map_map = x.m_my_map_map; - return *this; -} - -MapMapBoundsStruct& MapMapBoundsStruct::operator =( - MapMapBoundsStruct&& x) noexcept -{ - - m_my_map_map = std::move(x.m_my_map_map); - return *this; -} - -bool MapMapBoundsStruct::operator ==( - const MapMapBoundsStruct& x) const -{ - return (m_my_map_map == x.m_my_map_map); -} - -bool MapMapBoundsStruct::operator !=( - const MapMapBoundsStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ -void MapMapBoundsStruct::my_map_map( - const std::map>& _my_map_map) -{ - m_my_map_map = _my_map_map; -} - -/*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ -void MapMapBoundsStruct::my_map_map( - std::map>&& _my_map_map) -{ - m_my_map_map = std::move(_my_map_map); -} - -/*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ -const std::map>& MapMapBoundsStruct::my_map_map() const -{ - return m_my_map_map; -} - -/*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ -std::map>& MapMapBoundsStruct::my_map_map() -{ - return m_my_map_map; -} - - - - -SimpleUnion::SimpleUnion() -{ - m__d = A; -} - -SimpleUnion::~SimpleUnion() -{ -} - -SimpleUnion::SimpleUnion( - const SimpleUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleUnion::SimpleUnion( - SimpleUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleUnion& SimpleUnion::operator =( - const SimpleUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleUnion& SimpleUnion::operator =( - SimpleUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleUnion::operator ==( - const SimpleUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case B: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleUnion::operator !=( - const SimpleUnion& x) const -{ - return !(*this == x); -} - -void SimpleUnion::_d( - int32_t __d) -{ - bool b = false; - - switch (m__d) - { - case A: - switch (__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch (__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleUnion::_d() const -{ - return m__d; -} - -int32_t& SimpleUnion::_d() -{ - return m__d; -} - -void SimpleUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = A; - -} - -int32_t SimpleUnion::first() const -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& SimpleUnion::first() -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = B; - -} - -int64_t SimpleUnion::second() const -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleUnion::second() -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - - - -SimpleUnionNames::SimpleUnionNames() -{ - m__d = A; -} - -SimpleUnionNames::~SimpleUnionNames() -{ -} - -SimpleUnionNames::SimpleUnionNames( - const SimpleUnionNames& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } -} - -SimpleUnionNames::SimpleUnionNames( - SimpleUnionNames&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } -} - -SimpleUnionNames& SimpleUnionNames::operator =( - const SimpleUnionNames& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } - - return *this; -} - -SimpleUnionNames& SimpleUnionNames::operator =( - SimpleUnionNames&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } - - return *this; -} - -bool SimpleUnionNames::operator ==( - const SimpleUnionNames& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case A: - return (m_first_case == x.m_first_case); - break; - - - case B: - return (m_second_case == x.m_second_case); - break; - - default: - break; - } - return false; -} - -bool SimpleUnionNames::operator !=( - const SimpleUnionNames& x) const -{ - return !(*this == x); -} - -void SimpleUnionNames::_d( - int32_t __d) -{ - bool b = false; - - switch (m__d) - { - case A: - switch (__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch (__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleUnionNames::_d() const -{ - return m__d; -} - -int32_t& SimpleUnionNames::_d() -{ - return m__d; -} - -void SimpleUnionNames::first_case( - int32_t _first_case) -{ - m_first_case = _first_case; - m__d = A; - -} - -int32_t SimpleUnionNames::first_case() const -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first_case; -} - -int32_t& SimpleUnionNames::first_case() -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first_case; -} - - -void SimpleUnionNames::second_case( - int64_t _second_case) -{ - m_second_case = _second_case; - m__d = B; - -} - -int64_t SimpleUnionNames::second_case() const -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second_case; -} - -int64_t& SimpleUnionNames::second_case() -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second_case; -} - - - - -SimpleTypeUnion::SimpleTypeUnion() -{ - m__d = A; -} - -SimpleTypeUnion::~SimpleTypeUnion() -{ -} - -SimpleTypeUnion::SimpleTypeUnion( - const SimpleTypeUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleTypeUnion::SimpleTypeUnion( - SimpleTypeUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleTypeUnion& SimpleTypeUnion::operator =( - const SimpleTypeUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleTypeUnion& SimpleTypeUnion::operator =( - SimpleTypeUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleTypeUnion::operator ==( - const SimpleTypeUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case B: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleTypeUnion::operator !=( - const SimpleTypeUnion& x) const -{ - return !(*this == x); -} - -void SimpleTypeUnion::_d( - int32_t __d) -{ - bool b = false; - - switch (m__d) - { - case A: - switch (__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch (__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleTypeUnion::_d() const -{ - return m__d; -} - -int32_t& SimpleTypeUnion::_d() -{ - return m__d; -} - -void SimpleTypeUnion::first( - uint8_t _first) -{ - m_first = _first; - m__d = A; - -} - -uint8_t SimpleTypeUnion::first() const -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -uint8_t& SimpleTypeUnion::first() -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleTypeUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = B; - -} - -int64_t SimpleTypeUnion::second() const -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleTypeUnion::second() -{ - bool b = false; - - switch (m__d) - { - case B: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - - - -SimpleBadUnion::SimpleBadUnion() -{ - m__d = A; -} - -SimpleBadUnion::~SimpleBadUnion() -{ -} - -SimpleBadUnion::SimpleBadUnion( - const SimpleBadUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadUnion::SimpleBadUnion( - SimpleBadUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadUnion& SimpleBadUnion::operator =( - const SimpleBadUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleBadUnion& SimpleBadUnion::operator =( - SimpleBadUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleBadUnion::operator ==( - const SimpleBadUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case C: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleBadUnion::operator !=( - const SimpleBadUnion& x) const -{ - return !(*this == x); -} - -void SimpleBadUnion::_d( - int32_t __d) -{ - bool b = false; - - switch (m__d) - { - case A: - switch (__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case C: - switch (__d) - { - case C: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleBadUnion::_d() const -{ - return m__d; -} - -int32_t& SimpleBadUnion::_d() -{ - return m__d; -} - -void SimpleBadUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = A; - -} - -int32_t SimpleBadUnion::first() const -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& SimpleBadUnion::first() -{ - bool b = false; - - switch (m__d) - { - case A: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleBadUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = C; - -} - -int64_t SimpleBadUnion::second() const -{ - bool b = false; - - switch (m__d) - { - case C: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleBadUnion::second() -{ - bool b = false; - - switch (m__d) - { - case C: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - - - -SimpleBadDiscUnion::SimpleBadDiscUnion() -{ - m__d = 0; -} - -SimpleBadDiscUnion::~SimpleBadDiscUnion() -{ -} - -SimpleBadDiscUnion::SimpleBadDiscUnion( - const SimpleBadDiscUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadDiscUnion::SimpleBadDiscUnion( - SimpleBadDiscUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadDiscUnion& SimpleBadDiscUnion::operator =( - const SimpleBadDiscUnion& x) -{ - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleBadDiscUnion& SimpleBadDiscUnion::operator =( - SimpleBadDiscUnion&& x) noexcept -{ - m__d = x.m__d; - - switch (m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleBadDiscUnion::operator ==( - const SimpleBadDiscUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch (m__d) - { - case 0: - return (m_first == x.m_first); - break; - - - case 1: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleBadDiscUnion::operator !=( - const SimpleBadDiscUnion& x) const -{ - return !(*this == x); -} - -void SimpleBadDiscUnion::_d( - uint8_t __d) -{ - bool b = false; - - switch (m__d) - { - case 0: - switch (__d) - { - case 0: - b = true; - break; - default: - break; - } - break; - - - case 1: - switch (__d) - { - case 1: - b = true; - break; - default: - break; - } - break; - - default: - break; - } - - if (!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -uint8_t SimpleBadDiscUnion::_d() const -{ - return m__d; -} - -uint8_t& SimpleBadDiscUnion::_d() -{ - return m__d; -} - -void SimpleBadDiscUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = 0; - -} - -int32_t SimpleBadDiscUnion::first() const -{ - bool b = false; - - switch (m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& SimpleBadDiscUnion::first() -{ - bool b = false; - - switch (m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleBadDiscUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = 1; - -} - -int64_t SimpleBadDiscUnion::second() const -{ - bool b = false; - - switch (m__d) - { - case 1: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleBadDiscUnion::second() -{ - bool b = false; - - switch (m__d) - { - case 1: - b = true; - break; - default: - break; - } - - if (!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - - - -SimpleUnionStruct::SimpleUnionStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SimpleUnionStruct::~SimpleUnionStruct() -{ -} - -SimpleUnionStruct::SimpleUnionStruct( - const SimpleUnionStruct& x) -{ - m_my_union = x.m_my_union; -} - -SimpleUnionStruct::SimpleUnionStruct( - SimpleUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); -} - -SimpleUnionStruct& SimpleUnionStruct::operator =( - const SimpleUnionStruct& x) -{ - - m_my_union = x.m_my_union; - return *this; -} - -SimpleUnionStruct& SimpleUnionStruct::operator =( - SimpleUnionStruct&& x) noexcept -{ - - m_my_union = std::move(x.m_my_union); - return *this; -} - -bool SimpleUnionStruct::operator ==( - const SimpleUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleUnionStruct::operator !=( - const SimpleUnionStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleUnionStruct::my_union( - const SimpleUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleUnionStruct::my_union( - SimpleUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleUnion& SimpleUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleUnion& SimpleUnionStruct::my_union() -{ - return m_my_union; -} - - - - -SimpleUnionStructEqual::SimpleUnionStructEqual() -{ - // Just to register all known types - registerTypesTypes(); -} - -SimpleUnionStructEqual::~SimpleUnionStructEqual() -{ -} - -SimpleUnionStructEqual::SimpleUnionStructEqual( - const SimpleUnionStructEqual& x) -{ - m_my_union_equal = x.m_my_union_equal; -} - -SimpleUnionStructEqual::SimpleUnionStructEqual( - SimpleUnionStructEqual&& x) noexcept -{ - m_my_union_equal = std::move(x.m_my_union_equal); -} - -SimpleUnionStructEqual& SimpleUnionStructEqual::operator =( - const SimpleUnionStructEqual& x) -{ - - m_my_union_equal = x.m_my_union_equal; - return *this; -} - -SimpleUnionStructEqual& SimpleUnionStructEqual::operator =( - SimpleUnionStructEqual&& x) noexcept -{ - - m_my_union_equal = std::move(x.m_my_union_equal); - return *this; -} - -bool SimpleUnionStructEqual::operator ==( - const SimpleUnionStructEqual& x) const -{ - return (m_my_union_equal == x.m_my_union_equal); -} - -bool SimpleUnionStructEqual::operator !=( - const SimpleUnionStructEqual& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_union_equal - * @param _my_union_equal New value to be copied in member my_union_equal - */ -void SimpleUnionStructEqual::my_union_equal( - const SimpleUnion& _my_union_equal) -{ - m_my_union_equal = _my_union_equal; -} - -/*! - * @brief This function moves the value in member my_union_equal - * @param _my_union_equal New value to be moved in member my_union_equal - */ -void SimpleUnionStructEqual::my_union_equal( - SimpleUnion&& _my_union_equal) -{ - m_my_union_equal = std::move(_my_union_equal); -} - -/*! - * @brief This function returns a constant reference to member my_union_equal - * @return Constant reference to member my_union_equal - */ -const SimpleUnion& SimpleUnionStructEqual::my_union_equal() const -{ - return m_my_union_equal; -} - -/*! - * @brief This function returns a reference to member my_union_equal - * @return Reference to member my_union_equal - */ -SimpleUnion& SimpleUnionStructEqual::my_union_equal() -{ - return m_my_union_equal; -} - - - - -SimpleUnionNamesStruct::SimpleUnionNamesStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SimpleUnionNamesStruct::~SimpleUnionNamesStruct() -{ -} - -SimpleUnionNamesStruct::SimpleUnionNamesStruct( - const SimpleUnionNamesStruct& x) -{ - m_my_union = x.m_my_union; -} - -SimpleUnionNamesStruct::SimpleUnionNamesStruct( - SimpleUnionNamesStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); -} - -SimpleUnionNamesStruct& SimpleUnionNamesStruct::operator =( - const SimpleUnionNamesStruct& x) -{ - - m_my_union = x.m_my_union; - return *this; -} - -SimpleUnionNamesStruct& SimpleUnionNamesStruct::operator =( - SimpleUnionNamesStruct&& x) noexcept -{ - - m_my_union = std::move(x.m_my_union); - return *this; -} - -bool SimpleUnionNamesStruct::operator ==( - const SimpleUnionNamesStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleUnionNamesStruct::operator !=( - const SimpleUnionNamesStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleUnionNamesStruct::my_union( - const SimpleUnionNames& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleUnionNamesStruct::my_union( - SimpleUnionNames&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleUnionNames& SimpleUnionNamesStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleUnionNames& SimpleUnionNamesStruct::my_union() -{ - return m_my_union; -} - - - - -SimpleTypeUnionStruct::SimpleTypeUnionStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SimpleTypeUnionStruct::~SimpleTypeUnionStruct() -{ -} - -SimpleTypeUnionStruct::SimpleTypeUnionStruct( - const SimpleTypeUnionStruct& x) -{ - m_my_union = x.m_my_union; -} - -SimpleTypeUnionStruct::SimpleTypeUnionStruct( - SimpleTypeUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); -} - -SimpleTypeUnionStruct& SimpleTypeUnionStruct::operator =( - const SimpleTypeUnionStruct& x) -{ - - m_my_union = x.m_my_union; - return *this; -} - -SimpleTypeUnionStruct& SimpleTypeUnionStruct::operator =( - SimpleTypeUnionStruct&& x) noexcept -{ - - m_my_union = std::move(x.m_my_union); - return *this; -} - -bool SimpleTypeUnionStruct::operator ==( - const SimpleTypeUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleTypeUnionStruct::operator !=( - const SimpleTypeUnionStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleTypeUnionStruct::my_union( - const SimpleTypeUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleTypeUnionStruct::my_union( - SimpleTypeUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleTypeUnion& SimpleTypeUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleTypeUnion& SimpleTypeUnionStruct::my_union() -{ - return m_my_union; -} - - - - -SimpleBadUnionStruct::SimpleBadUnionStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SimpleBadUnionStruct::~SimpleBadUnionStruct() -{ -} - -SimpleBadUnionStruct::SimpleBadUnionStruct( - const SimpleBadUnionStruct& x) -{ - m_my_union = x.m_my_union; -} - -SimpleBadUnionStruct::SimpleBadUnionStruct( - SimpleBadUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); -} - -SimpleBadUnionStruct& SimpleBadUnionStruct::operator =( - const SimpleBadUnionStruct& x) -{ - - m_my_union = x.m_my_union; - return *this; -} - -SimpleBadUnionStruct& SimpleBadUnionStruct::operator =( - SimpleBadUnionStruct&& x) noexcept -{ - - m_my_union = std::move(x.m_my_union); - return *this; -} - -bool SimpleBadUnionStruct::operator ==( - const SimpleBadUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleBadUnionStruct::operator !=( - const SimpleBadUnionStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleBadUnionStruct::my_union( - const SimpleBadUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleBadUnionStruct::my_union( - SimpleBadUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleBadUnion& SimpleBadUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleBadUnion& SimpleBadUnionStruct::my_union() -{ - return m_my_union; -} - - - - -SimplBadDiscUnionStruct::SimplBadDiscUnionStruct() -{ - // Just to register all known types - registerTypesTypes(); -} - -SimplBadDiscUnionStruct::~SimplBadDiscUnionStruct() -{ -} - -SimplBadDiscUnionStruct::SimplBadDiscUnionStruct( - const SimplBadDiscUnionStruct& x) -{ - m_my_union = x.m_my_union; -} - -SimplBadDiscUnionStruct::SimplBadDiscUnionStruct( - SimplBadDiscUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); -} - -SimplBadDiscUnionStruct& SimplBadDiscUnionStruct::operator =( - const SimplBadDiscUnionStruct& x) -{ - - m_my_union = x.m_my_union; - return *this; -} - -SimplBadDiscUnionStruct& SimplBadDiscUnionStruct::operator =( - SimplBadDiscUnionStruct&& x) noexcept -{ - - m_my_union = std::move(x.m_my_union); - return *this; -} - -bool SimplBadDiscUnionStruct::operator ==( - const SimplBadDiscUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimplBadDiscUnionStruct::operator !=( - const SimplBadDiscUnionStruct& x) const -{ - return !(*this == x); -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimplBadDiscUnionStruct::my_union( - const SimpleBadDiscUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimplBadDiscUnionStruct::my_union( - SimpleBadDiscUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleBadDiscUnion& SimplBadDiscUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleBadDiscUnion& SimplBadDiscUnionStruct::my_union() -{ - return m_my_union; -} - - -// Include auxiliary functions like for serializing/deserializing. -#include "TypesCdrAux.ipp" - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/xtypes/idl/Types.h b/test/xtypes/idl/Types.h deleted file mode 100644 index e482676e515..00000000000 --- a/test/xtypes/idl/Types.h +++ /dev/null @@ -1,4432 +0,0 @@ -// 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 Types.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include -#include "Typesv1.h" - -#if FASTCDR_VERSION_MAJOR > 1 - -#ifndef _FAST_DDS_GENERATED_TYPES_H_ -#define _FAST_DDS_GENERATED_TYPES_H_ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TYPES_SOURCE) -#define TYPES_DllAPI __declspec( dllexport ) -#else -#define TYPES_DllAPI __declspec( dllimport ) -#endif // TYPES_SOURCE -#else -#define TYPES_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TYPES_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -class CdrSizeCalculator; -} // namespace fastcdr -} // namespace eprosima - - - -/*! - * @brief This class represents the enumeration MyEnum defined by the user in the IDL file. - * @ingroup Types - */ -enum MyEnum : uint32_t -{ - A, - B, - C -}; -/*! - * @brief This class represents the enumeration MyBadEnum defined by the user in the IDL file. - * @ingroup Types - */ -enum MyBadEnum : uint32_t -{ - A1, - B1, - C1 -}; - - -/*! - * @brief This class represents the structure MyEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyEnumStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyEnumStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyEnumStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct( - const MyEnumStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct( - MyEnumStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct& operator =( - const MyEnumStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct& operator =( - MyEnumStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyEnumStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MyEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyEnumStruct& x) const; - - /*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ - eProsima_user_DllExport void my_enum( - MyEnum _my_enum); - - /*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ - eProsima_user_DllExport MyEnum my_enum() const; - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyEnum& my_enum(); - -private: - - MyEnum m_my_enum{::A}; - -}; - - -/*! - * @brief This class represents the structure MyBadEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyBadEnumStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyBadEnumStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyBadEnumStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct( - const MyBadEnumStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct( - MyBadEnumStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct& operator =( - const MyBadEnumStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct& operator =( - MyBadEnumStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyBadEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyBadEnumStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MyBadEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyBadEnumStruct& x) const; - - /*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ - eProsima_user_DllExport void my_enum( - MyBadEnum _my_enum); - - /*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ - eProsima_user_DllExport MyBadEnum my_enum() const; - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyBadEnum& my_enum(); - -private: - - MyBadEnum m_my_enum{::A1}; - -}; -typedef MyEnum MyAliasEnum; - - - -/*! - * @brief This class represents the structure MyAliasEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyAliasEnumStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyAliasEnumStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyAliasEnumStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct( - const MyAliasEnumStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct( - MyAliasEnumStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct& operator =( - const MyAliasEnumStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct& operator =( - MyAliasEnumStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyAliasEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyAliasEnumStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MyAliasEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyAliasEnumStruct& x) const; - - /*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ - eProsima_user_DllExport void my_enum( - MyAliasEnum _my_enum); - - /*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ - eProsima_user_DllExport MyAliasEnum my_enum() const; - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyAliasEnum& my_enum(); - -private: - - MyAliasEnum m_my_enum{::A}; - -}; - - -/*! - * @brief This class represents the structure BasicStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct( - const BasicStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct( - BasicStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct& operator =( - const BasicStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct& operator =( - BasicStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - bool _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport bool my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - -private: - - bool m_my_bool{false}; - int32_t m_my_int32{0}; - std::string m_my_string; - -}; - - -/*! - * @brief This class represents the structure BasicNamesStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicNamesStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicNamesStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicNamesStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct( - const BasicNamesStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct( - BasicNamesStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct& operator =( - const BasicNamesStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct& operator =( - BasicNamesStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicNamesStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicNamesStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool_name - * @param _my_bool_name New value for member my_bool_name - */ - eProsima_user_DllExport void my_bool_name( - bool _my_bool_name); - - /*! - * @brief This function returns the value of member my_bool_name - * @return Value of member my_bool_name - */ - eProsima_user_DllExport bool my_bool_name() const; - - /*! - * @brief This function returns a reference to member my_bool_name - * @return Reference to member my_bool_name - */ - eProsima_user_DllExport bool& my_bool_name(); - - - /*! - * @brief This function sets a value in member my_int32_name - * @param _my_int32_name New value for member my_int32_name - */ - eProsima_user_DllExport void my_int32_name( - int32_t _my_int32_name); - - /*! - * @brief This function returns the value of member my_int32_name - * @return Value of member my_int32_name - */ - eProsima_user_DllExport int32_t my_int32_name() const; - - /*! - * @brief This function returns a reference to member my_int32_name - * @return Reference to member my_int32_name - */ - eProsima_user_DllExport int32_t& my_int32_name(); - - - /*! - * @brief This function copies the value in member my_string_name - * @param _my_string_name New value to be copied in member my_string_name - */ - eProsima_user_DllExport void my_string_name( - const std::string& _my_string_name); - - /*! - * @brief This function moves the value in member my_string_name - * @param _my_string_name New value to be moved in member my_string_name - */ - eProsima_user_DllExport void my_string_name( - std::string&& _my_string_name); - - /*! - * @brief This function returns a constant reference to member my_string_name - * @return Constant reference to member my_string_name - */ - eProsima_user_DllExport const std::string& my_string_name() const; - - /*! - * @brief This function returns a reference to member my_string_name - * @return Reference to member my_string_name - */ - eProsima_user_DllExport std::string& my_string_name(); - -private: - - bool m_my_bool_name{false}; - int32_t m_my_int32_name{0}; - std::string m_my_string_name; - -}; - - -/*! - * @brief This class represents the structure BasicBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicBadStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicBadStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicBadStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct( - const BasicBadStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct( - BasicBadStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct& operator =( - const BasicBadStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct& operator =( - BasicBadStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicBadStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicBadStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicBadStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicBadStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - uint8_t _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport uint8_t my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport uint8_t& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - -private: - - uint8_t m_my_bool{0}; - int32_t m_my_int32{0}; - std::string m_my_string; - -}; - - -/*! - * @brief This class represents the structure BasicWideStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicWideStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicWideStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicWideStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct( - const BasicWideStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct( - BasicWideStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct& operator =( - const BasicWideStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct& operator =( - BasicWideStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicWideStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicWideStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - bool _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport bool my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - - - /*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ - eProsima_user_DllExport void new_int32( - int32_t _new_int32); - - /*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ - eProsima_user_DllExport int32_t new_int32() const; - - /*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ - eProsima_user_DllExport int32_t& new_int32(); - - - /*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ - eProsima_user_DllExport void new_string( - const std::string& _new_string); - - /*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ - eProsima_user_DllExport void new_string( - std::string&& _new_string); - - /*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ - eProsima_user_DllExport const std::string& new_string() const; - - /*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ - eProsima_user_DllExport std::string& new_string(); - -private: - - bool m_my_bool{false}; - int32_t m_my_int32{0}; - std::string m_my_string; - int32_t m_new_int32{0}; - std::string m_new_string; - -}; - - -/*! - * @brief This class represents the structure BadBasicWideStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BadBasicWideStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BadBasicWideStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BadBasicWideStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct( - const BadBasicWideStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct( - BadBasicWideStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct& operator =( - const BadBasicWideStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct& operator =( - BadBasicWideStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BadBasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BadBasicWideStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BadBasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BadBasicWideStruct& x) const; - - /*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ - eProsima_user_DllExport void new_int32( - int32_t _new_int32); - - /*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ - eProsima_user_DllExport int32_t new_int32() const; - - /*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ - eProsima_user_DllExport int32_t& new_int32(); - - - /*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ - eProsima_user_DllExport void new_string( - const std::string& _new_string); - - /*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ - eProsima_user_DllExport void new_string( - std::string&& _new_string); - - /*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ - eProsima_user_DllExport const std::string& new_string() const; - - /*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ - eProsima_user_DllExport std::string& new_string(); - - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - bool _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport bool my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - -private: - - int32_t m_new_int32{0}; - std::string m_new_string; - bool m_my_bool{false}; - int32_t m_my_int32{0}; - std::string m_my_string; - -}; - - -/*! - * @brief This class represents the structure StringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class StringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport StringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~StringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct( - const StringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct( - StringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct& operator =( - const StringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct& operator =( - StringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x StringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const StringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x StringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const StringStruct& x) const; - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - -private: - - std::string m_my_string; - -}; - - -/*! - * @brief This class represents the structure LargeStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class LargeStringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LargeStringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LargeStringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct( - const LargeStringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct( - LargeStringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct& operator =( - const LargeStringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct& operator =( - LargeStringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LargeStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LargeStringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x LargeStringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LargeStringStruct& x) const; - - /*! - * @brief This function copies the value in member my_large_string - * @param _my_large_string New value to be copied in member my_large_string - */ - eProsima_user_DllExport void my_large_string( - const eprosima::fastcdr::fixed_string<41925>& _my_large_string); - - /*! - * @brief This function moves the value in member my_large_string - * @param _my_large_string New value to be moved in member my_large_string - */ - eProsima_user_DllExport void my_large_string( - eprosima::fastcdr::fixed_string<41925>&& _my_large_string); - - /*! - * @brief This function returns a constant reference to member my_large_string - * @return Constant reference to member my_large_string - */ - eProsima_user_DllExport const eprosima::fastcdr::fixed_string<41925>& my_large_string() const; - - /*! - * @brief This function returns a reference to member my_large_string - * @return Reference to member my_large_string - */ - eProsima_user_DllExport eprosima::fastcdr::fixed_string<41925>& my_large_string(); - -private: - - eprosima::fastcdr::fixed_string<41925> m_my_large_string; - -}; - - -/*! - * @brief This class represents the structure WStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class WStringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport WStringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~WStringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct( - const WStringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct( - WStringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct& operator =( - const WStringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct& operator =( - WStringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x WStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const WStringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x WStringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const WStringStruct& x) const; - - /*! - * @brief This function copies the value in member my_wstring - * @param _my_wstring New value to be copied in member my_wstring - */ - eProsima_user_DllExport void my_wstring( - const std::wstring& _my_wstring); - - /*! - * @brief This function moves the value in member my_wstring - * @param _my_wstring New value to be moved in member my_wstring - */ - eProsima_user_DllExport void my_wstring( - std::wstring&& _my_wstring); - - /*! - * @brief This function returns a constant reference to member my_wstring - * @return Constant reference to member my_wstring - */ - eProsima_user_DllExport const std::wstring& my_wstring() const; - - /*! - * @brief This function returns a reference to member my_wstring - * @return Reference to member my_wstring - */ - eProsima_user_DllExport std::wstring& my_wstring(); - -private: - - std::wstring m_my_wstring; - -}; - - -/*! - * @brief This class represents the structure LargeWStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class LargeWStringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LargeWStringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LargeWStringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct( - const LargeWStringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct( - LargeWStringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct& operator =( - const LargeWStringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct& operator =( - LargeWStringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LargeWStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LargeWStringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x LargeWStringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LargeWStringStruct& x) const; - - /*! - * @brief This function copies the value in member my_large_wstring - * @param _my_large_wstring New value to be copied in member my_large_wstring - */ - eProsima_user_DllExport void my_large_wstring( - const std::wstring& _my_large_wstring); - - /*! - * @brief This function moves the value in member my_large_wstring - * @param _my_large_wstring New value to be moved in member my_large_wstring - */ - eProsima_user_DllExport void my_large_wstring( - std::wstring&& _my_large_wstring); - - /*! - * @brief This function returns a constant reference to member my_large_wstring - * @return Constant reference to member my_large_wstring - */ - eProsima_user_DllExport const std::wstring& my_large_wstring() const; - - /*! - * @brief This function returns a reference to member my_large_wstring - * @return Reference to member my_large_wstring - */ - eProsima_user_DllExport std::wstring& my_large_wstring(); - -private: - - std::wstring m_my_large_wstring; - -}; - - -/*! - * @brief This class represents the structure ArrayStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct( - const ArrayStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct( - ArrayStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct& operator =( - const ArrayStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct& operator =( - ArrayStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array& my_array(); - -private: - - std::array m_my_array{0}; - -}; - - -/*! - * @brief This class represents the structure ArrayStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual( - const ArrayStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual( - ArrayStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual& operator =( - const ArrayStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual& operator =( - ArrayStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_array_equal - * @param _my_array_equal New value to be copied in member my_array_equal - */ - eProsima_user_DllExport void my_array_equal( - const std::array& _my_array_equal); - - /*! - * @brief This function moves the value in member my_array_equal - * @param _my_array_equal New value to be moved in member my_array_equal - */ - eProsima_user_DllExport void my_array_equal( - std::array&& _my_array_equal); - - /*! - * @brief This function returns a constant reference to member my_array_equal - * @return Constant reference to member my_array_equal - */ - eProsima_user_DllExport const std::array& my_array_equal() const; - - /*! - * @brief This function returns a reference to member my_array_equal - * @return Reference to member my_array_equal - */ - eProsima_user_DllExport std::array& my_array_equal(); - -private: - - std::array m_my_array_equal{0}; - -}; - - -/*! - * @brief This class represents the structure ArrayBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayBadStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayBadStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayBadStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct( - const ArrayBadStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct( - ArrayBadStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct& operator =( - const ArrayBadStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct& operator =( - ArrayBadStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayBadStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayBadStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayBadStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayBadStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array& my_array(); - -private: - - std::array m_my_array{0}; - -}; - - -/*! - * @brief This class represents the structure ArrayDimensionsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayDimensionsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayDimensionsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayDimensionsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct( - const ArrayDimensionsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct( - ArrayDimensionsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct& operator =( - const ArrayDimensionsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct& operator =( - ArrayDimensionsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayDimensionsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayDimensionsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayDimensionsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayDimensionsStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array, 2>& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array, 2>&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array, 2>& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array, 2>& my_array(); - -private: - - std::array, 2> m_my_array{ {{0}} }; - -}; - - -/*! - * @brief This class represents the structure ArraySizeStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArraySizeStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArraySizeStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArraySizeStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct( - const ArraySizeStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct( - ArraySizeStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct& operator =( - const ArraySizeStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct& operator =( - ArraySizeStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArraySizeStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArraySizeStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArraySizeStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArraySizeStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array& my_array(); - -private: - - std::array m_my_array{0}; - -}; - - - - -/*! - * @brief This class represents the structure SequenceStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct( - const SequenceStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct( - SequenceStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct& operator =( - const SequenceStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct& operator =( - SequenceStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - const std::vector& _my_sequence); - - /*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - std::vector&& _my_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ - eProsima_user_DllExport const std::vector& my_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ - eProsima_user_DllExport std::vector& my_sequence(); - -private: - - std::vector m_my_sequence; - -}; - - - - -/*! - * @brief This class represents the structure SequenceStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual( - const SequenceStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual( - SequenceStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual& operator =( - const SequenceStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual& operator =( - SequenceStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_sequence_equal - * @param _my_sequence_equal New value to be copied in member my_sequence_equal - */ - eProsima_user_DllExport void my_sequence_equal( - const std::vector& _my_sequence_equal); - - /*! - * @brief This function moves the value in member my_sequence_equal - * @param _my_sequence_equal New value to be moved in member my_sequence_equal - */ - eProsima_user_DllExport void my_sequence_equal( - std::vector&& _my_sequence_equal); - - /*! - * @brief This function returns a constant reference to member my_sequence_equal - * @return Constant reference to member my_sequence_equal - */ - eProsima_user_DllExport const std::vector& my_sequence_equal() const; - - /*! - * @brief This function returns a reference to member my_sequence_equal - * @return Reference to member my_sequence_equal - */ - eProsima_user_DllExport std::vector& my_sequence_equal(); - -private: - - std::vector m_my_sequence_equal; - -}; - - - - -/*! - * @brief This class represents the structure SequenceBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceBadStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceBadStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceBadStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct( - const SequenceBadStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct( - SequenceBadStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct& operator =( - const SequenceBadStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct& operator =( - SequenceBadStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceBadStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceBadStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceBadStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceBadStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - const std::vector& _my_sequence); - - /*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - std::vector&& _my_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ - eProsima_user_DllExport const std::vector& my_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ - eProsima_user_DllExport std::vector& my_sequence(); - -private: - - std::vector m_my_sequence; - -}; - - - - -/*! - * @brief This class represents the structure SequenceBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct( - const SequenceBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct( - SequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct& operator =( - const SequenceBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct& operator =( - SequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - const std::vector& _my_sequence); - - /*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - std::vector&& _my_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ - eProsima_user_DllExport const std::vector& my_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ - eProsima_user_DllExport std::vector& my_sequence(); - -private: - - std::vector m_my_sequence; - -}; - - - - - - -/*! - * @brief This class represents the structure SequenceSequenceStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceSequenceStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceSequenceStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceSequenceStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct( - const SequenceSequenceStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct( - SequenceSequenceStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct& operator =( - const SequenceSequenceStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct& operator =( - SequenceSequenceStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceSequenceStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceSequenceStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - const std::vector>& _my_sequence_sequence); - - /*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - std::vector>&& _my_sequence_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ - eProsima_user_DllExport const std::vector>& my_sequence_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ - eProsima_user_DllExport std::vector>& my_sequence_sequence(); - -private: - - std::vector> m_my_sequence_sequence; - -}; - - - - - - -/*! - * @brief This class represents the structure SequenceSequenceBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceSequenceBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceSequenceBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct( - const SequenceSequenceBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct( - SequenceSequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct& operator =( - const SequenceSequenceBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct& operator =( - SequenceSequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceSequenceBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceSequenceBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - const std::vector>& _my_sequence_sequence); - - /*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - std::vector>&& _my_sequence_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ - eProsima_user_DllExport const std::vector>& my_sequence_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ - eProsima_user_DllExport std::vector>& my_sequence_sequence(); - -private: - - std::vector> m_my_sequence_sequence; - -}; - - - - -/*! - * @brief This class represents the structure MapStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct( - const MapStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct( - MapStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct& operator =( - const MapStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct& operator =( - MapStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - -private: - - std::map m_my_map; - -}; - - - - -/*! - * @brief This class represents the structure MapStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class MapStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual( - const MapStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual( - MapStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual& operator =( - const MapStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual& operator =( - MapStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x MapStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_map_equal - * @param _my_map_equal New value to be copied in member my_map_equal - */ - eProsima_user_DllExport void my_map_equal( - const std::map& _my_map_equal); - - /*! - * @brief This function moves the value in member my_map_equal - * @param _my_map_equal New value to be moved in member my_map_equal - */ - eProsima_user_DllExport void my_map_equal( - std::map&& _my_map_equal); - - /*! - * @brief This function returns a constant reference to member my_map_equal - * @return Constant reference to member my_map_equal - */ - eProsima_user_DllExport const std::map& my_map_equal() const; - - /*! - * @brief This function returns a reference to member my_map_equal - * @return Reference to member my_map_equal - */ - eProsima_user_DllExport std::map& my_map_equal(); - -private: - - std::map m_my_map_equal; - -}; - - - - -/*! - * @brief This class represents the structure MapBadKeyStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBadKeyStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapBadKeyStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapBadKeyStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct( - const MapBadKeyStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct( - MapBadKeyStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct& operator =( - const MapBadKeyStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct& operator =( - MapBadKeyStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapBadKeyStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapBadKeyStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapBadKeyStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapBadKeyStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - -private: - - std::map m_my_map; - -}; - - - - -/*! - * @brief This class represents the structure MapBadElemStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBadElemStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapBadElemStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapBadElemStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct( - const MapBadElemStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct( - MapBadElemStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct& operator =( - const MapBadElemStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct& operator =( - MapBadElemStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapBadElemStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapBadElemStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapBadElemStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapBadElemStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - -private: - - std::map m_my_map; - -}; - - - - -/*! - * @brief This class represents the structure MapBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct( - const MapBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct( - MapBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct& operator =( - const MapBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct& operator =( - MapBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - -private: - - std::map m_my_map; - -}; - - - - - - -/*! - * @brief This class represents the structure MapMapStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapMapStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapMapStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapMapStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct( - const MapMapStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct( - MapMapStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct& operator =( - const MapMapStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct& operator =( - MapMapStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapMapStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapMapStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapMapStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapMapStruct& x) const; - - /*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - const std::map>& _my_map_map); - - /*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - std::map>&& _my_map_map); - - /*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ - eProsima_user_DllExport const std::map>& my_map_map() const; - - /*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ - eProsima_user_DllExport std::map>& my_map_map(); - -private: - - std::map> m_my_map_map; - -}; - - - - - - -/*! - * @brief This class represents the structure MapMapBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapMapBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapMapBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapMapBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct( - const MapMapBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct( - MapMapBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct& operator =( - const MapMapBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct& operator =( - MapMapBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapMapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapMapBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapMapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapMapBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - const std::map>& _my_map_map); - - /*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - std::map>&& _my_map_map); - - /*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ - eProsima_user_DllExport const std::map>& my_map_map() const; - - /*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ - eProsima_user_DllExport std::map>& my_map_map(); - -private: - - std::map> m_my_map_map; - -}; - - -/*! - * @brief This class represents the union SimpleUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion( - const SimpleUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion( - SimpleUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion& operator =( - const SimpleUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion& operator =( - SimpleUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - -private: - - int32_t m__d; - - int32_t m_first{0}; - int64_t m_second{0}; -}; - - -/*! - * @brief This class represents the union SimpleUnionNames defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionNames -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionNames(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionNames(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames( - const SimpleUnionNames& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames( - SimpleUnionNames&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames& operator =( - const SimpleUnionNames& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames& operator =( - SimpleUnionNames&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNames object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionNames& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNames object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionNames& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first_case - * @param _first_case New value for member first_case - */ - eProsima_user_DllExport void first_case( - int32_t _first_case); - - /*! - * @brief This function returns the value of member first_case - * @return Value of member first_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first_case() const; - - /*! - * @brief This function returns a reference to member first_case - * @return Reference to member first_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first_case(); - - - /*! - * @brief This function sets a value in member second_case - * @param _second_case New value for member second_case - */ - eProsima_user_DllExport void second_case( - int64_t _second_case); - - /*! - * @brief This function returns the value of member second_case - * @return Value of member second_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second_case() const; - - /*! - * @brief This function returns a reference to member second_case - * @return Reference to member second_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second_case(); - -private: - - int32_t m__d; - - int32_t m_first_case{0}; - int64_t m_second_case{0}; -}; - - -/*! - * @brief This class represents the union SimpleTypeUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleTypeUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleTypeUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleTypeUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion( - const SimpleTypeUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion( - SimpleTypeUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion& operator =( - const SimpleTypeUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion& operator =( - SimpleTypeUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleTypeUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleTypeUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - uint8_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - -private: - - int32_t m__d; - - uint8_t m_first{0}; - int64_t m_second{0}; -}; - - -/*! - * @brief This class represents the union SimpleBadUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleBadUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleBadUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleBadUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion( - const SimpleBadUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion( - SimpleBadUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion& operator =( - const SimpleBadUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion& operator =( - SimpleBadUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleBadUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleBadUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - -private: - - int32_t m__d; - - int32_t m_first{0}; - int64_t m_second{0}; -}; - - -/*! - * @brief This class represents the union SimpleBadDiscUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleBadDiscUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleBadDiscUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleBadDiscUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion( - const SimpleBadDiscUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion( - SimpleBadDiscUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion& operator =( - const SimpleBadDiscUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion& operator =( - SimpleBadDiscUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleBadDiscUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleBadDiscUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleBadDiscUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleBadDiscUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - uint8_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport uint8_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport uint8_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - -private: - - uint8_t m__d; - - int32_t m_first{0}; - int64_t m_second{0}; -}; - - -/*! - * @brief This class represents the structure SimpleUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct( - const SimpleUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct( - SimpleUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct& operator =( - const SimpleUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct& operator =( - SimpleUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleUnion& my_union(); - -private: - - SimpleUnion m_my_union; - -}; - - -/*! - * @brief This class represents the structure SimpleUnionStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual( - const SimpleUnionStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual( - SimpleUnionStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual& operator =( - const SimpleUnionStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual& operator =( - SimpleUnionStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_union_equal - * @param _my_union_equal New value to be copied in member my_union_equal - */ - eProsima_user_DllExport void my_union_equal( - const SimpleUnion& _my_union_equal); - - /*! - * @brief This function moves the value in member my_union_equal - * @param _my_union_equal New value to be moved in member my_union_equal - */ - eProsima_user_DllExport void my_union_equal( - SimpleUnion&& _my_union_equal); - - /*! - * @brief This function returns a constant reference to member my_union_equal - * @return Constant reference to member my_union_equal - */ - eProsima_user_DllExport const SimpleUnion& my_union_equal() const; - - /*! - * @brief This function returns a reference to member my_union_equal - * @return Reference to member my_union_equal - */ - eProsima_user_DllExport SimpleUnion& my_union_equal(); - -private: - - SimpleUnion m_my_union_equal; - -}; - - -/*! - * @brief This class represents the structure SimpleUnionNamesStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionNamesStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionNamesStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionNamesStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct( - const SimpleUnionNamesStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct( - SimpleUnionNamesStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct& operator =( - const SimpleUnionNamesStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct& operator =( - SimpleUnionNamesStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionNamesStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionNamesStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleUnionNames& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleUnionNames&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleUnionNames& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleUnionNames& my_union(); - -private: - - SimpleUnionNames m_my_union; - -}; - - -/*! - * @brief This class represents the structure SimpleTypeUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleTypeUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleTypeUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleTypeUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct( - const SimpleTypeUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct( - SimpleTypeUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct& operator =( - const SimpleTypeUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct& operator =( - SimpleTypeUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleTypeUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleTypeUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleTypeUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleTypeUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleTypeUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleTypeUnion& my_union(); - -private: - - SimpleTypeUnion m_my_union; - -}; - - -/*! - * @brief This class represents the structure SimpleBadUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleBadUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleBadUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleBadUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct( - const SimpleBadUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct( - SimpleBadUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct& operator =( - const SimpleBadUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct& operator =( - SimpleBadUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleBadUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleBadUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleBadUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleBadUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleBadUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleBadUnion& my_union(); - -private: - - SimpleBadUnion m_my_union; - -}; - - -/*! - * @brief This class represents the structure SimplBadDiscUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimplBadDiscUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimplBadDiscUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct( - const SimplBadDiscUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct( - SimplBadDiscUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct& operator =( - const SimplBadDiscUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct& operator =( - SimplBadDiscUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimplBadDiscUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimplBadDiscUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimplBadDiscUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimplBadDiscUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleBadDiscUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleBadDiscUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleBadDiscUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleBadDiscUnion& my_union(); - -private: - - SimpleBadDiscUnion m_my_union; - -}; - -#endif // _FAST_DDS_GENERATED_TYPES_H_ - - - -#endif // FASTCDR_VERSION_MAJOR > 1 diff --git a/test/xtypes/idl/Types.idl b/test/xtypes/idl/Types.idl deleted file mode 100644 index fea3438ed82..00000000000 --- a/test/xtypes/idl/Types.idl +++ /dev/null @@ -1,271 +0,0 @@ -// Enum - -enum MyEnum -{ - A, - B, - C -}; - -enum MyBadEnum -{ - A1, - B1, - C1 -}; - -struct MyEnumStruct -{ - MyEnum my_enum; -}; - -struct MyBadEnumStruct -{ - MyBadEnum my_enum; -}; - -// Alias - -typedef MyEnum MyAliasEnum; - -struct MyAliasEnumStruct -{ - MyAliasEnum my_enum; // Keep same name -}; - -// All basic types - -struct BasicStruct -{ - boolean my_bool; - long my_int32; - string my_string; -}; - -struct BasicNamesStruct -{ - boolean my_bool_name; - long my_int32_name; - string my_string_name; -}; - -struct BasicBadStruct -{ - octet my_bool; - long my_int32; - string my_string; -}; - -// Wide Struct - -struct BasicWideStruct -{ - boolean my_bool; - long my_int32; - string my_string; - long new_int32; - string new_string; -}; - -// Bad Wide Struct - -struct BadBasicWideStruct -{ - long new_int32; - string new_string; - boolean my_bool; - long my_int32; - string my_string; -}; - -// String bounds - -struct StringStruct -{ - string my_string; -}; - -struct LargeStringStruct -{ - string<41925> my_large_string; -}; - -// WString bounds - -struct WStringStruct -{ - wstring my_wstring; -}; - -struct LargeWStringStruct -{ - wstring<41925> my_large_wstring; -}; - -// Array dimensions and size - -struct ArrayStruct -{ - long my_array[2]; -}; - -struct ArrayStructEqual -{ - long my_array_equal[2]; -}; - -struct ArrayBadStruct -{ - octet my_array[2]; -}; - -struct ArrayDimensionsStruct -{ - long my_array[2][2]; -}; - -struct ArraySizeStruct -{ - long my_array[5]; -}; - -// Sequence bounds - -struct SequenceStruct -{ - sequence my_sequence; -}; - -struct SequenceStructEqual -{ - sequence my_sequence_equal; -}; - -struct SequenceBadStruct -{ - sequence my_sequence; -}; - -struct SequenceBoundsStruct -{ - sequence my_sequence; -}; - -struct SequenceSequenceStruct -{ - sequence, 3> my_sequence_sequence; -}; - -struct SequenceSequenceBoundsStruct -{ - sequence, 5> my_sequence_sequence; -}; - -// Map bounds - -struct MapStruct -{ - map my_map; -}; - -struct MapStructEqual -{ - map my_map_equal; -}; - -struct MapBadKeyStruct -{ - map my_map; -}; - -struct MapBadElemStruct -{ - map my_map; -}; - -struct MapBoundsStruct -{ - map my_map; -}; - -struct MapMapStruct -{ - map , 2> my_map_map; -}; - -struct MapMapBoundsStruct -{ - map , 3> my_map_map; -}; - -// Unions - -union SimpleUnion switch (long) -{ - case A: - long first; - case B: - long long second; -}; - -union SimpleUnionNames switch (long) -{ - case A: - long first_case; - case B: - long long second_case; -}; - -union SimpleTypeUnion switch (long) -{ - case A: - octet first; - case B: - long long second; -}; - -union SimpleBadUnion switch (long) -{ - case A: - long first; - case C: - long long second; -}; - -union SimpleBadDiscUnion switch (octet) -{ - case 0: - long first; - case 1: - long long second; -}; - -struct SimpleUnionStruct -{ - SimpleUnion my_union; -}; - -struct SimpleUnionStructEqual -{ - SimpleUnion my_union_equal; -}; - -struct SimpleUnionNamesStruct -{ - SimpleUnionNames my_union; -}; - -struct SimpleTypeUnionStruct -{ - SimpleTypeUnion my_union; -}; - -struct SimpleBadUnionStruct -{ - SimpleBadUnion my_union; -}; - -struct SimplBadDiscUnionStruct -{ - SimpleBadDiscUnion my_union; -}; \ No newline at end of file diff --git a/test/xtypes/idl/TypesCdrAux.hpp b/test/xtypes/idl/TypesCdrAux.hpp deleted file mode 100644 index 14992724933..00000000000 --- a/test/xtypes/idl/TypesCdrAux.hpp +++ /dev/null @@ -1,427 +0,0 @@ -// 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_TYPESCDRAUX_HPP_ -#define _FAST_DDS_GENERATED_TYPESCDRAUX_HPP_ - -#include "Types.h" - -constexpr uint32_t SimpleUnionStruct_max_cdr_typesize {24UL}; -constexpr uint32_t SimpleUnionStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SequenceSequenceBoundsStruct_max_cdr_typesize {132UL}; -constexpr uint32_t SequenceSequenceBoundsStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t MyAliasEnumStruct_max_cdr_typesize {8UL}; -constexpr uint32_t MyAliasEnumStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t ArrayBadStruct_max_cdr_typesize {6UL}; -constexpr uint32_t ArrayBadStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t MapBadKeyStruct_max_cdr_typesize {24UL}; -constexpr uint32_t MapBadKeyStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SimpleBadUnionStruct_max_cdr_typesize {24UL}; -constexpr uint32_t SimpleBadUnionStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t MyEnumStruct_max_cdr_typesize {8UL}; -constexpr uint32_t MyEnumStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t ArrayStructEqual_max_cdr_typesize {12UL}; -constexpr uint32_t ArrayStructEqual_max_key_cdr_typesize {0UL}; - -constexpr uint32_t LargeWStringStruct_max_cdr_typesize {83858UL}; -constexpr uint32_t LargeWStringStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t WStringStruct_max_cdr_typesize {518UL}; -constexpr uint32_t WStringStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SequenceStruct_max_cdr_typesize {16UL}; -constexpr uint32_t SequenceStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SimpleTypeUnionStruct_max_cdr_typesize {24UL}; -constexpr uint32_t SimpleTypeUnionStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t ArrayDimensionsStruct_max_cdr_typesize {20UL}; -constexpr uint32_t ArrayDimensionsStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SequenceSequenceStruct_max_cdr_typesize {48UL}; -constexpr uint32_t SequenceSequenceStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t MapBoundsStruct_max_cdr_typesize {40UL}; -constexpr uint32_t MapBoundsStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SequenceStructEqual_max_cdr_typesize {16UL}; -constexpr uint32_t SequenceStructEqual_max_key_cdr_typesize {0UL}; - -constexpr uint32_t MapStructEqual_max_cdr_typesize {24UL}; -constexpr uint32_t MapStructEqual_max_key_cdr_typesize {0UL}; - -constexpr uint32_t BasicStruct_max_cdr_typesize {272UL}; -constexpr uint32_t BasicStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SequenceBoundsStruct_max_cdr_typesize {24UL}; -constexpr uint32_t SequenceBoundsStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t MapMapStruct_max_cdr_typesize {60UL}; -constexpr uint32_t MapMapStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t BasicWideStruct_max_cdr_typesize {536UL}; -constexpr uint32_t BasicWideStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t SimplBadDiscUnionStruct_max_cdr_typesize {24UL}; -constexpr uint32_t SimplBadDiscUnionStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t MapStruct_max_cdr_typesize {24UL}; -constexpr uint32_t MapStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t MyBadEnumStruct_max_cdr_typesize {8UL}; -constexpr uint32_t MyBadEnumStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SequenceBadStruct_max_cdr_typesize {10UL}; -constexpr uint32_t SequenceBadStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SimpleUnionNamesStruct_max_cdr_typesize {24UL}; -constexpr uint32_t SimpleUnionNamesStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t LargeStringStruct_max_cdr_typesize {41934UL}; -constexpr uint32_t LargeStringStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t ArrayStruct_max_cdr_typesize {12UL}; -constexpr uint32_t ArrayStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t BadBasicWideStruct_max_cdr_typesize {536UL}; -constexpr uint32_t BadBasicWideStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t ArraySizeStruct_max_cdr_typesize {24UL}; -constexpr uint32_t ArraySizeStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t MapBadElemStruct_max_cdr_typesize {40UL}; -constexpr uint32_t MapBadElemStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t SimpleUnionStructEqual_max_cdr_typesize {24UL}; -constexpr uint32_t SimpleUnionStructEqual_max_key_cdr_typesize {0UL}; - -constexpr uint32_t BasicBadStruct_max_cdr_typesize {272UL}; -constexpr uint32_t BasicBadStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t BasicNamesStruct_max_cdr_typesize {272UL}; -constexpr uint32_t BasicNamesStruct_max_key_cdr_typesize {0UL}; - -constexpr uint32_t StringStruct_max_cdr_typesize {264UL}; -constexpr uint32_t StringStruct_max_key_cdr_typesize {0UL}; - - -constexpr uint32_t MapMapBoundsStruct_max_cdr_typesize {108UL}; -constexpr uint32_t MapMapBoundsStruct_max_key_cdr_typesize {0UL}; - - -namespace eprosima { -namespace fastcdr { - -class Cdr; -class CdrSizeCalculator; - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MyEnumStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MyBadEnumStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MyAliasEnumStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicNamesStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicBadStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicWideStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BadBasicWideStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const StringStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LargeStringStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const WStringStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LargeWStringStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayStructEqual& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayBadStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayDimensionsStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArraySizeStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceStructEqual& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceBadStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceBoundsStruct& data); - - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceSequenceStruct& data); - - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceSequenceBoundsStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapStructEqual& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapBadKeyStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapBadElemStruct& data); - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapBoundsStruct& data); - - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapMapStruct& data); - - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapMapBoundsStruct& data); - - - - - - - - - - - - - - - - - - - - - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionStructEqual& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionNamesStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleTypeUnionStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleBadUnionStruct& data); - - - -eProsima_user_DllExport void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimplBadDiscUnionStruct& data); - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_TYPESCDRAUX_HPP_ - diff --git a/test/xtypes/idl/TypesCdrAux.ipp b/test/xtypes/idl/TypesCdrAux.ipp deleted file mode 100644 index 5d6735bcfef..00000000000 --- a/test/xtypes/idl/TypesCdrAux.ipp +++ /dev/null @@ -1,3543 +0,0 @@ -// 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_TYPESCDRAUX_IPP_ -#define _FAST_DDS_GENERATED_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 MyEnumStruct& 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.my_enum(), 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 MyEnumStruct& 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.my_enum() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MyEnumStruct& 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.my_enum(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MyEnumStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MyBadEnumStruct& 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.my_enum(), 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 MyBadEnumStruct& 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.my_enum() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MyBadEnumStruct& 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.my_enum(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MyBadEnumStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MyAliasEnumStruct& 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.my_enum(), 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 MyAliasEnumStruct& 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.my_enum() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MyAliasEnumStruct& 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.my_enum(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MyAliasEnumStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const BasicStruct& 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.my_bool(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.my_int32(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.my_string(), 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 BasicStruct& 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.my_bool() - << eprosima::fastcdr::MemberId(1) << data.my_int32() - << eprosima::fastcdr::MemberId(2) << data.my_string() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - BasicStruct& 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.my_bool(); - break; - - case 1: - dcdr >> data.my_int32(); - break; - - case 2: - dcdr >> data.my_string(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const BasicNamesStruct& 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.my_bool_name(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.my_int32_name(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.my_string_name(), current_alignment); - - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const BasicNamesStruct& 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.my_bool_name() - << eprosima::fastcdr::MemberId(1) << data.my_int32_name() - << eprosima::fastcdr::MemberId(2) << data.my_string_name() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - BasicNamesStruct& 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.my_bool_name(); - break; - - case 1: - dcdr >> data.my_int32_name(); - break; - - case 2: - dcdr >> data.my_string_name(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicNamesStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const BasicBadStruct& 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.my_bool(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.my_int32(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.my_string(), 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 BasicBadStruct& 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.my_bool() - << eprosima::fastcdr::MemberId(1) << data.my_int32() - << eprosima::fastcdr::MemberId(2) << data.my_string() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - BasicBadStruct& 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.my_bool(); - break; - - case 1: - dcdr >> data.my_int32(); - break; - - case 2: - dcdr >> data.my_string(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicBadStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const BasicWideStruct& 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.my_bool(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.my_int32(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.my_string(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), - data.new_int32(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), - data.new_string(), 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 BasicWideStruct& 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.my_bool() - << eprosima::fastcdr::MemberId(1) << data.my_int32() - << eprosima::fastcdr::MemberId(2) << data.my_string() - << eprosima::fastcdr::MemberId(3) << data.new_int32() - << eprosima::fastcdr::MemberId(4) << data.new_string() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - BasicWideStruct& 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.my_bool(); - break; - - case 1: - dcdr >> data.my_int32(); - break; - - case 2: - dcdr >> data.my_string(); - break; - - case 3: - dcdr >> data.new_int32(); - break; - - case 4: - dcdr >> data.new_string(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BasicWideStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const BadBasicWideStruct& 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.new_int32(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.new_string(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.my_bool(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), - data.my_int32(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), - data.my_string(), 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 BadBasicWideStruct& 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.new_int32() - << eprosima::fastcdr::MemberId(1) << data.new_string() - << eprosima::fastcdr::MemberId(2) << data.my_bool() - << eprosima::fastcdr::MemberId(3) << data.my_int32() - << eprosima::fastcdr::MemberId(4) << data.my_string() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - BadBasicWideStruct& 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.new_int32(); - break; - - case 1: - dcdr >> data.new_string(); - break; - - case 2: - dcdr >> data.my_bool(); - break; - - case 3: - dcdr >> data.my_int32(); - break; - - case 4: - dcdr >> data.my_string(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const BadBasicWideStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const StringStruct& 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.my_string(), 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 StringStruct& 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.my_string() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - StringStruct& 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.my_string(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const StringStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const LargeStringStruct& 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.my_large_string(), 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 LargeStringStruct& 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.my_large_string() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - LargeStringStruct& 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.my_large_string(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LargeStringStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const WStringStruct& 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.my_wstring(), 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 WStringStruct& 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.my_wstring() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - WStringStruct& 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.my_wstring(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const WStringStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const LargeWStringStruct& 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.my_large_wstring(), 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 LargeWStringStruct& 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.my_large_wstring() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - LargeWStringStruct& 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.my_large_wstring(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const LargeWStringStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const ArrayStruct& 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.my_array(), 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 ArrayStruct& 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.my_array() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ArrayStruct& 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.my_array(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const ArrayStructEqual& 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.my_array_equal(), 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 ArrayStructEqual& 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.my_array_equal() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ArrayStructEqual& 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.my_array_equal(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayStructEqual& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const ArrayBadStruct& 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.my_array(), 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 ArrayBadStruct& 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.my_array() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ArrayBadStruct& 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.my_array(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayBadStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const ArrayDimensionsStruct& 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.my_array(), 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 ArrayDimensionsStruct& 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.my_array() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ArrayDimensionsStruct& 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.my_array(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArrayDimensionsStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const ArraySizeStruct& 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.my_array(), 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 ArraySizeStruct& 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.my_array() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - ArraySizeStruct& 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.my_array(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const ArraySizeStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SequenceStruct& 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.my_sequence(), 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 SequenceStruct& 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.my_sequence() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SequenceStruct& 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.my_sequence(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SequenceStructEqual& 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.my_sequence_equal(), 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 SequenceStructEqual& 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.my_sequence_equal() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SequenceStructEqual& 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.my_sequence_equal(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceStructEqual& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SequenceBadStruct& 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.my_sequence(), 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 SequenceBadStruct& 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.my_sequence() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SequenceBadStruct& 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.my_sequence(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceBadStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SequenceBoundsStruct& 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.my_sequence(), 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 SequenceBoundsStruct& 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.my_sequence() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SequenceBoundsStruct& 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.my_sequence(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceBoundsStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SequenceSequenceStruct& 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.my_sequence_sequence(), 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 SequenceSequenceStruct& 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.my_sequence_sequence() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SequenceSequenceStruct& 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.my_sequence_sequence(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceSequenceStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SequenceSequenceBoundsStruct& 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.my_sequence_sequence(), 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 SequenceSequenceBoundsStruct& 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.my_sequence_sequence() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SequenceSequenceBoundsStruct& 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.my_sequence_sequence(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SequenceSequenceBoundsStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MapStruct& 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.my_map(), 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 MapStruct& 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.my_map() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MapStruct& 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.my_map(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MapStructEqual& 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.my_map_equal(), 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 MapStructEqual& 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.my_map_equal() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MapStructEqual& 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.my_map_equal(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapStructEqual& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MapBadKeyStruct& 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.my_map(), 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 MapBadKeyStruct& 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.my_map() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MapBadKeyStruct& 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.my_map(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapBadKeyStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MapBadElemStruct& 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.my_map(), 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 MapBadElemStruct& 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.my_map() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MapBadElemStruct& 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.my_map(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapBadElemStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MapBoundsStruct& 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.my_map(), 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 MapBoundsStruct& 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.my_map() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MapBoundsStruct& 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.my_map(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapBoundsStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MapMapStruct& 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.my_map_map(), 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 MapMapStruct& 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.my_map_map() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MapMapStruct& 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.my_map_map(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapMapStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const MapMapBoundsStruct& 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.my_map_map(), 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 MapMapBoundsStruct& 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.my_map_map() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - MapMapBoundsStruct& 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.my_map_map(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const MapMapBoundsStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleUnion& 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 A: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.first(), current_alignment); - break; - - case B: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.second(), current_alignment); - break; - - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnion& 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 A: - scdr << eprosima::fastcdr::MemberId(1) << data.first(); - break; - - case B: - scdr << eprosima::fastcdr::MemberId(2) << data.second(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleUnion& 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 A: - dcdr >> data.first(); - break; - - case B: - dcdr >> data.second(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleUnionNames& 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 A: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.first_case(), current_alignment); - break; - - case B: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.second_case(), current_alignment); - break; - - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionNames& 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 A: - scdr << eprosima::fastcdr::MemberId(1) << data.first_case(); - break; - - case B: - scdr << eprosima::fastcdr::MemberId(2) << data.second_case(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleUnionNames& 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 A: - dcdr >> data.first_case(); - break; - - case B: - dcdr >> data.second_case(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleTypeUnion& 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 A: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.first(), current_alignment); - break; - - case B: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.second(), current_alignment); - break; - - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleTypeUnion& 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 A: - scdr << eprosima::fastcdr::MemberId(1) << data.first(); - break; - - case B: - scdr << eprosima::fastcdr::MemberId(2) << data.second(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleTypeUnion& 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 A: - dcdr >> data.first(); - break; - - case B: - dcdr >> data.second(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleBadUnion& 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 A: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.first(), current_alignment); - break; - - case C: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.second(), current_alignment); - break; - - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleBadUnion& 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 A: - scdr << eprosima::fastcdr::MemberId(1) << data.first(); - break; - - case C: - scdr << eprosima::fastcdr::MemberId(2) << data.second(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleBadUnion& 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 A: - dcdr >> data.first(); - break; - - case C: - dcdr >> data.second(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleBadDiscUnion& 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 0: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.first(), current_alignment); - break; - - case 1: - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.second(), current_alignment); - break; - - default: - break; - } - - calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); - - return calculated_size; -} - - -template<> -eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& scdr, - const SimpleBadDiscUnion& 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 0: - scdr << eprosima::fastcdr::MemberId(1) << data.first(); - break; - - case 1: - scdr << eprosima::fastcdr::MemberId(2) << data.second(); - break; - - default: - break; - } - - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleBadDiscUnion& 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 0: - dcdr >> data.first(); - break; - - case 1: - dcdr >> data.second(); - break; - - default: - break; - } - ret_value = false; - break; - } - return ret_value; - }); -} - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleUnionStruct& 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.my_union(), 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 SimpleUnionStruct& 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.my_union() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleUnionStruct& 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.my_union(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleUnionStructEqual& 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.my_union_equal(), 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 SimpleUnionStructEqual& 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.my_union_equal() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleUnionStructEqual& 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.my_union_equal(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionStructEqual& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleUnionNamesStruct& 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.my_union(), 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 SimpleUnionNamesStruct& 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.my_union() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleUnionNamesStruct& 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.my_union(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleUnionNamesStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleTypeUnionStruct& 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.my_union(), 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 SimpleTypeUnionStruct& 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.my_union() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleTypeUnionStruct& 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.my_union(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleTypeUnionStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimpleBadUnionStruct& 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.my_union(), 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 SimpleBadUnionStruct& 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.my_union() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimpleBadUnionStruct& 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.my_union(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimpleBadUnionStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - - -template<> -eProsima_user_DllExport size_t calculate_serialized_size( - eprosima::fastcdr::CdrSizeCalculator& calculator, - const SimplBadDiscUnionStruct& 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.my_union(), 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 SimplBadDiscUnionStruct& 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.my_union() -; - scdr.end_serialize_type(current_state); -} - -template<> -eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr, - SimplBadDiscUnionStruct& 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.my_union(); - break; - - default: - ret_value = false; - break; - } - return ret_value; - }); -} - -void serialize_key( - eprosima::fastcdr::Cdr& scdr, - const SimplBadDiscUnionStruct& data) -{ - static_cast(scdr); - static_cast(data); -} - - - -} // namespace fastcdr -} // namespace eprosima - -#endif // _FAST_DDS_GENERATED_TYPESCDRAUX_IPP_ - diff --git a/test/xtypes/idl/TypesPubSubTypes.cxx b/test/xtypes/idl/TypesPubSubTypes.cxx deleted file mode 100644 index 0c0a8f0363e..00000000000 --- a/test/xtypes/idl/TypesPubSubTypes.cxx +++ /dev/null @@ -1,6927 +0,0 @@ -// 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 TypesPubSubTypes.cpp - * This header file contains the implementation of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#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; - - - -MyEnumStructPubSubType::MyEnumStructPubSubType() -{ - setName("MyEnumStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MyEnumStruct::getMaxCdrSerializedSize()); -#else - MyEnumStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = MyEnumStruct_max_key_cdr_typesize > 16 ? MyEnumStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MyEnumStructPubSubType::~MyEnumStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MyEnumStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MyEnumStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool MyEnumStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MyEnumStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function MyEnumStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* MyEnumStructPubSubType::createData() -{ - return reinterpret_cast(new MyEnumStruct()); -} - -void MyEnumStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MyEnumStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MyEnumStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MyEnumStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || MyEnumStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -MyBadEnumStructPubSubType::MyBadEnumStructPubSubType() -{ - setName("MyBadEnumStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MyBadEnumStruct::getMaxCdrSerializedSize()); -#else - MyBadEnumStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = MyBadEnumStruct_max_key_cdr_typesize > 16 ? MyBadEnumStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MyBadEnumStructPubSubType::~MyBadEnumStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MyBadEnumStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MyBadEnumStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool MyBadEnumStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MyBadEnumStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function MyBadEnumStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* MyBadEnumStructPubSubType::createData() -{ - return reinterpret_cast(new MyBadEnumStruct()); -} - -void MyBadEnumStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MyBadEnumStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MyBadEnumStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MyBadEnumStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || MyBadEnumStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - -MyAliasEnumStructPubSubType::MyAliasEnumStructPubSubType() -{ - setName("MyAliasEnumStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MyAliasEnumStruct::getMaxCdrSerializedSize()); -#else - MyAliasEnumStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = MyAliasEnumStruct_max_key_cdr_typesize > 16 ? MyAliasEnumStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MyAliasEnumStructPubSubType::~MyAliasEnumStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MyAliasEnumStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MyAliasEnumStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool MyAliasEnumStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MyAliasEnumStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function MyAliasEnumStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* MyAliasEnumStructPubSubType::createData() -{ - return reinterpret_cast(new MyAliasEnumStruct()); -} - -void MyAliasEnumStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MyAliasEnumStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MyAliasEnumStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MyAliasEnumStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || MyAliasEnumStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -BasicStructPubSubType::BasicStructPubSubType() -{ - setName("BasicStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(BasicStruct::getMaxCdrSerializedSize()); -#else - BasicStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = BasicStruct_max_key_cdr_typesize > 16 ? BasicStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -BasicStructPubSubType::~BasicStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool BasicStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - BasicStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool BasicStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - BasicStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function BasicStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* BasicStructPubSubType::createData() -{ - return reinterpret_cast(new BasicStruct()); -} - -void BasicStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool BasicStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - BasicStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - BasicStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || BasicStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -BasicNamesStructPubSubType::BasicNamesStructPubSubType() -{ - setName("BasicNamesStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(BasicNamesStruct::getMaxCdrSerializedSize()); -#else - BasicNamesStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = BasicNamesStruct_max_key_cdr_typesize > 16 ? BasicNamesStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -BasicNamesStructPubSubType::~BasicNamesStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool BasicNamesStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - BasicNamesStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool BasicNamesStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - BasicNamesStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function BasicNamesStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* BasicNamesStructPubSubType::createData() -{ - return reinterpret_cast(new BasicNamesStruct()); -} - -void BasicNamesStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool BasicNamesStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - BasicNamesStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - BasicNamesStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || BasicNamesStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -BasicBadStructPubSubType::BasicBadStructPubSubType() -{ - setName("BasicBadStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(BasicBadStruct::getMaxCdrSerializedSize()); -#else - BasicBadStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = BasicBadStruct_max_key_cdr_typesize > 16 ? BasicBadStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -BasicBadStructPubSubType::~BasicBadStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool BasicBadStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - BasicBadStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool BasicBadStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - BasicBadStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function BasicBadStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* BasicBadStructPubSubType::createData() -{ - return reinterpret_cast(new BasicBadStruct()); -} - -void BasicBadStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool BasicBadStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - BasicBadStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - BasicBadStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || BasicBadStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -BasicWideStructPubSubType::BasicWideStructPubSubType() -{ - setName("BasicWideStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(BasicWideStruct::getMaxCdrSerializedSize()); -#else - BasicWideStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = BasicWideStruct_max_key_cdr_typesize > 16 ? BasicWideStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -BasicWideStructPubSubType::~BasicWideStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool BasicWideStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - BasicWideStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool BasicWideStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - BasicWideStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function BasicWideStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* BasicWideStructPubSubType::createData() -{ - return reinterpret_cast(new BasicWideStruct()); -} - -void BasicWideStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool BasicWideStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - BasicWideStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - BasicWideStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || BasicWideStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -BadBasicWideStructPubSubType::BadBasicWideStructPubSubType() -{ - setName("BadBasicWideStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(BadBasicWideStruct::getMaxCdrSerializedSize()); -#else - BadBasicWideStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = BadBasicWideStruct_max_key_cdr_typesize > 16 ? BadBasicWideStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -BadBasicWideStructPubSubType::~BadBasicWideStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool BadBasicWideStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - BadBasicWideStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool BadBasicWideStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - BadBasicWideStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function BadBasicWideStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* BadBasicWideStructPubSubType::createData() -{ - return reinterpret_cast(new BadBasicWideStruct()); -} - -void BadBasicWideStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool BadBasicWideStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - BadBasicWideStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - BadBasicWideStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || BadBasicWideStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -StringStructPubSubType::StringStructPubSubType() -{ - setName("StringStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(StringStruct::getMaxCdrSerializedSize()); -#else - StringStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = StringStruct_max_key_cdr_typesize > 16 ? StringStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -StringStructPubSubType::~StringStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool StringStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - StringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool StringStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - StringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function StringStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* StringStructPubSubType::createData() -{ - return reinterpret_cast(new StringStruct()); -} - -void StringStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool StringStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - StringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - StringStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || StringStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -LargeStringStructPubSubType::LargeStringStructPubSubType() -{ - setName("LargeStringStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(LargeStringStruct::getMaxCdrSerializedSize()); -#else - LargeStringStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = LargeStringStruct_max_key_cdr_typesize > 16 ? LargeStringStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -LargeStringStructPubSubType::~LargeStringStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool LargeStringStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - LargeStringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool LargeStringStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - LargeStringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function LargeStringStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* LargeStringStructPubSubType::createData() -{ - return reinterpret_cast(new LargeStringStruct()); -} - -void LargeStringStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool LargeStringStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - LargeStringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - LargeStringStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || LargeStringStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -WStringStructPubSubType::WStringStructPubSubType() -{ - setName("WStringStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(WStringStruct::getMaxCdrSerializedSize()); -#else - WStringStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = WStringStruct_max_key_cdr_typesize > 16 ? WStringStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -WStringStructPubSubType::~WStringStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool WStringStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - WStringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool WStringStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - WStringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function WStringStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* WStringStructPubSubType::createData() -{ - return reinterpret_cast(new WStringStruct()); -} - -void WStringStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool WStringStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - WStringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - WStringStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || WStringStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -LargeWStringStructPubSubType::LargeWStringStructPubSubType() -{ - setName("LargeWStringStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(LargeWStringStruct::getMaxCdrSerializedSize()); -#else - LargeWStringStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = LargeWStringStruct_max_key_cdr_typesize > 16 ? LargeWStringStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -LargeWStringStructPubSubType::~LargeWStringStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool LargeWStringStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - LargeWStringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool LargeWStringStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - LargeWStringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function LargeWStringStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* LargeWStringStructPubSubType::createData() -{ - return reinterpret_cast(new LargeWStringStruct()); -} - -void LargeWStringStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool LargeWStringStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - LargeWStringStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - LargeWStringStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || LargeWStringStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -ArrayStructPubSubType::ArrayStructPubSubType() -{ - setName("ArrayStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ArrayStruct::getMaxCdrSerializedSize()); -#else - ArrayStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = ArrayStruct_max_key_cdr_typesize > 16 ? ArrayStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ArrayStructPubSubType::~ArrayStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ArrayStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ArrayStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool ArrayStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ArrayStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function ArrayStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* ArrayStructPubSubType::createData() -{ - return reinterpret_cast(new ArrayStruct()); -} - -void ArrayStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ArrayStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ArrayStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ArrayStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || ArrayStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -ArrayStructEqualPubSubType::ArrayStructEqualPubSubType() -{ - setName("ArrayStructEqual"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ArrayStructEqual::getMaxCdrSerializedSize()); -#else - ArrayStructEqual_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = ArrayStructEqual_max_key_cdr_typesize > 16 ? ArrayStructEqual_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ArrayStructEqualPubSubType::~ArrayStructEqualPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ArrayStructEqualPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ArrayStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool ArrayStructEqualPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ArrayStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function ArrayStructEqualPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* ArrayStructEqualPubSubType::createData() -{ - return reinterpret_cast(new ArrayStructEqual()); -} - -void ArrayStructEqualPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ArrayStructEqualPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ArrayStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ArrayStructEqual_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || ArrayStructEqual_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -ArrayBadStructPubSubType::ArrayBadStructPubSubType() -{ - setName("ArrayBadStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ArrayBadStruct::getMaxCdrSerializedSize()); -#else - ArrayBadStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = ArrayBadStruct_max_key_cdr_typesize > 16 ? ArrayBadStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ArrayBadStructPubSubType::~ArrayBadStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ArrayBadStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ArrayBadStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool ArrayBadStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ArrayBadStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function ArrayBadStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* ArrayBadStructPubSubType::createData() -{ - return reinterpret_cast(new ArrayBadStruct()); -} - -void ArrayBadStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ArrayBadStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ArrayBadStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ArrayBadStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || ArrayBadStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -ArrayDimensionsStructPubSubType::ArrayDimensionsStructPubSubType() -{ - setName("ArrayDimensionsStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ArrayDimensionsStruct::getMaxCdrSerializedSize()); -#else - ArrayDimensionsStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = ArrayDimensionsStruct_max_key_cdr_typesize > 16 ? ArrayDimensionsStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ArrayDimensionsStructPubSubType::~ArrayDimensionsStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ArrayDimensionsStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ArrayDimensionsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool ArrayDimensionsStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ArrayDimensionsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function ArrayDimensionsStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* ArrayDimensionsStructPubSubType::createData() -{ - return reinterpret_cast(new ArrayDimensionsStruct()); -} - -void ArrayDimensionsStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ArrayDimensionsStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ArrayDimensionsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ArrayDimensionsStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || ArrayDimensionsStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -ArraySizeStructPubSubType::ArraySizeStructPubSubType() -{ - setName("ArraySizeStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(ArraySizeStruct::getMaxCdrSerializedSize()); -#else - ArraySizeStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = ArraySizeStruct_max_key_cdr_typesize > 16 ? ArraySizeStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -ArraySizeStructPubSubType::~ArraySizeStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool ArraySizeStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - ArraySizeStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool ArraySizeStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - ArraySizeStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function ArraySizeStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* ArraySizeStructPubSubType::createData() -{ - return reinterpret_cast(new ArraySizeStruct()); -} - -void ArraySizeStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool ArraySizeStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - ArraySizeStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - ArraySizeStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || ArraySizeStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - -SequenceStructPubSubType::SequenceStructPubSubType() -{ - setName("SequenceStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SequenceStruct::getMaxCdrSerializedSize()); -#else - SequenceStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = SequenceStruct_max_key_cdr_typesize > 16 ? SequenceStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SequenceStructPubSubType::~SequenceStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SequenceStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SequenceStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool SequenceStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SequenceStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function SequenceStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* SequenceStructPubSubType::createData() -{ - return reinterpret_cast(new SequenceStruct()); -} - -void SequenceStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SequenceStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SequenceStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SequenceStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || SequenceStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - -SequenceStructEqualPubSubType::SequenceStructEqualPubSubType() -{ - setName("SequenceStructEqual"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SequenceStructEqual::getMaxCdrSerializedSize()); -#else - SequenceStructEqual_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = SequenceStructEqual_max_key_cdr_typesize > 16 ? SequenceStructEqual_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SequenceStructEqualPubSubType::~SequenceStructEqualPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SequenceStructEqualPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SequenceStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool SequenceStructEqualPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SequenceStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function SequenceStructEqualPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* SequenceStructEqualPubSubType::createData() -{ - return reinterpret_cast(new SequenceStructEqual()); -} - -void SequenceStructEqualPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SequenceStructEqualPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SequenceStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SequenceStructEqual_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || SequenceStructEqual_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - -SequenceBadStructPubSubType::SequenceBadStructPubSubType() -{ - setName("SequenceBadStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SequenceBadStruct::getMaxCdrSerializedSize()); -#else - SequenceBadStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = SequenceBadStruct_max_key_cdr_typesize > 16 ? SequenceBadStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SequenceBadStructPubSubType::~SequenceBadStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SequenceBadStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SequenceBadStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool SequenceBadStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SequenceBadStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function SequenceBadStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* SequenceBadStructPubSubType::createData() -{ - return reinterpret_cast(new SequenceBadStruct()); -} - -void SequenceBadStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SequenceBadStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SequenceBadStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SequenceBadStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || SequenceBadStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - -SequenceBoundsStructPubSubType::SequenceBoundsStructPubSubType() -{ - setName("SequenceBoundsStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SequenceBoundsStruct::getMaxCdrSerializedSize()); -#else - SequenceBoundsStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = SequenceBoundsStruct_max_key_cdr_typesize > 16 ? SequenceBoundsStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SequenceBoundsStructPubSubType::~SequenceBoundsStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SequenceBoundsStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SequenceBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool SequenceBoundsStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SequenceBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function SequenceBoundsStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* SequenceBoundsStructPubSubType::createData() -{ - return reinterpret_cast(new SequenceBoundsStruct()); -} - -void SequenceBoundsStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SequenceBoundsStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SequenceBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SequenceBoundsStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || SequenceBoundsStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - - - -SequenceSequenceStructPubSubType::SequenceSequenceStructPubSubType() -{ - setName("SequenceSequenceStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SequenceSequenceStruct::getMaxCdrSerializedSize()); -#else - SequenceSequenceStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = SequenceSequenceStruct_max_key_cdr_typesize > 16 ? SequenceSequenceStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SequenceSequenceStructPubSubType::~SequenceSequenceStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SequenceSequenceStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SequenceSequenceStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool SequenceSequenceStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SequenceSequenceStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function SequenceSequenceStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* SequenceSequenceStructPubSubType::createData() -{ - return reinterpret_cast(new SequenceSequenceStruct()); -} - -void SequenceSequenceStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SequenceSequenceStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SequenceSequenceStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SequenceSequenceStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || SequenceSequenceStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - - - -SequenceSequenceBoundsStructPubSubType::SequenceSequenceBoundsStructPubSubType() -{ - setName("SequenceSequenceBoundsStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SequenceSequenceBoundsStruct::getMaxCdrSerializedSize()); -#else - SequenceSequenceBoundsStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = SequenceSequenceBoundsStruct_max_key_cdr_typesize > 16 ? SequenceSequenceBoundsStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SequenceSequenceBoundsStructPubSubType::~SequenceSequenceBoundsStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SequenceSequenceBoundsStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SequenceSequenceBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool SequenceSequenceBoundsStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SequenceSequenceBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function SequenceSequenceBoundsStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* SequenceSequenceBoundsStructPubSubType::createData() -{ - return reinterpret_cast(new SequenceSequenceBoundsStruct()); -} - -void SequenceSequenceBoundsStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SequenceSequenceBoundsStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SequenceSequenceBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SequenceSequenceBoundsStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || SequenceSequenceBoundsStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - -MapStructPubSubType::MapStructPubSubType() -{ - setName("MapStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MapStruct::getMaxCdrSerializedSize()); -#else - MapStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = MapStruct_max_key_cdr_typesize > 16 ? MapStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MapStructPubSubType::~MapStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MapStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MapStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool MapStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MapStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function MapStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* MapStructPubSubType::createData() -{ - return reinterpret_cast(new MapStruct()); -} - -void MapStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MapStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MapStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MapStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || MapStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - -MapStructEqualPubSubType::MapStructEqualPubSubType() -{ - setName("MapStructEqual"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MapStructEqual::getMaxCdrSerializedSize()); -#else - MapStructEqual_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = MapStructEqual_max_key_cdr_typesize > 16 ? MapStructEqual_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MapStructEqualPubSubType::~MapStructEqualPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MapStructEqualPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MapStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool MapStructEqualPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MapStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function MapStructEqualPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* MapStructEqualPubSubType::createData() -{ - return reinterpret_cast(new MapStructEqual()); -} - -void MapStructEqualPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MapStructEqualPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MapStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MapStructEqual_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || MapStructEqual_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - -MapBadKeyStructPubSubType::MapBadKeyStructPubSubType() -{ - setName("MapBadKeyStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MapBadKeyStruct::getMaxCdrSerializedSize()); -#else - MapBadKeyStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = MapBadKeyStruct_max_key_cdr_typesize > 16 ? MapBadKeyStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MapBadKeyStructPubSubType::~MapBadKeyStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MapBadKeyStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MapBadKeyStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool MapBadKeyStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MapBadKeyStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function MapBadKeyStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* MapBadKeyStructPubSubType::createData() -{ - return reinterpret_cast(new MapBadKeyStruct()); -} - -void MapBadKeyStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MapBadKeyStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MapBadKeyStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MapBadKeyStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || MapBadKeyStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - -MapBadElemStructPubSubType::MapBadElemStructPubSubType() -{ - setName("MapBadElemStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MapBadElemStruct::getMaxCdrSerializedSize()); -#else - MapBadElemStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = MapBadElemStruct_max_key_cdr_typesize > 16 ? MapBadElemStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MapBadElemStructPubSubType::~MapBadElemStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MapBadElemStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MapBadElemStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool MapBadElemStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MapBadElemStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function MapBadElemStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* MapBadElemStructPubSubType::createData() -{ - return reinterpret_cast(new MapBadElemStruct()); -} - -void MapBadElemStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MapBadElemStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MapBadElemStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MapBadElemStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || MapBadElemStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - -MapBoundsStructPubSubType::MapBoundsStructPubSubType() -{ - setName("MapBoundsStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MapBoundsStruct::getMaxCdrSerializedSize()); -#else - MapBoundsStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = MapBoundsStruct_max_key_cdr_typesize > 16 ? MapBoundsStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MapBoundsStructPubSubType::~MapBoundsStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MapBoundsStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MapBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool MapBoundsStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MapBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function MapBoundsStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* MapBoundsStructPubSubType::createData() -{ - return reinterpret_cast(new MapBoundsStruct()); -} - -void MapBoundsStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MapBoundsStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MapBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MapBoundsStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || MapBoundsStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - - - -MapMapStructPubSubType::MapMapStructPubSubType() -{ - setName("MapMapStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MapMapStruct::getMaxCdrSerializedSize()); -#else - MapMapStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = MapMapStruct_max_key_cdr_typesize > 16 ? MapMapStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MapMapStructPubSubType::~MapMapStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MapMapStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MapMapStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool MapMapStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MapMapStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function MapMapStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* MapMapStructPubSubType::createData() -{ - return reinterpret_cast(new MapMapStruct()); -} - -void MapMapStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MapMapStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MapMapStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MapMapStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || MapMapStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - - - -MapMapBoundsStructPubSubType::MapMapBoundsStructPubSubType() -{ - setName("MapMapBoundsStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(MapMapBoundsStruct::getMaxCdrSerializedSize()); -#else - MapMapBoundsStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = MapMapBoundsStruct_max_key_cdr_typesize > 16 ? MapMapBoundsStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -MapMapBoundsStructPubSubType::~MapMapBoundsStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool MapMapBoundsStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - MapMapBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool MapMapBoundsStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - MapMapBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function MapMapBoundsStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* MapMapBoundsStructPubSubType::createData() -{ - return reinterpret_cast(new MapMapBoundsStruct()); -} - -void MapMapBoundsStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool MapMapBoundsStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - MapMapBoundsStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - MapMapBoundsStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || MapMapBoundsStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - - - - - - - - - - - - - - - - - - - - - -SimpleUnionStructPubSubType::SimpleUnionStructPubSubType() -{ - setName("SimpleUnionStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SimpleUnionStruct::getMaxCdrSerializedSize()); -#else - SimpleUnionStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = SimpleUnionStruct_max_key_cdr_typesize > 16 ? SimpleUnionStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SimpleUnionStructPubSubType::~SimpleUnionStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SimpleUnionStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SimpleUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool SimpleUnionStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SimpleUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function SimpleUnionStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* SimpleUnionStructPubSubType::createData() -{ - return reinterpret_cast(new SimpleUnionStruct()); -} - -void SimpleUnionStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SimpleUnionStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SimpleUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SimpleUnionStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || SimpleUnionStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -SimpleUnionStructEqualPubSubType::SimpleUnionStructEqualPubSubType() -{ - setName("SimpleUnionStructEqual"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SimpleUnionStructEqual::getMaxCdrSerializedSize()); -#else - SimpleUnionStructEqual_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = SimpleUnionStructEqual_max_key_cdr_typesize > 16 ? SimpleUnionStructEqual_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SimpleUnionStructEqualPubSubType::~SimpleUnionStructEqualPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SimpleUnionStructEqualPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SimpleUnionStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool SimpleUnionStructEqualPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SimpleUnionStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function SimpleUnionStructEqualPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* SimpleUnionStructEqualPubSubType::createData() -{ - return reinterpret_cast(new SimpleUnionStructEqual()); -} - -void SimpleUnionStructEqualPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SimpleUnionStructEqualPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SimpleUnionStructEqual* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SimpleUnionStructEqual_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || SimpleUnionStructEqual_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -SimpleUnionNamesStructPubSubType::SimpleUnionNamesStructPubSubType() -{ - setName("SimpleUnionNamesStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SimpleUnionNamesStruct::getMaxCdrSerializedSize()); -#else - SimpleUnionNamesStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = SimpleUnionNamesStruct_max_key_cdr_typesize > 16 ? SimpleUnionNamesStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SimpleUnionNamesStructPubSubType::~SimpleUnionNamesStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SimpleUnionNamesStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SimpleUnionNamesStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool SimpleUnionNamesStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SimpleUnionNamesStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function SimpleUnionNamesStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* SimpleUnionNamesStructPubSubType::createData() -{ - return reinterpret_cast(new SimpleUnionNamesStruct()); -} - -void SimpleUnionNamesStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SimpleUnionNamesStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SimpleUnionNamesStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SimpleUnionNamesStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || SimpleUnionNamesStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -SimpleTypeUnionStructPubSubType::SimpleTypeUnionStructPubSubType() -{ - setName("SimpleTypeUnionStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SimpleTypeUnionStruct::getMaxCdrSerializedSize()); -#else - SimpleTypeUnionStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = SimpleTypeUnionStruct_max_key_cdr_typesize > 16 ? SimpleTypeUnionStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SimpleTypeUnionStructPubSubType::~SimpleTypeUnionStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SimpleTypeUnionStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SimpleTypeUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool SimpleTypeUnionStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SimpleTypeUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function SimpleTypeUnionStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* SimpleTypeUnionStructPubSubType::createData() -{ - return reinterpret_cast(new SimpleTypeUnionStruct()); -} - -void SimpleTypeUnionStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SimpleTypeUnionStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SimpleTypeUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SimpleTypeUnionStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || SimpleTypeUnionStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -SimpleBadUnionStructPubSubType::SimpleBadUnionStructPubSubType() -{ - setName("SimpleBadUnionStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SimpleBadUnionStruct::getMaxCdrSerializedSize()); -#else - SimpleBadUnionStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = SimpleBadUnionStruct_max_key_cdr_typesize > 16 ? SimpleBadUnionStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SimpleBadUnionStructPubSubType::~SimpleBadUnionStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SimpleBadUnionStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SimpleBadUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool SimpleBadUnionStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SimpleBadUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function SimpleBadUnionStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* SimpleBadUnionStructPubSubType::createData() -{ - return reinterpret_cast(new SimpleBadUnionStruct()); -} - -void SimpleBadUnionStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SimpleBadUnionStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SimpleBadUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SimpleBadUnionStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || SimpleBadUnionStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - - - -SimplBadDiscUnionStructPubSubType::SimplBadDiscUnionStructPubSubType() -{ - setName("SimplBadDiscUnionStruct"); - uint32_t type_size = -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(SimplBadDiscUnionStruct::getMaxCdrSerializedSize()); -#else - SimplBadDiscUnionStruct_max_cdr_typesize; -#endif - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - m_typeSize = type_size + 4; /*encapsulation*/ - m_isGetKeyDefined = false; - uint32_t keyLength = SimplBadDiscUnionStruct_max_key_cdr_typesize > 16 ? SimplBadDiscUnionStruct_max_key_cdr_typesize : 16; - m_keyBuffer = reinterpret_cast(malloc(keyLength)); - memset(m_keyBuffer, 0, keyLength); -} - -SimplBadDiscUnionStructPubSubType::~SimplBadDiscUnionStructPubSubType() -{ - if (m_keyBuffer != nullptr) - { - free(m_keyBuffer); - } -} - -bool SimplBadDiscUnionStructPubSubType::serialize( - void* data, - SerializedPayload_t* payload, - DataRepresentationId_t data_representation) -{ - SimplBadDiscUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; -#if FASTCDR_VERSION_MAJOR > 1 - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); -#endif // FASTCDR_VERSION_MAJOR > 1 - - try - { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - // Get the serialized length -#if FASTCDR_VERSION_MAJOR == 1 - payload->length = static_cast(ser.getSerializedDataLength()); -#else - payload->length = static_cast(ser.get_serialized_data_length()); -#endif // FASTCDR_VERSION_MAJOR == 1 - return true; -} - -bool SimplBadDiscUnionStructPubSubType::deserialize( - SerializedPayload_t* payload, - void* data) -{ - try - { - // Convert DATA to pointer of your type - SimplBadDiscUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload->data), payload->length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN -#if FASTCDR_VERSION_MAJOR == 1 - , eprosima::fastcdr::Cdr::CdrType::DDS_CDR -#endif // FASTCDR_VERSION_MAJOR == 1 - ); - - // Deserialize encapsulation. - deser.read_encapsulation(); - payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - // Deserialize the object. - deser >> *p_type; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return false; - } - - return true; -} - -std::function SimplBadDiscUnionStructPubSubType::getSerializedSizeProvider( - void* data, - DataRepresentationId_t data_representation) -{ - return [data, data_representation]() -> uint32_t - { -#if FASTCDR_VERSION_MAJOR == 1 - static_cast(data_representation); - return static_cast(type::getCdrSerializedSize(*static_cast(data))) + - 4u /*encapsulation*/; -#else - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -#endif // FASTCDR_VERSION_MAJOR == 1 - }; -} - -void* SimplBadDiscUnionStructPubSubType::createData() -{ - return reinterpret_cast(new SimplBadDiscUnionStruct()); -} - -void SimplBadDiscUnionStructPubSubType::deleteData( - void* data) -{ - delete(reinterpret_cast(data)); -} - -bool SimplBadDiscUnionStructPubSubType::getKey( - void* data, - InstanceHandle_t* handle, - bool force_md5) -{ - if (!m_isGetKeyDefined) - { - return false; - } - - SimplBadDiscUnionStruct* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(m_keyBuffer), - SimplBadDiscUnionStruct_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1); -#if FASTCDR_VERSION_MAJOR == 1 - p_type->serializeKey(ser); -#else - eprosima::fastcdr::serialize_key(ser, *p_type); -#endif // FASTCDR_VERSION_MAJOR == 1 - if (force_md5 || SimplBadDiscUnionStruct_max_key_cdr_typesize > 16) - { - m_md5.init(); -#if FASTCDR_VERSION_MAJOR == 1 - m_md5.update(m_keyBuffer, static_cast(ser.getSerializedDataLength())); -#else - m_md5.update(m_keyBuffer, static_cast(ser.get_serialized_data_length())); -#endif // FASTCDR_VERSION_MAJOR == 1 - m_md5.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_md5.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle->value[i] = m_keyBuffer[i]; - } - } - return true; -} - diff --git a/test/xtypes/idl/TypesPubSubTypes.h b/test/xtypes/idl/TypesPubSubTypes.h deleted file mode 100644 index e579289b6e5..00000000000 --- a/test/xtypes/idl/TypesPubSubTypes.h +++ /dev/null @@ -1,3337 +0,0 @@ -// 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 TypesPubSubTypes.h - * This header file contains the declaration of the serialization functions. - * - * This file was generated by the tool fastddsgen. - */ - - -#ifndef _FAST_DDS_GENERATED_TYPES_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_TYPES_PUBSUBTYPES_H_ - -#include -#include -#include -#include -#include - -#include "Types.h" - - -#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 - - - - -/*! - * @brief This class represents the TopicDataType of the type MyEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyEnumStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MyEnumStruct type; - - eProsima_user_DllExport MyEnumStructPubSubType(); - - eProsima_user_DllExport ~MyEnumStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type MyBadEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyBadEnumStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MyBadEnumStruct type; - - eProsima_user_DllExport MyBadEnumStructPubSubType(); - - eProsima_user_DllExport ~MyBadEnumStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; -typedef MyEnum MyAliasEnum; - - - -/*! - * @brief This class represents the TopicDataType of the type MyAliasEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyAliasEnumStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MyAliasEnumStruct type; - - eProsima_user_DllExport MyAliasEnumStructPubSubType(); - - eProsima_user_DllExport ~MyAliasEnumStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type BasicStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef BasicStruct type; - - eProsima_user_DllExport BasicStructPubSubType(); - - eProsima_user_DllExport ~BasicStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type BasicNamesStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicNamesStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef BasicNamesStruct type; - - eProsima_user_DllExport BasicNamesStructPubSubType(); - - eProsima_user_DllExport ~BasicNamesStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type BasicBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicBadStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef BasicBadStruct type; - - eProsima_user_DllExport BasicBadStructPubSubType(); - - eProsima_user_DllExport ~BasicBadStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type BasicWideStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicWideStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef BasicWideStruct type; - - eProsima_user_DllExport BasicWideStructPubSubType(); - - eProsima_user_DllExport ~BasicWideStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type BadBasicWideStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BadBasicWideStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef BadBasicWideStruct type; - - eProsima_user_DllExport BadBasicWideStructPubSubType(); - - eProsima_user_DllExport ~BadBasicWideStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type StringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class StringStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef StringStruct type; - - eProsima_user_DllExport StringStructPubSubType(); - - eProsima_user_DllExport ~StringStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type LargeStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class LargeStringStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef LargeStringStruct type; - - eProsima_user_DllExport LargeStringStructPubSubType(); - - eProsima_user_DllExport ~LargeStringStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type WStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class WStringStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef WStringStruct type; - - eProsima_user_DllExport WStringStructPubSubType(); - - eProsima_user_DllExport ~WStringStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type LargeWStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class LargeWStringStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef LargeWStringStruct type; - - eProsima_user_DllExport LargeWStringStructPubSubType(); - - eProsima_user_DllExport ~LargeWStringStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type ArrayStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ArrayStruct type; - - eProsima_user_DllExport ArrayStructPubSubType(); - - eProsima_user_DllExport ~ArrayStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type ArrayStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayStructEqualPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ArrayStructEqual type; - - eProsima_user_DllExport ArrayStructEqualPubSubType(); - - eProsima_user_DllExport ~ArrayStructEqualPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type ArrayBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayBadStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ArrayBadStruct type; - - eProsima_user_DllExport ArrayBadStructPubSubType(); - - eProsima_user_DllExport ~ArrayBadStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type ArrayDimensionsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayDimensionsStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ArrayDimensionsStruct type; - - eProsima_user_DllExport ArrayDimensionsStructPubSubType(); - - eProsima_user_DllExport ~ArrayDimensionsStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type ArraySizeStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArraySizeStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef ArraySizeStruct type; - - eProsima_user_DllExport ArraySizeStructPubSubType(); - - eProsima_user_DllExport ~ArraySizeStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type SequenceStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SequenceStruct type; - - eProsima_user_DllExport SequenceStructPubSubType(); - - eProsima_user_DllExport ~SequenceStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type SequenceStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceStructEqualPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SequenceStructEqual type; - - eProsima_user_DllExport SequenceStructEqualPubSubType(); - - eProsima_user_DllExport ~SequenceStructEqualPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type SequenceBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceBadStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SequenceBadStruct type; - - eProsima_user_DllExport SequenceBadStructPubSubType(); - - eProsima_user_DllExport ~SequenceBadStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type SequenceBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceBoundsStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SequenceBoundsStruct type; - - eProsima_user_DllExport SequenceBoundsStructPubSubType(); - - eProsima_user_DllExport ~SequenceBoundsStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - - - -/*! - * @brief This class represents the TopicDataType of the type SequenceSequenceStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceSequenceStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SequenceSequenceStruct type; - - eProsima_user_DllExport SequenceSequenceStructPubSubType(); - - eProsima_user_DllExport ~SequenceSequenceStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - - - -/*! - * @brief This class represents the TopicDataType of the type SequenceSequenceBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceSequenceBoundsStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SequenceSequenceBoundsStruct type; - - eProsima_user_DllExport SequenceSequenceBoundsStructPubSubType(); - - eProsima_user_DllExport ~SequenceSequenceBoundsStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type MapStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MapStruct type; - - eProsima_user_DllExport MapStructPubSubType(); - - eProsima_user_DllExport ~MapStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type MapStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class MapStructEqualPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MapStructEqual type; - - eProsima_user_DllExport MapStructEqualPubSubType(); - - eProsima_user_DllExport ~MapStructEqualPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type MapBadKeyStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBadKeyStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MapBadKeyStruct type; - - eProsima_user_DllExport MapBadKeyStructPubSubType(); - - eProsima_user_DllExport ~MapBadKeyStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type MapBadElemStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBadElemStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MapBadElemStruct type; - - eProsima_user_DllExport MapBadElemStructPubSubType(); - - eProsima_user_DllExport ~MapBadElemStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - -/*! - * @brief This class represents the TopicDataType of the type MapBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBoundsStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MapBoundsStruct type; - - eProsima_user_DllExport MapBoundsStructPubSubType(); - - eProsima_user_DllExport ~MapBoundsStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - - - -/*! - * @brief This class represents the TopicDataType of the type MapMapStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapMapStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MapMapStruct type; - - eProsima_user_DllExport MapMapStructPubSubType(); - - eProsima_user_DllExport ~MapMapStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - - - -/*! - * @brief This class represents the TopicDataType of the type MapMapBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapMapBoundsStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef MapMapBoundsStruct type; - - eProsima_user_DllExport MapMapBoundsStructPubSubType(); - - eProsima_user_DllExport ~MapMapBoundsStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - - - - - - - - - - - - - - - - - - - - - -/*! - * @brief This class represents the TopicDataType of the type SimpleUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SimpleUnionStruct type; - - eProsima_user_DllExport SimpleUnionStructPubSubType(); - - eProsima_user_DllExport ~SimpleUnionStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type SimpleUnionStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionStructEqualPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SimpleUnionStructEqual type; - - eProsima_user_DllExport SimpleUnionStructEqualPubSubType(); - - eProsima_user_DllExport ~SimpleUnionStructEqualPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type SimpleUnionNamesStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionNamesStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SimpleUnionNamesStruct type; - - eProsima_user_DllExport SimpleUnionNamesStructPubSubType(); - - eProsima_user_DllExport ~SimpleUnionNamesStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type SimpleTypeUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleTypeUnionStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SimpleTypeUnionStruct type; - - eProsima_user_DllExport SimpleTypeUnionStructPubSubType(); - - eProsima_user_DllExport ~SimpleTypeUnionStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type SimpleBadUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleBadUnionStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SimpleBadUnionStruct type; - - eProsima_user_DllExport SimpleBadUnionStructPubSubType(); - - eProsima_user_DllExport ~SimpleBadUnionStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - - - -/*! - * @brief This class represents the TopicDataType of the type SimplBadDiscUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimplBadDiscUnionStructPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef SimplBadDiscUnionStruct type; - - eProsima_user_DllExport SimplBadDiscUnionStructPubSubType(); - - eProsima_user_DllExport ~SimplBadDiscUnionStructPubSubType() override; - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload) override - { - return serialize(data, payload, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport bool serialize( - void* data, - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool deserialize( - eprosima::fastrtps::rtps::SerializedPayload_t* payload, - void* data) override; - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data) override - { - return getSerializedSizeProvider(data, eprosima::fastdds::dds::DEFAULT_DATA_REPRESENTATION); - } - - eProsima_user_DllExport std::function getSerializedSizeProvider( - void* data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - - eProsima_user_DllExport bool getKey( - void* data, - eprosima::fastrtps::rtps::InstanceHandle_t* ihandle, - bool force_md5 = false) override; - - eProsima_user_DllExport void* createData() override; - - eProsima_user_DllExport void deleteData( - void* data) override; - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport inline bool is_plain() const override - { - return false; - } - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - - MD5 m_md5; - unsigned char* m_keyBuffer; - -}; - -#endif // _FAST_DDS_GENERATED_TYPES_PUBSUBTYPES_H_ - diff --git a/test/xtypes/idl/TypesTypeObject.cxx b/test/xtypes/idl/TypesTypeObject.cxx deleted file mode 100644 index 8082634f979..00000000000 --- a/test/xtypes/idl/TypesTypeObject.cxx +++ /dev/null @@ -1,8990 +0,0 @@ -// 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 TypesTypeObject.cpp - * This source file contains the definition of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { char dummy; } -#endif - -#include "Types.h" -#include "TypesTypeObject.h" - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -using namespace eprosima::fastrtps::rtps; - -void registerTypesTypes() -{ - static std::once_flag once_flag; - std::call_once(once_flag, []() - { - TypeObjectFactory *factory = TypeObjectFactory::get_instance(); - factory->add_type_object("MyEnum", GetMyEnumIdentifier(true), - GetMyEnumObject(true)); - factory->add_type_object("MyEnum", GetMyEnumIdentifier(false), - GetMyEnumObject(false)); - - - factory->add_type_object("MyBadEnum", GetMyBadEnumIdentifier(true), - GetMyBadEnumObject(true)); - factory->add_type_object("MyBadEnum", GetMyBadEnumIdentifier(false), - GetMyBadEnumObject(false)); - - - factory->add_type_object("MyEnumStruct", GetMyEnumStructIdentifier(true), - GetMyEnumStructObject(true)); - factory->add_type_object("MyEnumStruct", GetMyEnumStructIdentifier(false), - GetMyEnumStructObject(false)); - - - factory->add_type_object("MyBadEnumStruct", GetMyBadEnumStructIdentifier(true), - GetMyBadEnumStructObject(true)); - factory->add_type_object("MyBadEnumStruct", GetMyBadEnumStructIdentifier(false), - GetMyBadEnumStructObject(false)); - - - factory->add_type_object("MyAliasEnum", GetMyAliasEnumIdentifier(true), - GetMyAliasEnumObject(true)); - factory->add_type_object("MyAliasEnum", GetMyAliasEnumIdentifier(false), - GetMyAliasEnumObject(false)); - - - factory->add_type_object("MyAliasEnumStruct", GetMyAliasEnumStructIdentifier(true), - GetMyAliasEnumStructObject(true)); - factory->add_type_object("MyAliasEnumStruct", GetMyAliasEnumStructIdentifier(false), - GetMyAliasEnumStructObject(false)); - - - factory->add_type_object("BasicStruct", GetBasicStructIdentifier(true), - GetBasicStructObject(true)); - factory->add_type_object("BasicStruct", GetBasicStructIdentifier(false), - GetBasicStructObject(false)); - - - factory->add_type_object("BasicNamesStruct", GetBasicNamesStructIdentifier(true), - GetBasicNamesStructObject(true)); - factory->add_type_object("BasicNamesStruct", GetBasicNamesStructIdentifier(false), - GetBasicNamesStructObject(false)); - - - factory->add_type_object("BasicBadStruct", GetBasicBadStructIdentifier(true), - GetBasicBadStructObject(true)); - factory->add_type_object("BasicBadStruct", GetBasicBadStructIdentifier(false), - GetBasicBadStructObject(false)); - - - factory->add_type_object("BasicWideStruct", GetBasicWideStructIdentifier(true), - GetBasicWideStructObject(true)); - factory->add_type_object("BasicWideStruct", GetBasicWideStructIdentifier(false), - GetBasicWideStructObject(false)); - - - factory->add_type_object("BadBasicWideStruct", GetBadBasicWideStructIdentifier(true), - GetBadBasicWideStructObject(true)); - factory->add_type_object("BadBasicWideStruct", GetBadBasicWideStructIdentifier(false), - GetBadBasicWideStructObject(false)); - - - factory->add_type_object("StringStruct", GetStringStructIdentifier(true), - GetStringStructObject(true)); - factory->add_type_object("StringStruct", GetStringStructIdentifier(false), - GetStringStructObject(false)); - - - factory->add_type_object("LargeStringStruct", GetLargeStringStructIdentifier(true), - GetLargeStringStructObject(true)); - factory->add_type_object("LargeStringStruct", GetLargeStringStructIdentifier(false), - GetLargeStringStructObject(false)); - - - factory->add_type_object("WStringStruct", GetWStringStructIdentifier(true), - GetWStringStructObject(true)); - factory->add_type_object("WStringStruct", GetWStringStructIdentifier(false), - GetWStringStructObject(false)); - - - factory->add_type_object("LargeWStringStruct", GetLargeWStringStructIdentifier(true), - GetLargeWStringStructObject(true)); - factory->add_type_object("LargeWStringStruct", GetLargeWStringStructIdentifier(false), - GetLargeWStringStructObject(false)); - - - factory->add_type_object("ArrayStruct", GetArrayStructIdentifier(true), - GetArrayStructObject(true)); - factory->add_type_object("ArrayStruct", GetArrayStructIdentifier(false), - GetArrayStructObject(false)); - - - factory->add_type_object("ArrayStructEqual", GetArrayStructEqualIdentifier(true), - GetArrayStructEqualObject(true)); - factory->add_type_object("ArrayStructEqual", GetArrayStructEqualIdentifier(false), - GetArrayStructEqualObject(false)); - - - factory->add_type_object("ArrayBadStruct", GetArrayBadStructIdentifier(true), - GetArrayBadStructObject(true)); - factory->add_type_object("ArrayBadStruct", GetArrayBadStructIdentifier(false), - GetArrayBadStructObject(false)); - - - factory->add_type_object("ArrayDimensionsStruct", GetArrayDimensionsStructIdentifier(true), - GetArrayDimensionsStructObject(true)); - factory->add_type_object("ArrayDimensionsStruct", GetArrayDimensionsStructIdentifier(false), - GetArrayDimensionsStructObject(false)); - - - factory->add_type_object("ArraySizeStruct", GetArraySizeStructIdentifier(true), - GetArraySizeStructObject(true)); - factory->add_type_object("ArraySizeStruct", GetArraySizeStructIdentifier(false), - GetArraySizeStructObject(false)); - - - factory->add_type_object("SequenceStruct", GetSequenceStructIdentifier(true), - GetSequenceStructObject(true)); - factory->add_type_object("SequenceStruct", GetSequenceStructIdentifier(false), - GetSequenceStructObject(false)); - - - factory->add_type_object("SequenceStructEqual", GetSequenceStructEqualIdentifier(true), - GetSequenceStructEqualObject(true)); - factory->add_type_object("SequenceStructEqual", GetSequenceStructEqualIdentifier(false), - GetSequenceStructEqualObject(false)); - - - factory->add_type_object("SequenceBadStruct", GetSequenceBadStructIdentifier(true), - GetSequenceBadStructObject(true)); - factory->add_type_object("SequenceBadStruct", GetSequenceBadStructIdentifier(false), - GetSequenceBadStructObject(false)); - - - factory->add_type_object("SequenceBoundsStruct", GetSequenceBoundsStructIdentifier(true), - GetSequenceBoundsStructObject(true)); - factory->add_type_object("SequenceBoundsStruct", GetSequenceBoundsStructIdentifier(false), - GetSequenceBoundsStructObject(false)); - - - factory->add_type_object("SequenceSequenceStruct", GetSequenceSequenceStructIdentifier(true), - GetSequenceSequenceStructObject(true)); - factory->add_type_object("SequenceSequenceStruct", GetSequenceSequenceStructIdentifier(false), - GetSequenceSequenceStructObject(false)); - - - factory->add_type_object("SequenceSequenceBoundsStruct", GetSequenceSequenceBoundsStructIdentifier(true), - GetSequenceSequenceBoundsStructObject(true)); - factory->add_type_object("SequenceSequenceBoundsStruct", GetSequenceSequenceBoundsStructIdentifier(false), - GetSequenceSequenceBoundsStructObject(false)); - - - factory->add_type_object("MapStruct", GetMapStructIdentifier(true), - GetMapStructObject(true)); - factory->add_type_object("MapStruct", GetMapStructIdentifier(false), - GetMapStructObject(false)); - - - factory->add_type_object("MapStructEqual", GetMapStructEqualIdentifier(true), - GetMapStructEqualObject(true)); - factory->add_type_object("MapStructEqual", GetMapStructEqualIdentifier(false), - GetMapStructEqualObject(false)); - - - factory->add_type_object("MapBadKeyStruct", GetMapBadKeyStructIdentifier(true), - GetMapBadKeyStructObject(true)); - factory->add_type_object("MapBadKeyStruct", GetMapBadKeyStructIdentifier(false), - GetMapBadKeyStructObject(false)); - - - factory->add_type_object("MapBadElemStruct", GetMapBadElemStructIdentifier(true), - GetMapBadElemStructObject(true)); - factory->add_type_object("MapBadElemStruct", GetMapBadElemStructIdentifier(false), - GetMapBadElemStructObject(false)); - - - factory->add_type_object("MapBoundsStruct", GetMapBoundsStructIdentifier(true), - GetMapBoundsStructObject(true)); - factory->add_type_object("MapBoundsStruct", GetMapBoundsStructIdentifier(false), - GetMapBoundsStructObject(false)); - - - factory->add_type_object("MapMapStruct", GetMapMapStructIdentifier(true), - GetMapMapStructObject(true)); - factory->add_type_object("MapMapStruct", GetMapMapStructIdentifier(false), - GetMapMapStructObject(false)); - - - factory->add_type_object("MapMapBoundsStruct", GetMapMapBoundsStructIdentifier(true), - GetMapMapBoundsStructObject(true)); - factory->add_type_object("MapMapBoundsStruct", GetMapMapBoundsStructIdentifier(false), - GetMapMapBoundsStructObject(false)); - - - factory->add_type_object("SimpleUnion", GetSimpleUnionIdentifier(true), - GetSimpleUnionObject(true)); - factory->add_type_object("SimpleUnion", GetSimpleUnionIdentifier(false), - GetSimpleUnionObject(false)); - - - factory->add_type_object("SimpleUnionNames", GetSimpleUnionNamesIdentifier(true), - GetSimpleUnionNamesObject(true)); - factory->add_type_object("SimpleUnionNames", GetSimpleUnionNamesIdentifier(false), - GetSimpleUnionNamesObject(false)); - - - factory->add_type_object("SimpleTypeUnion", GetSimpleTypeUnionIdentifier(true), - GetSimpleTypeUnionObject(true)); - factory->add_type_object("SimpleTypeUnion", GetSimpleTypeUnionIdentifier(false), - GetSimpleTypeUnionObject(false)); - - - factory->add_type_object("SimpleBadUnion", GetSimpleBadUnionIdentifier(true), - GetSimpleBadUnionObject(true)); - factory->add_type_object("SimpleBadUnion", GetSimpleBadUnionIdentifier(false), - GetSimpleBadUnionObject(false)); - - - factory->add_type_object("SimpleBadDiscUnion", GetSimpleBadDiscUnionIdentifier(true), - GetSimpleBadDiscUnionObject(true)); - factory->add_type_object("SimpleBadDiscUnion", GetSimpleBadDiscUnionIdentifier(false), - GetSimpleBadDiscUnionObject(false)); - - - factory->add_type_object("SimpleUnionStruct", GetSimpleUnionStructIdentifier(true), - GetSimpleUnionStructObject(true)); - factory->add_type_object("SimpleUnionStruct", GetSimpleUnionStructIdentifier(false), - GetSimpleUnionStructObject(false)); - - - factory->add_type_object("SimpleUnionStructEqual", GetSimpleUnionStructEqualIdentifier(true), - GetSimpleUnionStructEqualObject(true)); - factory->add_type_object("SimpleUnionStructEqual", GetSimpleUnionStructEqualIdentifier(false), - GetSimpleUnionStructEqualObject(false)); - - - factory->add_type_object("SimpleUnionNamesStruct", GetSimpleUnionNamesStructIdentifier(true), - GetSimpleUnionNamesStructObject(true)); - factory->add_type_object("SimpleUnionNamesStruct", GetSimpleUnionNamesStructIdentifier(false), - GetSimpleUnionNamesStructObject(false)); - - - factory->add_type_object("SimpleTypeUnionStruct", GetSimpleTypeUnionStructIdentifier(true), - GetSimpleTypeUnionStructObject(true)); - factory->add_type_object("SimpleTypeUnionStruct", GetSimpleTypeUnionStructIdentifier(false), - GetSimpleTypeUnionStructObject(false)); - - - factory->add_type_object("SimpleBadUnionStruct", GetSimpleBadUnionStructIdentifier(true), - GetSimpleBadUnionStructObject(true)); - factory->add_type_object("SimpleBadUnionStruct", GetSimpleBadUnionStructIdentifier(false), - GetSimpleBadUnionStructObject(false)); - - - factory->add_type_object("SimplBadDiscUnionStruct", GetSimplBadDiscUnionStructIdentifier(true), - GetSimplBadDiscUnionStructObject(true)); - factory->add_type_object("SimplBadDiscUnionStruct", GetSimplBadDiscUnionStructIdentifier(false), - GetSimplBadDiscUnionStructObject(false)); - - }); -} - -const TypeIdentifier* GetMyEnumIdentifier(bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyEnum", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyEnumObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyEnum", complete); -} - -const TypeObject* GetMyEnumObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnum", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyEnumObject(); - } - // else - return GetMinimalMyEnumObject(); -} - -const TypeObject* GetMinimalMyEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnum", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ENUM); - - // No flags apply - //type_object->minimal().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->minimal().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->minimal().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->minimal().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - - uint32_t value = 0; - MinimalEnumeratedLiteral mel_A; - mel_A.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_A.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_A.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_A.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_A.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_A.common().flags().IS_KEY(false); // Doesn't apply - mel_A.common().flags().IS_DEFAULT(false); - mel_A.common().value(value++); - MD5 A_hash("A"); - for(int i = 0; i < 4; ++i) - { - mel_A.detail().name_hash()[i] = A_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_A); - - MinimalEnumeratedLiteral mel_B; - mel_B.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_B.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_B.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_B.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_B.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_B.common().flags().IS_KEY(false); // Doesn't apply - mel_B.common().flags().IS_DEFAULT(false); - mel_B.common().value(value++); - MD5 B_hash("B"); - for(int i = 0; i < 4; ++i) - { - mel_B.detail().name_hash()[i] = B_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_B); - - MinimalEnumeratedLiteral mel_C; - mel_C.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_C.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_C.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_C.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_C.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_C.common().flags().IS_KEY(false); // Doesn't apply - mel_C.common().flags().IS_DEFAULT(false); - mel_C.common().value(value++); - MD5 C_hash("C"); - for(int i = 0; i < 4; ++i) - { - mel_C.detail().name_hash()[i] = C_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_C); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().enumerated_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyEnum", false); -} - -const TypeObject* GetCompleteMyEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnum", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ENUM); - - // No flags apply - //type_object->complete().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->complete().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->complete().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->complete().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - type_object->complete().enumerated_type().header().detail().type_name("MyEnum"); - - uint32_t value = 0; - CompleteEnumeratedLiteral cel_A; - cel_A.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_A.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_A.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_A.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_A.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_A.common().flags().IS_KEY(false); // Doesn't apply - cel_A.common().flags().IS_DEFAULT(false); - cel_A.common().value(value++); - cel_A.detail().name("A"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_A); - - CompleteEnumeratedLiteral cel_B; - cel_B.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_B.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_B.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_B.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_B.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_B.common().flags().IS_KEY(false); // Doesn't apply - cel_B.common().flags().IS_DEFAULT(false); - cel_B.common().value(value++); - cel_B.detail().name("B"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_B); - - CompleteEnumeratedLiteral cel_C; - cel_C.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_C.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_C.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_C.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_C.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_C.common().flags().IS_KEY(false); // Doesn't apply - cel_C.common().flags().IS_DEFAULT(false); - cel_C.common().value(value++); - cel_C.detail().name("C"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_C); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().enumerated_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyEnum", true); -} - -const TypeIdentifier* GetMyBadEnumIdentifier(bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyBadEnum", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyBadEnumObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyBadEnum", complete); -} - -const TypeObject* GetMyBadEnumObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBadEnum", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyBadEnumObject(); - } - // else - return GetMinimalMyBadEnumObject(); -} - -const TypeObject* GetMinimalMyBadEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBadEnum", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ENUM); - - // No flags apply - //type_object->minimal().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->minimal().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->minimal().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->minimal().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->minimal().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - - uint32_t value = 0; - MinimalEnumeratedLiteral mel_A1; - mel_A1.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_A1.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_A1.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_A1.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_A1.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_A1.common().flags().IS_KEY(false); // Doesn't apply - mel_A1.common().flags().IS_DEFAULT(false); - mel_A1.common().value(value++); - MD5 A1_hash("A1"); - for(int i = 0; i < 4; ++i) - { - mel_A1.detail().name_hash()[i] = A1_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_A1); - - MinimalEnumeratedLiteral mel_B1; - mel_B1.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_B1.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_B1.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_B1.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_B1.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_B1.common().flags().IS_KEY(false); // Doesn't apply - mel_B1.common().flags().IS_DEFAULT(false); - mel_B1.common().value(value++); - MD5 B1_hash("B1"); - for(int i = 0; i < 4; ++i) - { - mel_B1.detail().name_hash()[i] = B1_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_B1); - - MinimalEnumeratedLiteral mel_C1; - mel_C1.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - mel_C1.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - mel_C1.common().flags().IS_EXTERNAL(false); // Doesn't apply - mel_C1.common().flags().IS_OPTIONAL(false); // Doesn't apply - mel_C1.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mel_C1.common().flags().IS_KEY(false); // Doesn't apply - mel_C1.common().flags().IS_DEFAULT(false); - mel_C1.common().value(value++); - MD5 C1_hash("C1"); - for(int i = 0; i < 4; ++i) - { - mel_C1.detail().name_hash()[i] = C1_hash.digest[i]; - } - type_object->minimal().enumerated_type().literal_seq().emplace_back(mel_C1); - - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().enumerated_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyBadEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyBadEnum", false); -} - -const TypeObject* GetCompleteMyBadEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBadEnum", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ENUM); - - // No flags apply - //type_object->complete().enumerated_type().enum_flags().IS_FINAL(false); - //type_object->complete().enumerated_type().enum_flags().IS_APPENDABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_MUTABLE(false); - //type_object->complete().enumerated_type().enum_flags().IS_NESTED(false); - //type_object->complete().enumerated_type().enum_flags().IS_AUTOID_HASH(false); - - type_object->complete().enumerated_type().header().common().bit_bound(32); // TODO fixed by IDL, isn't? - type_object->complete().enumerated_type().header().detail().type_name("MyBadEnum"); - - uint32_t value = 0; - CompleteEnumeratedLiteral cel_A1; - cel_A1.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_A1.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_A1.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_A1.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_A1.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_A1.common().flags().IS_KEY(false); // Doesn't apply - cel_A1.common().flags().IS_DEFAULT(false); - cel_A1.common().value(value++); - cel_A1.detail().name("A1"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_A1); - - CompleteEnumeratedLiteral cel_B1; - cel_B1.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_B1.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_B1.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_B1.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_B1.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_B1.common().flags().IS_KEY(false); // Doesn't apply - cel_B1.common().flags().IS_DEFAULT(false); - cel_B1.common().value(value++); - cel_B1.detail().name("B1"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_B1); - - CompleteEnumeratedLiteral cel_C1; - cel_C1.common().flags().TRY_CONSTRUCT1(false); // Doesn't apply - cel_C1.common().flags().TRY_CONSTRUCT2(false); // Doesn't apply - cel_C1.common().flags().IS_EXTERNAL(false); // Doesn't apply - cel_C1.common().flags().IS_OPTIONAL(false); // Doesn't apply - cel_C1.common().flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cel_C1.common().flags().IS_KEY(false); // Doesn't apply - cel_C1.common().flags().IS_DEFAULT(false); - cel_C1.common().value(value++); - cel_C1.detail().name("C1"); - - type_object->complete().enumerated_type().literal_seq().emplace_back(cel_C1); - - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().enumerated_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyBadEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyBadEnum", true); -} - - - -const TypeIdentifier* GetMyEnumStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyEnumStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyEnumStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyEnumStruct", complete); -} - -const TypeObject* GetMyEnumStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnumStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyEnumStructObject(); - } - //else - return GetMinimalMyEnumStructObject(); -} - -const TypeObject* GetMinimalMyEnumStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnumStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_enum; - mst_my_enum.common().member_id(memberId++); - mst_my_enum.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_enum.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_enum.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_enum.common().member_flags().IS_OPTIONAL(false); - mst_my_enum.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_enum.common().member_flags().IS_KEY(false); - mst_my_enum.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_enum.common().member_type_id(*GetMyEnumIdentifier(false)); - - MD5 my_enum_hash("my_enum"); - for(int i = 0; i < 4; ++i) - { - mst_my_enum.detail().name_hash()[i] = my_enum_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_enum); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyEnumStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyEnumStruct", false); -} - -const TypeObject* GetCompleteMyEnumStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyEnumStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_enum; - cst_my_enum.common().member_id(memberId++); - cst_my_enum.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_enum.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_enum.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_enum.common().member_flags().IS_OPTIONAL(false); - cst_my_enum.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_enum.common().member_flags().IS_KEY(false); - cst_my_enum.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_enum.common().member_type_id(*GetMyEnumIdentifier(true)); - - cst_my_enum.detail().name("my_enum"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_enum); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MyEnumStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyEnumStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyEnumStruct", true); -} - - - -const TypeIdentifier* GetMyBadEnumStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyBadEnumStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyBadEnumStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyBadEnumStruct", complete); -} - -const TypeObject* GetMyBadEnumStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBadEnumStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyBadEnumStructObject(); - } - //else - return GetMinimalMyBadEnumStructObject(); -} - -const TypeObject* GetMinimalMyBadEnumStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBadEnumStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_enum; - mst_my_enum.common().member_id(memberId++); - mst_my_enum.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_enum.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_enum.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_enum.common().member_flags().IS_OPTIONAL(false); - mst_my_enum.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_enum.common().member_flags().IS_KEY(false); - mst_my_enum.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_enum.common().member_type_id(*GetMyBadEnumIdentifier(false)); - - MD5 my_enum_hash("my_enum"); - for(int i = 0; i < 4; ++i) - { - mst_my_enum.detail().name_hash()[i] = my_enum_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_enum); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyBadEnumStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyBadEnumStruct", false); -} - -const TypeObject* GetCompleteMyBadEnumStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyBadEnumStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_enum; - cst_my_enum.common().member_id(memberId++); - cst_my_enum.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_enum.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_enum.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_enum.common().member_flags().IS_OPTIONAL(false); - cst_my_enum.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_enum.common().member_flags().IS_KEY(false); - cst_my_enum.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_enum.common().member_type_id(*GetMyBadEnumIdentifier(true)); - - cst_my_enum.detail().name("my_enum"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_enum); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MyBadEnumStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyBadEnumStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyBadEnumStruct", true); -} - -const TypeIdentifier* GetMyAliasEnumIdentifier(bool complete) -{ - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyAliasEnum", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyAliasEnumObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyAliasEnum", complete); -} - -const TypeObject* GetMyAliasEnumObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyAliasEnumObject(); - } - else - { - return GetMinimalMyAliasEnumObject(); - } -} - -const TypeObject* GetMinimalMyAliasEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_ALIAS); - - // No flags apply - //type_object->minimal().alias_type().alias_flags().IS_FINAL(false); - //type_object->minimal().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->minimal().alias_type().alias_flags().IS_NESTED(false); - //type_object->minimal().alias_type().alias_flags().IS_AUTOID_HASH(false); - - // type_object->minimal().alias_type().header()... Is empty - - // No flags apply - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->minimal().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->minimal().alias_type().body().common().related_flags().IS_DEFAULT(false); - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier("MyEnum", false); - - - if (relatedType != nullptr) - { - type_object->minimal().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MyAliasEnum", "MyEnum"); - - TypeObjectFactory::get_instance()->add_type_object("MyAliasEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", false); -} - -const TypeObject* GetCompleteMyAliasEnumObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_ALIAS); - - // No flags apply - //type_object->complete().alias_type().alias_flags().IS_FINAL(false); - //type_object->complete().alias_type().alias_flags().IS_APPENDABLE(false); - //type_object->complete().alias_type().alias_flags().IS_MUTABLE(false); - //type_object->complete().alias_type().alias_flags().IS_NESTED(false); - //type_object->complete().alias_type().alias_flags().IS_AUTOID_HASH(false); - - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().placement("placement"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().language("language"); - //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().text("text"); - //type_object->complete().alias_type().header().detail().ann_custom().push_back(...); - type_object->complete().alias_type().header().detail().type_name("MyAliasEnum"); - - // No flags apply - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); - //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT2(false); - //type_object->complete().alias_type().body().common().related_flags().IS_EXTERNAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_OPTIONAL(false); - //type_object->complete().alias_type().body().common().related_flags().IS_MUST_UNDERSTAND(false); - //type_object->complete().alias_type().body().common().related_flags().IS_KEY(false); - //type_object->complete().alias_type().body().common().related_flags().IS_DEFAULT(false); - - //type_object->complete().alias_type().body().common().ann_builtin() - //type_object->complete().alias_type().body().common().ann_custom() - - // Must be defined already, if don't, may be an recursive alias - const TypeIdentifier *relatedType = TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("MyEnum"); - - - if (relatedType != nullptr) - { - type_object->complete().alias_type().body().common().related_type() = *relatedType; // Make a copy - } - else - { - // Cannot determine base type - delete type_object; - return nullptr; - } - - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().alias_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("MyAliasEnum", "MyEnum"); - - TypeObjectFactory::get_instance()->add_type_object("MyAliasEnum", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyAliasEnum", true); -} - - - -const TypeIdentifier* GetMyAliasEnumStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MyAliasEnumStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMyAliasEnumStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MyAliasEnumStruct", complete); -} - -const TypeObject* GetMyAliasEnumStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnumStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMyAliasEnumStructObject(); - } - //else - return GetMinimalMyAliasEnumStructObject(); -} - -const TypeObject* GetMinimalMyAliasEnumStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnumStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_enum; - mst_my_enum.common().member_id(memberId++); - mst_my_enum.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_enum.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_enum.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_enum.common().member_flags().IS_OPTIONAL(false); - mst_my_enum.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_enum.common().member_flags().IS_KEY(false); - mst_my_enum.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_enum.common().member_type_id(*GetMyAliasEnumIdentifier(false)); - - MD5 my_enum_hash("my_enum"); - for(int i = 0; i < 4; ++i) - { - mst_my_enum.detail().name_hash()[i] = my_enum_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_enum); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyAliasEnumStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyAliasEnumStruct", false); -} - -const TypeObject* GetCompleteMyAliasEnumStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MyAliasEnumStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_enum; - cst_my_enum.common().member_id(memberId++); - cst_my_enum.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_enum.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_enum.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_enum.common().member_flags().IS_OPTIONAL(false); - cst_my_enum.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_enum.common().member_flags().IS_KEY(false); - cst_my_enum.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_enum.common().member_type_id(*GetMyAliasEnumIdentifier(true)); - - cst_my_enum.detail().name("my_enum"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_enum); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MyAliasEnumStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MyAliasEnumStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MyAliasEnumStruct", true); -} - - - -const TypeIdentifier* GetBasicStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BasicStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetBasicStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("BasicStruct", complete); -} - -const TypeObject* GetBasicStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteBasicStructObject(); - } - //else - return GetMinimalBasicStructObject(); -} - -const TypeObject* GetMinimalBasicStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_bool; - mst_my_bool.common().member_id(memberId++); - mst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_bool.common().member_flags().IS_OPTIONAL(false); - mst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_bool.common().member_flags().IS_KEY(false); - mst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - MD5 my_bool_hash("my_bool"); - for(int i = 0; i < 4; ++i) - { - mst_my_bool.detail().name_hash()[i] = my_bool_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_bool); - - MinimalStructMember mst_my_int32; - mst_my_int32.common().member_id(memberId++); - mst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_int32.common().member_flags().IS_OPTIONAL(false); - mst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_int32.common().member_flags().IS_KEY(false); - mst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 my_int32_hash("my_int32"); - for(int i = 0; i < 4; ++i) - { - mst_my_int32.detail().name_hash()[i] = my_int32_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_int32); - - MinimalStructMember mst_my_string; - mst_my_string.common().member_id(memberId++); - mst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_string.common().member_flags().IS_OPTIONAL(false); - mst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_string.common().member_flags().IS_KEY(false); - mst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 my_string_hash("my_string"); - for(int i = 0; i < 4; ++i) - { - mst_my_string.detail().name_hash()[i] = my_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_string); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicStruct", false); -} - -const TypeObject* GetCompleteBasicStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_bool; - cst_my_bool.common().member_id(memberId++); - cst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_bool.common().member_flags().IS_OPTIONAL(false); - cst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_bool.common().member_flags().IS_KEY(false); - cst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - cst_my_bool.detail().name("my_bool"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_bool); - - CompleteStructMember cst_my_int32; - cst_my_int32.common().member_id(memberId++); - cst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_int32.common().member_flags().IS_OPTIONAL(false); - cst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_int32.common().member_flags().IS_KEY(false); - cst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_my_int32.detail().name("my_int32"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_int32); - - CompleteStructMember cst_my_string; - cst_my_string.common().member_id(memberId++); - cst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_string.common().member_flags().IS_OPTIONAL(false); - cst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_string.common().member_flags().IS_KEY(false); - cst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_my_string.detail().name("my_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_string); - - - // Header - type_object->complete().struct_type().header().detail().type_name("BasicStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicStruct", true); -} - - - -const TypeIdentifier* GetBasicNamesStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BasicNamesStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetBasicNamesStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("BasicNamesStruct", complete); -} - -const TypeObject* GetBasicNamesStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicNamesStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteBasicNamesStructObject(); - } - //else - return GetMinimalBasicNamesStructObject(); -} - -const TypeObject* GetMinimalBasicNamesStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicNamesStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_bool_name; - mst_my_bool_name.common().member_id(memberId++); - mst_my_bool_name.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_bool_name.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_bool_name.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_bool_name.common().member_flags().IS_OPTIONAL(false); - mst_my_bool_name.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_bool_name.common().member_flags().IS_KEY(false); - mst_my_bool_name.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_bool_name.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - MD5 my_bool_name_hash("my_bool_name"); - for(int i = 0; i < 4; ++i) - { - mst_my_bool_name.detail().name_hash()[i] = my_bool_name_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_bool_name); - - MinimalStructMember mst_my_int32_name; - mst_my_int32_name.common().member_id(memberId++); - mst_my_int32_name.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_int32_name.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_int32_name.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_int32_name.common().member_flags().IS_OPTIONAL(false); - mst_my_int32_name.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_int32_name.common().member_flags().IS_KEY(false); - mst_my_int32_name.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_int32_name.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 my_int32_name_hash("my_int32_name"); - for(int i = 0; i < 4; ++i) - { - mst_my_int32_name.detail().name_hash()[i] = my_int32_name_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_int32_name); - - MinimalStructMember mst_my_string_name; - mst_my_string_name.common().member_id(memberId++); - mst_my_string_name.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_string_name.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_string_name.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_string_name.common().member_flags().IS_OPTIONAL(false); - mst_my_string_name.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_string_name.common().member_flags().IS_KEY(false); - mst_my_string_name.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_string_name.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 my_string_name_hash("my_string_name"); - for(int i = 0; i < 4; ++i) - { - mst_my_string_name.detail().name_hash()[i] = my_string_name_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_string_name); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicNamesStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicNamesStruct", false); -} - -const TypeObject* GetCompleteBasicNamesStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicNamesStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_bool_name; - cst_my_bool_name.common().member_id(memberId++); - cst_my_bool_name.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_bool_name.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_bool_name.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_bool_name.common().member_flags().IS_OPTIONAL(false); - cst_my_bool_name.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_bool_name.common().member_flags().IS_KEY(false); - cst_my_bool_name.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_bool_name.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - cst_my_bool_name.detail().name("my_bool_name"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_bool_name); - - CompleteStructMember cst_my_int32_name; - cst_my_int32_name.common().member_id(memberId++); - cst_my_int32_name.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_int32_name.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_int32_name.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_int32_name.common().member_flags().IS_OPTIONAL(false); - cst_my_int32_name.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_int32_name.common().member_flags().IS_KEY(false); - cst_my_int32_name.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_int32_name.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_my_int32_name.detail().name("my_int32_name"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_int32_name); - - CompleteStructMember cst_my_string_name; - cst_my_string_name.common().member_id(memberId++); - cst_my_string_name.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_string_name.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_string_name.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_string_name.common().member_flags().IS_OPTIONAL(false); - cst_my_string_name.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_string_name.common().member_flags().IS_KEY(false); - cst_my_string_name.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_string_name.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_my_string_name.detail().name("my_string_name"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_string_name); - - - // Header - type_object->complete().struct_type().header().detail().type_name("BasicNamesStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicNamesStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicNamesStruct", true); -} - - - -const TypeIdentifier* GetBasicBadStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BasicBadStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetBasicBadStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("BasicBadStruct", complete); -} - -const TypeObject* GetBasicBadStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicBadStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteBasicBadStructObject(); - } - //else - return GetMinimalBasicBadStructObject(); -} - -const TypeObject* GetMinimalBasicBadStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicBadStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_bool; - mst_my_bool.common().member_id(memberId++); - mst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_bool.common().member_flags().IS_OPTIONAL(false); - mst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_bool.common().member_flags().IS_KEY(false); - mst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - - MD5 my_bool_hash("my_bool"); - for(int i = 0; i < 4; ++i) - { - mst_my_bool.detail().name_hash()[i] = my_bool_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_bool); - - MinimalStructMember mst_my_int32; - mst_my_int32.common().member_id(memberId++); - mst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_int32.common().member_flags().IS_OPTIONAL(false); - mst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_int32.common().member_flags().IS_KEY(false); - mst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 my_int32_hash("my_int32"); - for(int i = 0; i < 4; ++i) - { - mst_my_int32.detail().name_hash()[i] = my_int32_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_int32); - - MinimalStructMember mst_my_string; - mst_my_string.common().member_id(memberId++); - mst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_string.common().member_flags().IS_OPTIONAL(false); - mst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_string.common().member_flags().IS_KEY(false); - mst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 my_string_hash("my_string"); - for(int i = 0; i < 4; ++i) - { - mst_my_string.detail().name_hash()[i] = my_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_string); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicBadStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicBadStruct", false); -} - -const TypeObject* GetCompleteBasicBadStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicBadStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_bool; - cst_my_bool.common().member_id(memberId++); - cst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_bool.common().member_flags().IS_OPTIONAL(false); - cst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_bool.common().member_flags().IS_KEY(false); - cst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - - cst_my_bool.detail().name("my_bool"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_bool); - - CompleteStructMember cst_my_int32; - cst_my_int32.common().member_id(memberId++); - cst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_int32.common().member_flags().IS_OPTIONAL(false); - cst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_int32.common().member_flags().IS_KEY(false); - cst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_my_int32.detail().name("my_int32"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_int32); - - CompleteStructMember cst_my_string; - cst_my_string.common().member_id(memberId++); - cst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_string.common().member_flags().IS_OPTIONAL(false); - cst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_string.common().member_flags().IS_KEY(false); - cst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_my_string.detail().name("my_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_string); - - - // Header - type_object->complete().struct_type().header().detail().type_name("BasicBadStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicBadStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicBadStruct", true); -} - - - -const TypeIdentifier* GetBasicWideStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BasicWideStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetBasicWideStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("BasicWideStruct", complete); -} - -const TypeObject* GetBasicWideStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicWideStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteBasicWideStructObject(); - } - //else - return GetMinimalBasicWideStructObject(); -} - -const TypeObject* GetMinimalBasicWideStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicWideStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_bool; - mst_my_bool.common().member_id(memberId++); - mst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_bool.common().member_flags().IS_OPTIONAL(false); - mst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_bool.common().member_flags().IS_KEY(false); - mst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - MD5 my_bool_hash("my_bool"); - for(int i = 0; i < 4; ++i) - { - mst_my_bool.detail().name_hash()[i] = my_bool_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_bool); - - MinimalStructMember mst_my_int32; - mst_my_int32.common().member_id(memberId++); - mst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_int32.common().member_flags().IS_OPTIONAL(false); - mst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_int32.common().member_flags().IS_KEY(false); - mst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 my_int32_hash("my_int32"); - for(int i = 0; i < 4; ++i) - { - mst_my_int32.detail().name_hash()[i] = my_int32_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_int32); - - MinimalStructMember mst_my_string; - mst_my_string.common().member_id(memberId++); - mst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_string.common().member_flags().IS_OPTIONAL(false); - mst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_string.common().member_flags().IS_KEY(false); - mst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 my_string_hash("my_string"); - for(int i = 0; i < 4; ++i) - { - mst_my_string.detail().name_hash()[i] = my_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_string); - - MinimalStructMember mst_new_int32; - mst_new_int32.common().member_id(memberId++); - mst_new_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_new_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_new_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_new_int32.common().member_flags().IS_OPTIONAL(false); - mst_new_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_new_int32.common().member_flags().IS_KEY(false); - mst_new_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_new_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 new_int32_hash("new_int32"); - for(int i = 0; i < 4; ++i) - { - mst_new_int32.detail().name_hash()[i] = new_int32_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_new_int32); - - MinimalStructMember mst_new_string; - mst_new_string.common().member_id(memberId++); - mst_new_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_new_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_new_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_new_string.common().member_flags().IS_OPTIONAL(false); - mst_new_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_new_string.common().member_flags().IS_KEY(false); - mst_new_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_new_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 new_string_hash("new_string"); - for(int i = 0; i < 4; ++i) - { - mst_new_string.detail().name_hash()[i] = new_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_new_string); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicWideStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicWideStruct", false); -} - -const TypeObject* GetCompleteBasicWideStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BasicWideStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_bool; - cst_my_bool.common().member_id(memberId++); - cst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_bool.common().member_flags().IS_OPTIONAL(false); - cst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_bool.common().member_flags().IS_KEY(false); - cst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - cst_my_bool.detail().name("my_bool"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_bool); - - CompleteStructMember cst_my_int32; - cst_my_int32.common().member_id(memberId++); - cst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_int32.common().member_flags().IS_OPTIONAL(false); - cst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_int32.common().member_flags().IS_KEY(false); - cst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_my_int32.detail().name("my_int32"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_int32); - - CompleteStructMember cst_my_string; - cst_my_string.common().member_id(memberId++); - cst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_string.common().member_flags().IS_OPTIONAL(false); - cst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_string.common().member_flags().IS_KEY(false); - cst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_my_string.detail().name("my_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_string); - - CompleteStructMember cst_new_int32; - cst_new_int32.common().member_id(memberId++); - cst_new_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_new_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_new_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_new_int32.common().member_flags().IS_OPTIONAL(false); - cst_new_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_new_int32.common().member_flags().IS_KEY(false); - cst_new_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_new_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_new_int32.detail().name("new_int32"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_new_int32); - - CompleteStructMember cst_new_string; - cst_new_string.common().member_id(memberId++); - cst_new_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_new_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_new_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_new_string.common().member_flags().IS_OPTIONAL(false); - cst_new_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_new_string.common().member_flags().IS_KEY(false); - cst_new_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_new_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_new_string.detail().name("new_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_new_string); - - - // Header - type_object->complete().struct_type().header().detail().type_name("BasicWideStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BasicWideStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BasicWideStruct", true); -} - - - -const TypeIdentifier* GetBadBasicWideStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("BadBasicWideStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetBadBasicWideStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("BadBasicWideStruct", complete); -} - -const TypeObject* GetBadBasicWideStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BadBasicWideStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteBadBasicWideStructObject(); - } - //else - return GetMinimalBadBasicWideStructObject(); -} - -const TypeObject* GetMinimalBadBasicWideStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BadBasicWideStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_new_int32; - mst_new_int32.common().member_id(memberId++); - mst_new_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_new_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_new_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_new_int32.common().member_flags().IS_OPTIONAL(false); - mst_new_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_new_int32.common().member_flags().IS_KEY(false); - mst_new_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_new_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 new_int32_hash("new_int32"); - for(int i = 0; i < 4; ++i) - { - mst_new_int32.detail().name_hash()[i] = new_int32_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_new_int32); - - MinimalStructMember mst_new_string; - mst_new_string.common().member_id(memberId++); - mst_new_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_new_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_new_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_new_string.common().member_flags().IS_OPTIONAL(false); - mst_new_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_new_string.common().member_flags().IS_KEY(false); - mst_new_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_new_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 new_string_hash("new_string"); - for(int i = 0; i < 4; ++i) - { - mst_new_string.detail().name_hash()[i] = new_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_new_string); - - MinimalStructMember mst_my_bool; - mst_my_bool.common().member_id(memberId++); - mst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_bool.common().member_flags().IS_OPTIONAL(false); - mst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_bool.common().member_flags().IS_KEY(false); - mst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - MD5 my_bool_hash("my_bool"); - for(int i = 0; i < 4; ++i) - { - mst_my_bool.detail().name_hash()[i] = my_bool_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_bool); - - MinimalStructMember mst_my_int32; - mst_my_int32.common().member_id(memberId++); - mst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_int32.common().member_flags().IS_OPTIONAL(false); - mst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_int32.common().member_flags().IS_KEY(false); - mst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - MD5 my_int32_hash("my_int32"); - for(int i = 0; i < 4; ++i) - { - mst_my_int32.detail().name_hash()[i] = my_int32_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_int32); - - MinimalStructMember mst_my_string; - mst_my_string.common().member_id(memberId++); - mst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_string.common().member_flags().IS_OPTIONAL(false); - mst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_string.common().member_flags().IS_KEY(false); - mst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 my_string_hash("my_string"); - for(int i = 0; i < 4; ++i) - { - mst_my_string.detail().name_hash()[i] = my_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_string); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BadBasicWideStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BadBasicWideStruct", false); -} - -const TypeObject* GetCompleteBadBasicWideStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("BadBasicWideStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_new_int32; - cst_new_int32.common().member_id(memberId++); - cst_new_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_new_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_new_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_new_int32.common().member_flags().IS_OPTIONAL(false); - cst_new_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_new_int32.common().member_flags().IS_KEY(false); - cst_new_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_new_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_new_int32.detail().name("new_int32"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_new_int32); - - CompleteStructMember cst_new_string; - cst_new_string.common().member_id(memberId++); - cst_new_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_new_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_new_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_new_string.common().member_flags().IS_OPTIONAL(false); - cst_new_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_new_string.common().member_flags().IS_KEY(false); - cst_new_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_new_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_new_string.detail().name("new_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_new_string); - - CompleteStructMember cst_my_bool; - cst_my_bool.common().member_id(memberId++); - cst_my_bool.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_bool.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_bool.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_bool.common().member_flags().IS_OPTIONAL(false); - cst_my_bool.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_bool.common().member_flags().IS_KEY(false); - cst_my_bool.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_bool.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("bool", false)); - - - cst_my_bool.detail().name("my_bool"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_bool); - - CompleteStructMember cst_my_int32; - cst_my_int32.common().member_id(memberId++); - cst_my_int32.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_int32.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_int32.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_int32.common().member_flags().IS_OPTIONAL(false); - cst_my_int32.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_int32.common().member_flags().IS_KEY(false); - cst_my_int32.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_int32.common().member_type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - cst_my_int32.detail().name("my_int32"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_int32); - - CompleteStructMember cst_my_string; - cst_my_string.common().member_id(memberId++); - cst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_string.common().member_flags().IS_OPTIONAL(false); - cst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_string.common().member_flags().IS_KEY(false); - cst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_my_string.detail().name("my_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_string); - - - // Header - type_object->complete().struct_type().header().detail().type_name("BadBasicWideStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("BadBasicWideStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("BadBasicWideStruct", true); -} - - - -const TypeIdentifier* GetStringStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("StringStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetStringStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("StringStruct", complete); -} - -const TypeObject* GetStringStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("StringStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteStringStructObject(); - } - //else - return GetMinimalStringStructObject(); -} - -const TypeObject* GetMinimalStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("StringStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_string; - mst_my_string.common().member_id(memberId++); - mst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_string.common().member_flags().IS_OPTIONAL(false); - mst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_string.common().member_flags().IS_KEY(false); - mst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - MD5 my_string_hash("my_string"); - for(int i = 0; i < 4; ++i) - { - mst_my_string.detail().name_hash()[i] = my_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_string); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("StringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("StringStruct", false); -} - -const TypeObject* GetCompleteStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("StringStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_string; - cst_my_string.common().member_id(memberId++); - cst_my_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_string.common().member_flags().IS_OPTIONAL(false); - cst_my_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_string.common().member_flags().IS_KEY(false); - cst_my_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, false)); - - cst_my_string.detail().name("my_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_string); - - - // Header - type_object->complete().struct_type().header().detail().type_name("StringStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("StringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("StringStruct", true); -} - - - -const TypeIdentifier* GetLargeStringStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("LargeStringStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetLargeStringStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("LargeStringStruct", complete); -} - -const TypeObject* GetLargeStringStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LargeStringStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteLargeStringStructObject(); - } - //else - return GetMinimalLargeStringStructObject(); -} - -const TypeObject* GetMinimalLargeStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LargeStringStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_large_string; - mst_my_large_string.common().member_id(memberId++); - mst_my_large_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_large_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_large_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_large_string.common().member_flags().IS_OPTIONAL(false); - mst_my_large_string.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_large_string.common().member_flags().IS_KEY(false); - mst_my_large_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_large_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(41925, false)); - - MD5 my_large_string_hash("my_large_string"); - for(int i = 0; i < 4; ++i) - { - mst_my_large_string.detail().name_hash()[i] = my_large_string_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_large_string); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("LargeStringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("LargeStringStruct", false); -} - -const TypeObject* GetCompleteLargeStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LargeStringStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_large_string; - cst_my_large_string.common().member_id(memberId++); - cst_my_large_string.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_large_string.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_large_string.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_large_string.common().member_flags().IS_OPTIONAL(false); - cst_my_large_string.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_large_string.common().member_flags().IS_KEY(false); - cst_my_large_string.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_large_string.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(41925, false)); - - cst_my_large_string.detail().name("my_large_string"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_large_string); - - - // Header - type_object->complete().struct_type().header().detail().type_name("LargeStringStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("LargeStringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("LargeStringStruct", true); -} - - - -const TypeIdentifier* GetWStringStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("WStringStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetWStringStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("WStringStruct", complete); -} - -const TypeObject* GetWStringStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("WStringStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteWStringStructObject(); - } - //else - return GetMinimalWStringStructObject(); -} - -const TypeObject* GetMinimalWStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("WStringStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_wstring; - mst_my_wstring.common().member_id(memberId++); - mst_my_wstring.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_wstring.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_wstring.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_wstring.common().member_flags().IS_OPTIONAL(false); - mst_my_wstring.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_wstring.common().member_flags().IS_KEY(false); - mst_my_wstring.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_wstring.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, true)); - - MD5 my_wstring_hash("my_wstring"); - for(int i = 0; i < 4; ++i) - { - mst_my_wstring.detail().name_hash()[i] = my_wstring_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_wstring); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("WStringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("WStringStruct", false); -} - -const TypeObject* GetCompleteWStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("WStringStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_wstring; - cst_my_wstring.common().member_id(memberId++); - cst_my_wstring.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_wstring.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_wstring.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_wstring.common().member_flags().IS_OPTIONAL(false); - cst_my_wstring.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_wstring.common().member_flags().IS_KEY(false); - cst_my_wstring.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_wstring.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(255, true)); - - cst_my_wstring.detail().name("my_wstring"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_wstring); - - - // Header - type_object->complete().struct_type().header().detail().type_name("WStringStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("WStringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("WStringStruct", true); -} - - - -const TypeIdentifier* GetLargeWStringStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("LargeWStringStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetLargeWStringStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("LargeWStringStruct", complete); -} - -const TypeObject* GetLargeWStringStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LargeWStringStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteLargeWStringStructObject(); - } - //else - return GetMinimalLargeWStringStructObject(); -} - -const TypeObject* GetMinimalLargeWStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LargeWStringStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_large_wstring; - mst_my_large_wstring.common().member_id(memberId++); - mst_my_large_wstring.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_large_wstring.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_large_wstring.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_large_wstring.common().member_flags().IS_OPTIONAL(false); - mst_my_large_wstring.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_large_wstring.common().member_flags().IS_KEY(false); - mst_my_large_wstring.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_large_wstring.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(41925, true)); - - MD5 my_large_wstring_hash("my_large_wstring"); - for(int i = 0; i < 4; ++i) - { - mst_my_large_wstring.detail().name_hash()[i] = my_large_wstring_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_large_wstring); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("LargeWStringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("LargeWStringStruct", false); -} - -const TypeObject* GetCompleteLargeWStringStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("LargeWStringStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_large_wstring; - cst_my_large_wstring.common().member_id(memberId++); - cst_my_large_wstring.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_large_wstring.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_large_wstring.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_large_wstring.common().member_flags().IS_OPTIONAL(false); - cst_my_large_wstring.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_large_wstring.common().member_flags().IS_KEY(false); - cst_my_large_wstring.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_large_wstring.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(41925, true)); - - cst_my_large_wstring.detail().name("my_large_wstring"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_large_wstring); - - - // Header - type_object->complete().struct_type().header().detail().type_name("LargeWStringStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("LargeWStringStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("LargeWStringStruct", true); -} - - - -const TypeIdentifier* GetArrayStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArrayStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetArrayStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("ArrayStruct", complete); -} - -const TypeObject* GetArrayStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteArrayStructObject(); - } - //else - return GetMinimalArrayStructObject(); -} - -const TypeObject* GetMinimalArrayStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_array; - mst_my_array.common().member_id(memberId++); - mst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_array.common().member_flags().IS_OPTIONAL(false); - mst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_array.common().member_flags().IS_KEY(false); - mst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {2}, false)); - - MD5 my_array_hash("my_array"); - for(int i = 0; i < 4; ++i) - { - mst_my_array.detail().name_hash()[i] = my_array_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_array); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayStruct", false); -} - -const TypeObject* GetCompleteArrayStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_array; - cst_my_array.common().member_id(memberId++); - cst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_array.common().member_flags().IS_OPTIONAL(false); - cst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_array.common().member_flags().IS_KEY(false); - cst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {2}, true)); - - cst_my_array.detail().name("my_array"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_array); - - - // Header - type_object->complete().struct_type().header().detail().type_name("ArrayStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayStruct", true); -} - - - -const TypeIdentifier* GetArrayStructEqualIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArrayStructEqual", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetArrayStructEqualObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("ArrayStructEqual", complete); -} - -const TypeObject* GetArrayStructEqualObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayStructEqual", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteArrayStructEqualObject(); - } - //else - return GetMinimalArrayStructEqualObject(); -} - -const TypeObject* GetMinimalArrayStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayStructEqual", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_array_equal; - mst_my_array_equal.common().member_id(memberId++); - mst_my_array_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_array_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_array_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_array_equal.common().member_flags().IS_OPTIONAL(false); - mst_my_array_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_array_equal.common().member_flags().IS_KEY(false); - mst_my_array_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_array_equal.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {2}, false)); - - MD5 my_array_equal_hash("my_array_equal"); - for(int i = 0; i < 4; ++i) - { - mst_my_array_equal.detail().name_hash()[i] = my_array_equal_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_array_equal); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayStructEqual", false); -} - -const TypeObject* GetCompleteArrayStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayStructEqual", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_array_equal; - cst_my_array_equal.common().member_id(memberId++); - cst_my_array_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_array_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_array_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_array_equal.common().member_flags().IS_OPTIONAL(false); - cst_my_array_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_array_equal.common().member_flags().IS_KEY(false); - cst_my_array_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_array_equal.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {2}, true)); - - cst_my_array_equal.detail().name("my_array_equal"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_array_equal); - - - // Header - type_object->complete().struct_type().header().detail().type_name("ArrayStructEqual"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayStructEqual", true); -} - - - -const TypeIdentifier* GetArrayBadStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArrayBadStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetArrayBadStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("ArrayBadStruct", complete); -} - -const TypeObject* GetArrayBadStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayBadStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteArrayBadStructObject(); - } - //else - return GetMinimalArrayBadStructObject(); -} - -const TypeObject* GetMinimalArrayBadStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayBadStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_array; - mst_my_array.common().member_id(memberId++); - mst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_array.common().member_flags().IS_OPTIONAL(false); - mst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_array.common().member_flags().IS_KEY(false); - mst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint8_t", {2}, false)); - - MD5 my_array_hash("my_array"); - for(int i = 0; i < 4; ++i) - { - mst_my_array.detail().name_hash()[i] = my_array_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_array); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayBadStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayBadStruct", false); -} - -const TypeObject* GetCompleteArrayBadStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayBadStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_array; - cst_my_array.common().member_id(memberId++); - cst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_array.common().member_flags().IS_OPTIONAL(false); - cst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_array.common().member_flags().IS_KEY(false); - cst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("uint8_t", {2}, true)); - - cst_my_array.detail().name("my_array"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_array); - - - // Header - type_object->complete().struct_type().header().detail().type_name("ArrayBadStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayBadStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayBadStruct", true); -} - - - -const TypeIdentifier* GetArrayDimensionsStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArrayDimensionsStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetArrayDimensionsStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("ArrayDimensionsStruct", complete); -} - -const TypeObject* GetArrayDimensionsStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayDimensionsStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteArrayDimensionsStructObject(); - } - //else - return GetMinimalArrayDimensionsStructObject(); -} - -const TypeObject* GetMinimalArrayDimensionsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayDimensionsStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_array; - mst_my_array.common().member_id(memberId++); - mst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_array.common().member_flags().IS_OPTIONAL(false); - mst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_array.common().member_flags().IS_KEY(false); - mst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {2, 2}, false)); - - MD5 my_array_hash("my_array"); - for(int i = 0; i < 4; ++i) - { - mst_my_array.detail().name_hash()[i] = my_array_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_array); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayDimensionsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayDimensionsStruct", false); -} - -const TypeObject* GetCompleteArrayDimensionsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArrayDimensionsStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_array; - cst_my_array.common().member_id(memberId++); - cst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_array.common().member_flags().IS_OPTIONAL(false); - cst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_array.common().member_flags().IS_KEY(false); - cst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {2, 2}, true)); - - cst_my_array.detail().name("my_array"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_array); - - - // Header - type_object->complete().struct_type().header().detail().type_name("ArrayDimensionsStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArrayDimensionsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArrayDimensionsStruct", true); -} - - - -const TypeIdentifier* GetArraySizeStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("ArraySizeStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetArraySizeStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("ArraySizeStruct", complete); -} - -const TypeObject* GetArraySizeStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArraySizeStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteArraySizeStructObject(); - } - //else - return GetMinimalArraySizeStructObject(); -} - -const TypeObject* GetMinimalArraySizeStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArraySizeStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_array; - mst_my_array.common().member_id(memberId++); - mst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_array.common().member_flags().IS_OPTIONAL(false); - mst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_array.common().member_flags().IS_KEY(false); - mst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {5}, false)); - - MD5 my_array_hash("my_array"); - for(int i = 0; i < 4; ++i) - { - mst_my_array.detail().name_hash()[i] = my_array_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_array); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArraySizeStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArraySizeStruct", false); -} - -const TypeObject* GetCompleteArraySizeStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("ArraySizeStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_array; - cst_my_array.common().member_id(memberId++); - cst_my_array.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_array.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_array.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_array.common().member_flags().IS_OPTIONAL(false); - cst_my_array.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_array.common().member_flags().IS_KEY(false); - cst_my_array.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_array.common().member_type_id(*TypeObjectFactory::get_instance()->get_array_identifier("int32_t", {5}, true)); - - cst_my_array.detail().name("my_array"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_array); - - - // Header - type_object->complete().struct_type().header().detail().type_name("ArraySizeStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("ArraySizeStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("ArraySizeStruct", true); -} - - - - - -const TypeIdentifier* GetSequenceStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSequenceStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SequenceStruct", complete); -} - -const TypeObject* GetSequenceStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSequenceStructObject(); - } - //else - return GetMinimalSequenceStructObject(); -} - -const TypeObject* GetMinimalSequenceStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_sequence; - mst_my_sequence.common().member_id(memberId++); - mst_my_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_sequence.common().member_flags().IS_OPTIONAL(false); - mst_my_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_sequence.common().member_flags().IS_KEY(false); - mst_my_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", 2, false)); - - MD5 my_sequence_hash("my_sequence"); - for(int i = 0; i < 4; ++i) - { - mst_my_sequence.detail().name_hash()[i] = my_sequence_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_sequence); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceStruct", false); -} - -const TypeObject* GetCompleteSequenceStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_sequence; - cst_my_sequence.common().member_id(memberId++); - cst_my_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_sequence.common().member_flags().IS_OPTIONAL(false); - cst_my_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_sequence.common().member_flags().IS_KEY(false); - cst_my_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", 2, true)); - - cst_my_sequence.detail().name("my_sequence"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_sequence); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SequenceStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceStruct", true); -} - - - - - -const TypeIdentifier* GetSequenceStructEqualIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceStructEqual", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSequenceStructEqualObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SequenceStructEqual", complete); -} - -const TypeObject* GetSequenceStructEqualObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceStructEqual", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSequenceStructEqualObject(); - } - //else - return GetMinimalSequenceStructEqualObject(); -} - -const TypeObject* GetMinimalSequenceStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceStructEqual", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_sequence_equal; - mst_my_sequence_equal.common().member_id(memberId++); - mst_my_sequence_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_sequence_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_sequence_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_sequence_equal.common().member_flags().IS_OPTIONAL(false); - mst_my_sequence_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_sequence_equal.common().member_flags().IS_KEY(false); - mst_my_sequence_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_sequence_equal.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", 2, false)); - - MD5 my_sequence_equal_hash("my_sequence_equal"); - for(int i = 0; i < 4; ++i) - { - mst_my_sequence_equal.detail().name_hash()[i] = my_sequence_equal_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_sequence_equal); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceStructEqual", false); -} - -const TypeObject* GetCompleteSequenceStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceStructEqual", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_sequence_equal; - cst_my_sequence_equal.common().member_id(memberId++); - cst_my_sequence_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_sequence_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_sequence_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_sequence_equal.common().member_flags().IS_OPTIONAL(false); - cst_my_sequence_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_sequence_equal.common().member_flags().IS_KEY(false); - cst_my_sequence_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_sequence_equal.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", 2, true)); - - cst_my_sequence_equal.detail().name("my_sequence_equal"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_sequence_equal); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SequenceStructEqual"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceStructEqual", true); -} - - - - - -const TypeIdentifier* GetSequenceBadStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceBadStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSequenceBadStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SequenceBadStruct", complete); -} - -const TypeObject* GetSequenceBadStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceBadStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSequenceBadStructObject(); - } - //else - return GetMinimalSequenceBadStructObject(); -} - -const TypeObject* GetMinimalSequenceBadStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceBadStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_sequence; - mst_my_sequence.common().member_id(memberId++); - mst_my_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_sequence.common().member_flags().IS_OPTIONAL(false); - mst_my_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_sequence.common().member_flags().IS_KEY(false); - mst_my_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint8_t", 2, false)); - - MD5 my_sequence_hash("my_sequence"); - for(int i = 0; i < 4; ++i) - { - mst_my_sequence.detail().name_hash()[i] = my_sequence_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_sequence); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceBadStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceBadStruct", false); -} - -const TypeObject* GetCompleteSequenceBadStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceBadStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_sequence; - cst_my_sequence.common().member_id(memberId++); - cst_my_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_sequence.common().member_flags().IS_OPTIONAL(false); - cst_my_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_sequence.common().member_flags().IS_KEY(false); - cst_my_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("uint8_t", 2, true)); - - cst_my_sequence.detail().name("my_sequence"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_sequence); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SequenceBadStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceBadStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceBadStruct", true); -} - - - - - -const TypeIdentifier* GetSequenceBoundsStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceBoundsStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSequenceBoundsStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SequenceBoundsStruct", complete); -} - -const TypeObject* GetSequenceBoundsStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceBoundsStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSequenceBoundsStructObject(); - } - //else - return GetMinimalSequenceBoundsStructObject(); -} - -const TypeObject* GetMinimalSequenceBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceBoundsStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_sequence; - mst_my_sequence.common().member_id(memberId++); - mst_my_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_sequence.common().member_flags().IS_OPTIONAL(false); - mst_my_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_sequence.common().member_flags().IS_KEY(false); - mst_my_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", 4, false)); - - MD5 my_sequence_hash("my_sequence"); - for(int i = 0; i < 4; ++i) - { - mst_my_sequence.detail().name_hash()[i] = my_sequence_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_sequence); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceBoundsStruct", false); -} - -const TypeObject* GetCompleteSequenceBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceBoundsStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_sequence; - cst_my_sequence.common().member_id(memberId++); - cst_my_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_sequence.common().member_flags().IS_OPTIONAL(false); - cst_my_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_sequence.common().member_flags().IS_KEY(false); - cst_my_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier("int32_t", 4, true)); - - cst_my_sequence.detail().name("my_sequence"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_sequence); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SequenceBoundsStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceBoundsStruct", true); -} - - - - - - - -const TypeIdentifier* GetSequenceSequenceStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceSequenceStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSequenceSequenceStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SequenceSequenceStruct", complete); -} - -const TypeObject* GetSequenceSequenceStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSequenceSequenceStructObject(); - } - //else - return GetMinimalSequenceSequenceStructObject(); -} - -const TypeObject* GetMinimalSequenceSequenceStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_sequence_sequence; - mst_my_sequence_sequence.common().member_id(memberId++); - mst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_sequence_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_sequence_sequence.common().member_flags().IS_OPTIONAL(false); - mst_my_sequence_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_sequence_sequence.common().member_flags().IS_KEY(false); - mst_my_sequence_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_sequence_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier(TypeNamesGenerator::get_sequence_type_name("int32_t", 2), 3, false)); - - MD5 my_sequence_sequence_hash("my_sequence_sequence"); - for(int i = 0; i < 4; ++i) - { - mst_my_sequence_sequence.detail().name_hash()[i] = my_sequence_sequence_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_sequence_sequence); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceSequenceStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceStruct", false); -} - -const TypeObject* GetCompleteSequenceSequenceStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_sequence_sequence; - cst_my_sequence_sequence.common().member_id(memberId++); - cst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_sequence_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_sequence_sequence.common().member_flags().IS_OPTIONAL(false); - cst_my_sequence_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_sequence_sequence.common().member_flags().IS_KEY(false); - cst_my_sequence_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_sequence_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier(TypeNamesGenerator::get_sequence_type_name("int32_t", 2), 3, true)); - - cst_my_sequence_sequence.detail().name("my_sequence_sequence"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_sequence_sequence); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SequenceSequenceStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceSequenceStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceStruct", true); -} - - - - - - - -const TypeIdentifier* GetSequenceSequenceBoundsStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SequenceSequenceBoundsStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSequenceSequenceBoundsStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SequenceSequenceBoundsStruct", complete); -} - -const TypeObject* GetSequenceSequenceBoundsStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceBoundsStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSequenceSequenceBoundsStructObject(); - } - //else - return GetMinimalSequenceSequenceBoundsStructObject(); -} - -const TypeObject* GetMinimalSequenceSequenceBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceBoundsStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_sequence_sequence; - mst_my_sequence_sequence.common().member_id(memberId++); - mst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_sequence_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_sequence_sequence.common().member_flags().IS_OPTIONAL(false); - mst_my_sequence_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_sequence_sequence.common().member_flags().IS_KEY(false); - mst_my_sequence_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_sequence_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier(TypeNamesGenerator::get_sequence_type_name("int32_t", 5), 5, false)); - - MD5 my_sequence_sequence_hash("my_sequence_sequence"); - for(int i = 0; i < 4; ++i) - { - mst_my_sequence_sequence.detail().name_hash()[i] = my_sequence_sequence_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_sequence_sequence); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceSequenceBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceBoundsStruct", false); -} - -const TypeObject* GetCompleteSequenceSequenceBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceBoundsStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_sequence_sequence; - cst_my_sequence_sequence.common().member_id(memberId++); - cst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_sequence_sequence.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_sequence_sequence.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_sequence_sequence.common().member_flags().IS_OPTIONAL(false); - cst_my_sequence_sequence.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_sequence_sequence.common().member_flags().IS_KEY(false); - cst_my_sequence_sequence.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_sequence_sequence.common().member_type_id(*TypeObjectFactory::get_instance()->get_sequence_identifier(TypeNamesGenerator::get_sequence_type_name("int32_t", 5), 5, true)); - - cst_my_sequence_sequence.detail().name("my_sequence_sequence"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_sequence_sequence); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SequenceSequenceBoundsStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SequenceSequenceBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SequenceSequenceBoundsStruct", true); -} - - - - - -const TypeIdentifier* GetMapStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMapStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MapStruct", complete); -} - -const TypeObject* GetMapStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMapStructObject(); - } - //else - return GetMinimalMapStructObject(); -} - -const TypeObject* GetMinimalMapStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_map; - mst_my_map.common().member_id(memberId++); - mst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map.common().member_flags().IS_OPTIONAL(false); - mst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map.common().member_flags().IS_KEY(false); - mst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int32_t", 2, false)); - - MD5 my_map_hash("my_map"); - for(int i = 0; i < 4; ++i) - { - mst_my_map.detail().name_hash()[i] = my_map_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapStruct", false); -} - -const TypeObject* GetCompleteMapStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_map; - cst_my_map.common().member_id(memberId++); - cst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map.common().member_flags().IS_OPTIONAL(false); - cst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map.common().member_flags().IS_KEY(false); - cst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int32_t", 2, true)); - - cst_my_map.detail().name("my_map"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MapStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapStruct", true); -} - - - - - -const TypeIdentifier* GetMapStructEqualIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapStructEqual", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMapStructEqualObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MapStructEqual", complete); -} - -const TypeObject* GetMapStructEqualObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapStructEqual", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMapStructEqualObject(); - } - //else - return GetMinimalMapStructEqualObject(); -} - -const TypeObject* GetMinimalMapStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapStructEqual", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_map_equal; - mst_my_map_equal.common().member_id(memberId++); - mst_my_map_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map_equal.common().member_flags().IS_OPTIONAL(false); - mst_my_map_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map_equal.common().member_flags().IS_KEY(false); - mst_my_map_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map_equal.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int32_t", 2, false)); - - MD5 my_map_equal_hash("my_map_equal"); - for(int i = 0; i < 4; ++i) - { - mst_my_map_equal.detail().name_hash()[i] = my_map_equal_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map_equal); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapStructEqual", false); -} - -const TypeObject* GetCompleteMapStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapStructEqual", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_map_equal; - cst_my_map_equal.common().member_id(memberId++); - cst_my_map_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map_equal.common().member_flags().IS_OPTIONAL(false); - cst_my_map_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map_equal.common().member_flags().IS_KEY(false); - cst_my_map_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map_equal.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int32_t", 2, true)); - - cst_my_map_equal.detail().name("my_map_equal"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map_equal); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MapStructEqual"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapStructEqual", true); -} - - - - - -const TypeIdentifier* GetMapBadKeyStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapBadKeyStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMapBadKeyStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MapBadKeyStruct", complete); -} - -const TypeObject* GetMapBadKeyStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBadKeyStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMapBadKeyStructObject(); - } - //else - return GetMinimalMapBadKeyStructObject(); -} - -const TypeObject* GetMinimalMapBadKeyStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBadKeyStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_map; - mst_my_map.common().member_id(memberId++); - mst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map.common().member_flags().IS_OPTIONAL(false); - mst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map.common().member_flags().IS_KEY(false); - mst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("uint8_t", "int32_t", 2, false)); - - MD5 my_map_hash("my_map"); - for(int i = 0; i < 4; ++i) - { - mst_my_map.detail().name_hash()[i] = my_map_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapBadKeyStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapBadKeyStruct", false); -} - -const TypeObject* GetCompleteMapBadKeyStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBadKeyStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_map; - cst_my_map.common().member_id(memberId++); - cst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map.common().member_flags().IS_OPTIONAL(false); - cst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map.common().member_flags().IS_KEY(false); - cst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("uint8_t", "int32_t", 2, true)); - - cst_my_map.detail().name("my_map"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MapBadKeyStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapBadKeyStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapBadKeyStruct", true); -} - - - - - -const TypeIdentifier* GetMapBadElemStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapBadElemStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMapBadElemStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MapBadElemStruct", complete); -} - -const TypeObject* GetMapBadElemStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBadElemStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMapBadElemStructObject(); - } - //else - return GetMinimalMapBadElemStructObject(); -} - -const TypeObject* GetMinimalMapBadElemStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBadElemStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_map; - mst_my_map.common().member_id(memberId++); - mst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map.common().member_flags().IS_OPTIONAL(false); - mst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map.common().member_flags().IS_KEY(false); - mst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int64_t", 2, false)); - - MD5 my_map_hash("my_map"); - for(int i = 0; i < 4; ++i) - { - mst_my_map.detail().name_hash()[i] = my_map_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapBadElemStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapBadElemStruct", false); -} - -const TypeObject* GetCompleteMapBadElemStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBadElemStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_map; - cst_my_map.common().member_id(memberId++); - cst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map.common().member_flags().IS_OPTIONAL(false); - cst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map.common().member_flags().IS_KEY(false); - cst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int64_t", 2, true)); - - cst_my_map.detail().name("my_map"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MapBadElemStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapBadElemStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapBadElemStruct", true); -} - - - - - -const TypeIdentifier* GetMapBoundsStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapBoundsStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMapBoundsStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MapBoundsStruct", complete); -} - -const TypeObject* GetMapBoundsStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBoundsStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMapBoundsStructObject(); - } - //else - return GetMinimalMapBoundsStructObject(); -} - -const TypeObject* GetMinimalMapBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBoundsStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_map; - mst_my_map.common().member_id(memberId++); - mst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map.common().member_flags().IS_OPTIONAL(false); - mst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map.common().member_flags().IS_KEY(false); - mst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int32_t", 4, false)); - - MD5 my_map_hash("my_map"); - for(int i = 0; i < 4; ++i) - { - mst_my_map.detail().name_hash()[i] = my_map_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapBoundsStruct", false); -} - -const TypeObject* GetCompleteMapBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapBoundsStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_map; - cst_my_map.common().member_id(memberId++); - cst_my_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map.common().member_flags().IS_OPTIONAL(false); - cst_my_map.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map.common().member_flags().IS_KEY(false); - cst_my_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", "int32_t", 4, true)); - - cst_my_map.detail().name("my_map"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MapBoundsStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapBoundsStruct", true); -} - - - - - - - -const TypeIdentifier* GetMapMapStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapMapStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMapMapStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MapMapStruct", complete); -} - -const TypeObject* GetMapMapStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapMapStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMapMapStructObject(); - } - //else - return GetMinimalMapMapStructObject(); -} - -const TypeObject* GetMinimalMapMapStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapMapStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_map_map; - mst_my_map_map.common().member_id(memberId++); - mst_my_map_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map_map.common().member_flags().IS_OPTIONAL(false); - mst_my_map_map.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map_map.common().member_flags().IS_KEY(false); - mst_my_map_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", TypeNamesGenerator::get_map_type_name("int32_t", "int32_t", 2), 2, false)); - - MD5 my_map_map_hash("my_map_map"); - for(int i = 0; i < 4; ++i) - { - mst_my_map_map.detail().name_hash()[i] = my_map_map_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map_map); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapMapStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapMapStruct", false); -} - -const TypeObject* GetCompleteMapMapStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapMapStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_map_map; - cst_my_map_map.common().member_id(memberId++); - cst_my_map_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map_map.common().member_flags().IS_OPTIONAL(false); - cst_my_map_map.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map_map.common().member_flags().IS_KEY(false); - cst_my_map_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", TypeNamesGenerator::get_map_type_name("int32_t", "int32_t", 2), 2, true)); - - cst_my_map_map.detail().name("my_map_map"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map_map); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MapMapStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapMapStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapMapStruct", true); -} - - - - - - - -const TypeIdentifier* GetMapMapBoundsStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("MapMapBoundsStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetMapMapBoundsStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("MapMapBoundsStruct", complete); -} - -const TypeObject* GetMapMapBoundsStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapMapBoundsStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteMapMapBoundsStructObject(); - } - //else - return GetMinimalMapMapBoundsStructObject(); -} - -const TypeObject* GetMinimalMapMapBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapMapBoundsStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_map_map; - mst_my_map_map.common().member_id(memberId++); - mst_my_map_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_map_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_map_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_map_map.common().member_flags().IS_OPTIONAL(false); - mst_my_map_map.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_map_map.common().member_flags().IS_KEY(false); - mst_my_map_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_map_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", TypeNamesGenerator::get_map_type_name("int32_t", "int32_t", 3), 3, false)); - - MD5 my_map_map_hash("my_map_map"); - for(int i = 0; i < 4; ++i) - { - mst_my_map_map.detail().name_hash()[i] = my_map_map_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_map_map); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapMapBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapMapBoundsStruct", false); -} - -const TypeObject* GetCompleteMapMapBoundsStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("MapMapBoundsStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_map_map; - cst_my_map_map.common().member_id(memberId++); - cst_my_map_map.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_map_map.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_map_map.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_map_map.common().member_flags().IS_OPTIONAL(false); - cst_my_map_map.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_map_map.common().member_flags().IS_KEY(false); - cst_my_map_map.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_map_map.common().member_type_id(*TypeObjectFactory::get_instance()->get_map_identifier("int32_t", TypeNamesGenerator::get_map_type_name("int32_t", "int32_t", 3), 3, true)); - - cst_my_map_map.detail().name("my_map_map"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_map_map); - - - // Header - type_object->complete().struct_type().header().detail().type_name("MapMapBoundsStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("MapMapBoundsStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("MapMapBoundsStruct", true); -} - - - -const TypeIdentifier* GetSimpleUnionIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnion", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleUnionObject(complete); - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnion", complete); -} - -const TypeObject* GetSimpleUnionObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnion", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleUnionObject(); - } - // else - return GetMinimalSimpleUnionObject(); -} - -const TypeObject* GetMinimalSimpleUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnion", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_UNION); - - type_object->minimal().union_type().union_flags().IS_FINAL(false); - type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); - type_object->minimal().union_type().union_flags().IS_MUTABLE(false); - type_object->minimal().union_type().union_flags().IS_NESTED(false); - type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->minimal().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - MinimalUnionMember mst_first; - mst_first.common().member_id(memberId++); - mst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_first.common().member_flags().IS_KEY(false); // Doesn't apply - mst_first.common().member_flags().IS_DEFAULT(false); - mst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - mst_first.common().label_seq().emplace_back(A); - - MD5 first_hash("first"); - for(int i = 0; i < 4; ++i) - { - mst_first.detail().name_hash()[i] = first_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_first); - - MinimalUnionMember mst_second; - mst_second.common().member_id(memberId++); - mst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_second.common().member_flags().IS_KEY(false); // Doesn't apply - mst_second.common().member_flags().IS_DEFAULT(false); - mst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - mst_second.common().label_seq().emplace_back(B); - - MD5 second_hash("second"); - for(int i = 0; i < 4; ++i) - { - mst_second.detail().name_hash()[i] = second_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_second); - - - // Header - //type_object->minimal().union_type().header().detail()... // Empty - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnion", false); -} - -const TypeObject* GetCompleteSimpleUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnion", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_UNION); - - type_object->complete().union_type().union_flags().IS_FINAL(false); - type_object->complete().union_type().union_flags().IS_APPENDABLE(false); - type_object->complete().union_type().union_flags().IS_MUTABLE(false); - type_object->complete().union_type().union_flags().IS_NESTED(false); - type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->complete().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - CompleteUnionMember cst_first; - cst_first.common().member_id(memberId++); - cst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_first.common().member_flags().IS_KEY(false); // Doesn't apply - cst_first.common().member_flags().IS_DEFAULT(false); - cst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - cst_first.common().label_seq().emplace_back(A); - - - cst_first.detail().name("first"); - - type_object->complete().union_type().member_seq().emplace_back(cst_first); - - CompleteUnionMember cst_second; - cst_second.common().member_id(memberId++); - cst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_second.common().member_flags().IS_KEY(false); // Doesn't apply - cst_second.common().member_flags().IS_DEFAULT(false); - cst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - cst_second.common().label_seq().emplace_back(B); - - - cst_second.detail().name("second"); - - type_object->complete().union_type().member_seq().emplace_back(cst_second); - - - // Header - type_object->complete().union_type().header().detail().type_name("SimpleUnion"); - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnion", true); -} - - - -const TypeIdentifier* GetSimpleUnionNamesIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionNames", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleUnionNamesObject(complete); - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionNames", complete); -} - -const TypeObject* GetSimpleUnionNamesObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNames", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleUnionNamesObject(); - } - // else - return GetMinimalSimpleUnionNamesObject(); -} - -const TypeObject* GetMinimalSimpleUnionNamesObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNames", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_UNION); - - type_object->minimal().union_type().union_flags().IS_FINAL(false); - type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); - type_object->minimal().union_type().union_flags().IS_MUTABLE(false); - type_object->minimal().union_type().union_flags().IS_NESTED(false); - type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->minimal().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - MinimalUnionMember mst_first_case; - mst_first_case.common().member_id(memberId++); - mst_first_case.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_first_case.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_first_case.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_first_case.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_first_case.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_first_case.common().member_flags().IS_KEY(false); // Doesn't apply - mst_first_case.common().member_flags().IS_DEFAULT(false); - mst_first_case.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - mst_first_case.common().label_seq().emplace_back(A); - - MD5 first_case_hash("first_case"); - for(int i = 0; i < 4; ++i) - { - mst_first_case.detail().name_hash()[i] = first_case_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_first_case); - - MinimalUnionMember mst_second_case; - mst_second_case.common().member_id(memberId++); - mst_second_case.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_second_case.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_second_case.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_second_case.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_second_case.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_second_case.common().member_flags().IS_KEY(false); // Doesn't apply - mst_second_case.common().member_flags().IS_DEFAULT(false); - mst_second_case.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - mst_second_case.common().label_seq().emplace_back(B); - - MD5 second_case_hash("second_case"); - for(int i = 0; i < 4; ++i) - { - mst_second_case.detail().name_hash()[i] = second_case_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_second_case); - - - // Header - //type_object->minimal().union_type().header().detail()... // Empty - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionNames", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNames", false); -} - -const TypeObject* GetCompleteSimpleUnionNamesObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNames", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_UNION); - - type_object->complete().union_type().union_flags().IS_FINAL(false); - type_object->complete().union_type().union_flags().IS_APPENDABLE(false); - type_object->complete().union_type().union_flags().IS_MUTABLE(false); - type_object->complete().union_type().union_flags().IS_NESTED(false); - type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->complete().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - CompleteUnionMember cst_first_case; - cst_first_case.common().member_id(memberId++); - cst_first_case.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_first_case.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_first_case.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_first_case.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_first_case.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_first_case.common().member_flags().IS_KEY(false); // Doesn't apply - cst_first_case.common().member_flags().IS_DEFAULT(false); - cst_first_case.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - cst_first_case.common().label_seq().emplace_back(A); - - - cst_first_case.detail().name("first_case"); - - type_object->complete().union_type().member_seq().emplace_back(cst_first_case); - - CompleteUnionMember cst_second_case; - cst_second_case.common().member_id(memberId++); - cst_second_case.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_second_case.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_second_case.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_second_case.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_second_case.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_second_case.common().member_flags().IS_KEY(false); // Doesn't apply - cst_second_case.common().member_flags().IS_DEFAULT(false); - cst_second_case.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - cst_second_case.common().label_seq().emplace_back(B); - - - cst_second_case.detail().name("second_case"); - - type_object->complete().union_type().member_seq().emplace_back(cst_second_case); - - - // Header - type_object->complete().union_type().header().detail().type_name("SimpleUnionNames"); - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionNames", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNames", true); -} - - - -const TypeIdentifier* GetSimpleTypeUnionIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleTypeUnion", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleTypeUnionObject(complete); - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleTypeUnion", complete); -} - -const TypeObject* GetSimpleTypeUnionObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnion", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleTypeUnionObject(); - } - // else - return GetMinimalSimpleTypeUnionObject(); -} - -const TypeObject* GetMinimalSimpleTypeUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnion", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_UNION); - - type_object->minimal().union_type().union_flags().IS_FINAL(false); - type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); - type_object->minimal().union_type().union_flags().IS_MUTABLE(false); - type_object->minimal().union_type().union_flags().IS_NESTED(false); - type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->minimal().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - MinimalUnionMember mst_first; - mst_first.common().member_id(memberId++); - mst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_first.common().member_flags().IS_KEY(false); // Doesn't apply - mst_first.common().member_flags().IS_DEFAULT(false); - mst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - - mst_first.common().label_seq().emplace_back(A); - - MD5 first_hash("first"); - for(int i = 0; i < 4; ++i) - { - mst_first.detail().name_hash()[i] = first_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_first); - - MinimalUnionMember mst_second; - mst_second.common().member_id(memberId++); - mst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_second.common().member_flags().IS_KEY(false); // Doesn't apply - mst_second.common().member_flags().IS_DEFAULT(false); - mst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - mst_second.common().label_seq().emplace_back(B); - - MD5 second_hash("second"); - for(int i = 0; i < 4; ++i) - { - mst_second.detail().name_hash()[i] = second_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_second); - - - // Header - //type_object->minimal().union_type().header().detail()... // Empty - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleTypeUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnion", false); -} - -const TypeObject* GetCompleteSimpleTypeUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnion", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_UNION); - - type_object->complete().union_type().union_flags().IS_FINAL(false); - type_object->complete().union_type().union_flags().IS_APPENDABLE(false); - type_object->complete().union_type().union_flags().IS_MUTABLE(false); - type_object->complete().union_type().union_flags().IS_NESTED(false); - type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->complete().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - CompleteUnionMember cst_first; - cst_first.common().member_id(memberId++); - cst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_first.common().member_flags().IS_KEY(false); // Doesn't apply - cst_first.common().member_flags().IS_DEFAULT(false); - cst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - cst_first.common().label_seq().emplace_back(A); - - - cst_first.detail().name("first"); - - type_object->complete().union_type().member_seq().emplace_back(cst_first); - - CompleteUnionMember cst_second; - cst_second.common().member_id(memberId++); - cst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_second.common().member_flags().IS_KEY(false); // Doesn't apply - cst_second.common().member_flags().IS_DEFAULT(false); - cst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - cst_second.common().label_seq().emplace_back(B); - - - cst_second.detail().name("second"); - - type_object->complete().union_type().member_seq().emplace_back(cst_second); - - - // Header - type_object->complete().union_type().header().detail().type_name("SimpleTypeUnion"); - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleTypeUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnion", true); -} - - - -const TypeIdentifier* GetSimpleBadUnionIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleBadUnion", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleBadUnionObject(complete); - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleBadUnion", complete); -} - -const TypeObject* GetSimpleBadUnionObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnion", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleBadUnionObject(); - } - // else - return GetMinimalSimpleBadUnionObject(); -} - -const TypeObject* GetMinimalSimpleBadUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnion", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_UNION); - - type_object->minimal().union_type().union_flags().IS_FINAL(false); - type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); - type_object->minimal().union_type().union_flags().IS_MUTABLE(false); - type_object->minimal().union_type().union_flags().IS_NESTED(false); - type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->minimal().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - MinimalUnionMember mst_first; - mst_first.common().member_id(memberId++); - mst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_first.common().member_flags().IS_KEY(false); // Doesn't apply - mst_first.common().member_flags().IS_DEFAULT(false); - mst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - mst_first.common().label_seq().emplace_back(A); - - MD5 first_hash("first"); - for(int i = 0; i < 4; ++i) - { - mst_first.detail().name_hash()[i] = first_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_first); - - MinimalUnionMember mst_second; - mst_second.common().member_id(memberId++); - mst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_second.common().member_flags().IS_KEY(false); // Doesn't apply - mst_second.common().member_flags().IS_DEFAULT(false); - mst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - mst_second.common().label_seq().emplace_back(C); - - MD5 second_hash("second"); - for(int i = 0; i < 4; ++i) - { - mst_second.detail().name_hash()[i] = second_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_second); - - - // Header - //type_object->minimal().union_type().header().detail()... // Empty - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleBadUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnion", false); -} - -const TypeObject* GetCompleteSimpleBadUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnion", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_UNION); - - type_object->complete().union_type().union_flags().IS_FINAL(false); - type_object->complete().union_type().union_flags().IS_APPENDABLE(false); - type_object->complete().union_type().union_flags().IS_MUTABLE(false); - type_object->complete().union_type().union_flags().IS_NESTED(false); - type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->complete().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - MemberId memberId = 0; - CompleteUnionMember cst_first; - cst_first.common().member_id(memberId++); - cst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_first.common().member_flags().IS_KEY(false); // Doesn't apply - cst_first.common().member_flags().IS_DEFAULT(false); - cst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - cst_first.common().label_seq().emplace_back(A); - - - cst_first.detail().name("first"); - - type_object->complete().union_type().member_seq().emplace_back(cst_first); - - CompleteUnionMember cst_second; - cst_second.common().member_id(memberId++); - cst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_second.common().member_flags().IS_KEY(false); // Doesn't apply - cst_second.common().member_flags().IS_DEFAULT(false); - cst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - cst_second.common().label_seq().emplace_back(C); - - - cst_second.detail().name("second"); - - type_object->complete().union_type().member_seq().emplace_back(cst_second); - - - // Header - type_object->complete().union_type().header().detail().type_name("SimpleBadUnion"); - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleBadUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnion", true); -} - - - -const TypeIdentifier* GetSimpleBadDiscUnionIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleBadDiscUnion", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleBadDiscUnionObject(complete); - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleBadDiscUnion", complete); -} - -const TypeObject* GetSimpleBadDiscUnionObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadDiscUnion", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleBadDiscUnionObject(); - } - // else - return GetMinimalSimpleBadDiscUnionObject(); -} - -const TypeObject* GetMinimalSimpleBadDiscUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadDiscUnion", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_UNION); - - type_object->minimal().union_type().union_flags().IS_FINAL(false); - type_object->minimal().union_type().union_flags().IS_APPENDABLE(false); - type_object->minimal().union_type().union_flags().IS_MUTABLE(false); - type_object->minimal().union_type().union_flags().IS_NESTED(false); - type_object->minimal().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->minimal().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->minimal().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->minimal().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - MemberId memberId = 0; - MinimalUnionMember mst_first; - mst_first.common().member_id(memberId++); - mst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_first.common().member_flags().IS_KEY(false); // Doesn't apply - mst_first.common().member_flags().IS_DEFAULT(false); - mst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - - mst_first.common().label_seq().emplace_back(0); - - MD5 first_hash("first"); - for(int i = 0; i < 4; ++i) - { - mst_first.detail().name_hash()[i] = first_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_first); - - MinimalUnionMember mst_second; - mst_second.common().member_id(memberId++); - mst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - mst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - mst_second.common().member_flags().IS_KEY(false); // Doesn't apply - mst_second.common().member_flags().IS_DEFAULT(false); - mst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - - mst_second.common().label_seq().emplace_back(1); - - MD5 second_hash("second"); - for(int i = 0; i < 4; ++i) - { - mst_second.detail().name_hash()[i] = second_hash.digest[i]; - } - type_object->minimal().union_type().member_seq().emplace_back(mst_second); - - - // Header - //type_object->minimal().union_type().header().detail()... // Empty - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleBadDiscUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleBadDiscUnion", false); -} - -const TypeObject* GetCompleteSimpleBadDiscUnionObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadDiscUnion", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_UNION); - - type_object->complete().union_type().union_flags().IS_FINAL(false); - type_object->complete().union_type().union_flags().IS_APPENDABLE(false); - type_object->complete().union_type().union_flags().IS_MUTABLE(false); - type_object->complete().union_type().union_flags().IS_NESTED(false); - type_object->complete().union_type().union_flags().IS_AUTOID_HASH(false); // Unsupported - - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_EXTERNAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_OPTIONAL(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - type_object->complete().union_type().discriminator().common().member_flags().IS_KEY(false); // Unsupported - type_object->complete().union_type().discriminator().common().member_flags().IS_DEFAULT(false); // Doesn't apply - - type_object->complete().union_type().discriminator().common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("uint8_t", false)); - - MemberId memberId = 0; - CompleteUnionMember cst_first; - cst_first.common().member_id(memberId++); - cst_first.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_first.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_first.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_first.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_first.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_first.common().member_flags().IS_KEY(false); // Doesn't apply - cst_first.common().member_flags().IS_DEFAULT(false); - cst_first.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int32_t", false)); - - cst_first.common().label_seq().emplace_back(0); - - - cst_first.detail().name("first"); - - type_object->complete().union_type().member_seq().emplace_back(cst_first); - - CompleteUnionMember cst_second; - cst_second.common().member_id(memberId++); - cst_second.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_second.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_second.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_second.common().member_flags().IS_OPTIONAL(false); // Doesn't apply - cst_second.common().member_flags().IS_MUST_UNDERSTAND(false); // Doesn't apply - cst_second.common().member_flags().IS_KEY(false); // Doesn't apply - cst_second.common().member_flags().IS_DEFAULT(false); - cst_second.common().type_id(*TypeObjectFactory::get_instance()->get_type_identifier("int64_t", false)); - - cst_second.common().label_seq().emplace_back(1); - - - cst_second.detail().name("second"); - - type_object->complete().union_type().member_seq().emplace_back(cst_second); - - - // Header - type_object->complete().union_type().header().detail().type_name("SimpleBadDiscUnion"); - - TypeIdentifier* identifier = new TypeIdentifier(); - identifier->_d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().union_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier->equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleBadDiscUnion", identifier, type_object); - delete type_object; - delete identifier; - return TypeObjectFactory::get_instance()->get_type_object("SimpleBadDiscUnion", true); -} - - - -const TypeIdentifier* GetSimpleUnionStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleUnionStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionStruct", complete); -} - -const TypeObject* GetSimpleUnionStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleUnionStructObject(); - } - //else - return GetMinimalSimpleUnionStructObject(); -} - -const TypeObject* GetMinimalSimpleUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_union; - mst_my_union.common().member_id(memberId++); - mst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union.common().member_flags().IS_OPTIONAL(false); - mst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union.common().member_flags().IS_KEY(false); - mst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union.common().member_type_id(*GetSimpleUnionIdentifier(false)); - - MD5 my_union_hash("my_union"); - for(int i = 0; i < 4; ++i) - { - mst_my_union.detail().name_hash()[i] = my_union_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStruct", false); -} - -const TypeObject* GetCompleteSimpleUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_union; - cst_my_union.common().member_id(memberId++); - cst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union.common().member_flags().IS_OPTIONAL(false); - cst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union.common().member_flags().IS_KEY(false); - cst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union.common().member_type_id(*GetSimpleUnionIdentifier(true)); - - cst_my_union.detail().name("my_union"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SimpleUnionStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStruct", true); -} - - - -const TypeIdentifier* GetSimpleUnionStructEqualIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionStructEqual", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleUnionStructEqualObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionStructEqual", complete); -} - -const TypeObject* GetSimpleUnionStructEqualObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStructEqual", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleUnionStructEqualObject(); - } - //else - return GetMinimalSimpleUnionStructEqualObject(); -} - -const TypeObject* GetMinimalSimpleUnionStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStructEqual", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_union_equal; - mst_my_union_equal.common().member_id(memberId++); - mst_my_union_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union_equal.common().member_flags().IS_OPTIONAL(false); - mst_my_union_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union_equal.common().member_flags().IS_KEY(false); - mst_my_union_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union_equal.common().member_type_id(*GetSimpleUnionIdentifier(false)); - - MD5 my_union_equal_hash("my_union_equal"); - for(int i = 0; i < 4; ++i) - { - mst_my_union_equal.detail().name_hash()[i] = my_union_equal_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union_equal); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStructEqual", false); -} - -const TypeObject* GetCompleteSimpleUnionStructEqualObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStructEqual", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_union_equal; - cst_my_union_equal.common().member_id(memberId++); - cst_my_union_equal.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union_equal.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union_equal.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union_equal.common().member_flags().IS_OPTIONAL(false); - cst_my_union_equal.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union_equal.common().member_flags().IS_KEY(false); - cst_my_union_equal.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union_equal.common().member_type_id(*GetSimpleUnionIdentifier(true)); - - cst_my_union_equal.detail().name("my_union_equal"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union_equal); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SimpleUnionStructEqual"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionStructEqual", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionStructEqual", true); -} - - - -const TypeIdentifier* GetSimpleUnionNamesStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionNamesStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleUnionNamesStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleUnionNamesStruct", complete); -} - -const TypeObject* GetSimpleUnionNamesStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNamesStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleUnionNamesStructObject(); - } - //else - return GetMinimalSimpleUnionNamesStructObject(); -} - -const TypeObject* GetMinimalSimpleUnionNamesStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNamesStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_union; - mst_my_union.common().member_id(memberId++); - mst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union.common().member_flags().IS_OPTIONAL(false); - mst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union.common().member_flags().IS_KEY(false); - mst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union.common().member_type_id(*GetSimpleUnionNamesIdentifier(false)); - - MD5 my_union_hash("my_union"); - for(int i = 0; i < 4; ++i) - { - mst_my_union.detail().name_hash()[i] = my_union_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionNamesStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNamesStruct", false); -} - -const TypeObject* GetCompleteSimpleUnionNamesStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNamesStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_union; - cst_my_union.common().member_id(memberId++); - cst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union.common().member_flags().IS_OPTIONAL(false); - cst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union.common().member_flags().IS_KEY(false); - cst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union.common().member_type_id(*GetSimpleUnionNamesIdentifier(true)); - - cst_my_union.detail().name("my_union"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SimpleUnionNamesStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleUnionNamesStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleUnionNamesStruct", true); -} - - - -const TypeIdentifier* GetSimpleTypeUnionStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleTypeUnionStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleTypeUnionStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleTypeUnionStruct", complete); -} - -const TypeObject* GetSimpleTypeUnionStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnionStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleTypeUnionStructObject(); - } - //else - return GetMinimalSimpleTypeUnionStructObject(); -} - -const TypeObject* GetMinimalSimpleTypeUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnionStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_union; - mst_my_union.common().member_id(memberId++); - mst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union.common().member_flags().IS_OPTIONAL(false); - mst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union.common().member_flags().IS_KEY(false); - mst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union.common().member_type_id(*GetSimpleTypeUnionIdentifier(false)); - - MD5 my_union_hash("my_union"); - for(int i = 0; i < 4; ++i) - { - mst_my_union.detail().name_hash()[i] = my_union_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleTypeUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnionStruct", false); -} - -const TypeObject* GetCompleteSimpleTypeUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnionStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_union; - cst_my_union.common().member_id(memberId++); - cst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union.common().member_flags().IS_OPTIONAL(false); - cst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union.common().member_flags().IS_KEY(false); - cst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union.common().member_type_id(*GetSimpleTypeUnionIdentifier(true)); - - cst_my_union.detail().name("my_union"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SimpleTypeUnionStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleTypeUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleTypeUnionStruct", true); -} - - - -const TypeIdentifier* GetSimpleBadUnionStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimpleBadUnionStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimpleBadUnionStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SimpleBadUnionStruct", complete); -} - -const TypeObject* GetSimpleBadUnionStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnionStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimpleBadUnionStructObject(); - } - //else - return GetMinimalSimpleBadUnionStructObject(); -} - -const TypeObject* GetMinimalSimpleBadUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnionStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_union; - mst_my_union.common().member_id(memberId++); - mst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union.common().member_flags().IS_OPTIONAL(false); - mst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union.common().member_flags().IS_KEY(false); - mst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union.common().member_type_id(*GetSimpleBadUnionIdentifier(false)); - - MD5 my_union_hash("my_union"); - for(int i = 0; i < 4; ++i) - { - mst_my_union.detail().name_hash()[i] = my_union_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleBadUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnionStruct", false); -} - -const TypeObject* GetCompleteSimpleBadUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnionStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_union; - cst_my_union.common().member_id(memberId++); - cst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union.common().member_flags().IS_OPTIONAL(false); - cst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union.common().member_flags().IS_KEY(false); - cst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union.common().member_type_id(*GetSimpleBadUnionIdentifier(true)); - - cst_my_union.detail().name("my_union"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SimpleBadUnionStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimpleBadUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimpleBadUnionStruct", true); -} - - - -const TypeIdentifier* GetSimplBadDiscUnionStructIdentifier(bool complete) -{ - const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("SimplBadDiscUnionStruct", complete); - if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) - { - return c_identifier; - } - - GetSimplBadDiscUnionStructObject(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("SimplBadDiscUnionStruct", complete); -} - -const TypeObject* GetSimplBadDiscUnionStructObject(bool complete) -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimplBadDiscUnionStruct", complete); - if (c_type_object != nullptr) - { - return c_type_object; - } - else if (complete) - { - return GetCompleteSimplBadDiscUnionStructObject(); - } - //else - return GetMinimalSimplBadDiscUnionStructObject(); -} - -const TypeObject* GetMinimalSimplBadDiscUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimplBadDiscUnionStruct", false); - if (c_type_object != nullptr) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_MINIMAL); - type_object->minimal()._d(TK_STRUCTURE); - - type_object->minimal().struct_type().struct_flags().IS_FINAL(false); - type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(false); - type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - MinimalStructMember mst_my_union; - mst_my_union.common().member_id(memberId++); - mst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - mst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - mst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - mst_my_union.common().member_flags().IS_OPTIONAL(false); - mst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - mst_my_union.common().member_flags().IS_KEY(false); - mst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_my_union.common().member_type_id(*GetSimpleBadDiscUnionIdentifier(false)); - - MD5 my_union_hash("my_union"); - for(int i = 0; i < 4; ++i) - { - mst_my_union.detail().name_hash()[i] = my_union_hash.digest[i]; - } - type_object->minimal().struct_type().member_seq().emplace_back(mst_my_union); - - - // Header - // TODO Inheritance - //type_object->minimal().struct_type().header().base_type()._d(EK_MINIMAL); - //type_object->minimal().struct_type().header().base_type().equivalence_hash()[0..13]; - TypeIdentifier identifier; - identifier._d(EK_MINIMAL); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimplBadDiscUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimplBadDiscUnionStruct", false); -} - -const TypeObject* GetCompleteSimplBadDiscUnionStructObject() -{ - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("SimplBadDiscUnionStruct", true); - if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) - { - return c_type_object; - } - - TypeObject *type_object = new TypeObject(); - type_object->_d(EK_COMPLETE); - type_object->complete()._d(TK_STRUCTURE); - - type_object->complete().struct_type().struct_flags().IS_FINAL(false); - type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); - type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(false); - type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported - - MemberId memberId = 0; - CompleteStructMember cst_my_union; - cst_my_union.common().member_id(memberId++); - cst_my_union.common().member_flags().TRY_CONSTRUCT1(false); // Unsupported - cst_my_union.common().member_flags().TRY_CONSTRUCT2(false); // Unsupported - cst_my_union.common().member_flags().IS_EXTERNAL(false); // Unsupported - cst_my_union.common().member_flags().IS_OPTIONAL(false); - cst_my_union.common().member_flags().IS_MUST_UNDERSTAND(false); - cst_my_union.common().member_flags().IS_KEY(false); - cst_my_union.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_my_union.common().member_type_id(*GetSimpleBadDiscUnionIdentifier(true)); - - cst_my_union.detail().name("my_union"); - - type_object->complete().struct_type().member_seq().emplace_back(cst_my_union); - - - // Header - type_object->complete().struct_type().header().detail().type_name("SimplBadDiscUnionStruct"); - // TODO inheritance - TypeIdentifier identifier; - identifier._d(EK_COMPLETE); - - eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1); - size_t current_alignment {0}; - SerializedPayload_t payload(static_cast( - calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4)); - eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size); - // Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document) - eprosima::fastcdr::Cdr ser( - fastbuffer, eprosima::fastcdr::Cdr::LITTLE_ENDIANNESS, - eprosima::fastcdr::CdrVersion::XCDRv1); // Object that serializes the data. - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - - ser << *type_object; -#if FASTCDR_VERSION_MAJOR == 1 - payload.length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length -#else - payload.length = (uint32_t)ser.get_serialized_data_length(); //Get the serialized length -#endif // FASTCDR_VERSION_MAJOR == 1 - MD5 objectHash; - objectHash.update((char*)payload.data, payload.length); - objectHash.finalize(); - for(int i = 0; i < 14; ++i) - { - identifier.equivalence_hash()[i] = objectHash.digest[i]; - } - - TypeObjectFactory::get_instance()->add_type_object("SimplBadDiscUnionStruct", &identifier, type_object); - delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("SimplBadDiscUnionStruct", true); -} diff --git a/test/xtypes/idl/TypesTypeObject.h b/test/xtypes/idl/TypesTypeObject.h deleted file mode 100644 index 2f615b62792..00000000000 --- a/test/xtypes/idl/TypesTypeObject.h +++ /dev/null @@ -1,394 +0,0 @@ -// 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 TypesTypeObject.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifndef _FAST_DDS_GENERATED_TYPES_TYPE_OBJECT_H_ -#define _FAST_DDS_GENERATED_TYPES_TYPE_OBJECT_H_ - - -#include -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif -#else -#define eProsima_user_DllExport -#endif - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Types_SOURCE) -#define Types_DllAPI __declspec( dllexport ) -#else -#define Types_DllAPI __declspec( dllimport ) -#endif // Types_SOURCE -#else -#define Types_DllAPI -#endif -#else -#define Types_DllAPI -#endif // _WIN32 - -using namespace eprosima::fastrtps::types; - -eProsima_user_DllExport void registerTypesTypes(); - -eProsima_user_DllExport const TypeIdentifier* GetMyEnumIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyEnumObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyEnumObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyEnumObject(); - -eProsima_user_DllExport const TypeIdentifier* GetMyBadEnumIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyBadEnumObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyBadEnumObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyBadEnumObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetMyEnumStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyEnumStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyEnumStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyEnumStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetMyBadEnumStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyBadEnumStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyBadEnumStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyBadEnumStructObject(); - -eProsima_user_DllExport const TypeIdentifier* GetMyAliasEnumIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyAliasEnumObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyAliasEnumObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyAliasEnumObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetMyAliasEnumStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMyAliasEnumStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMyAliasEnumStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMyAliasEnumStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetBasicStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetBasicStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalBasicStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteBasicStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetBasicNamesStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetBasicNamesStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalBasicNamesStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteBasicNamesStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetBasicBadStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetBasicBadStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalBasicBadStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteBasicBadStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetBasicWideStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetBasicWideStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalBasicWideStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteBasicWideStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetBadBasicWideStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetBadBasicWideStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalBadBasicWideStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteBadBasicWideStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetStringStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetStringStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalStringStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteStringStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetLargeStringStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetLargeStringStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalLargeStringStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteLargeStringStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetWStringStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetWStringStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalWStringStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteWStringStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetLargeWStringStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetLargeWStringStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalLargeWStringStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteLargeWStringStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetArrayStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetArrayStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalArrayStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteArrayStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetArrayStructEqualIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetArrayStructEqualObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalArrayStructEqualObject(); -eProsima_user_DllExport const TypeObject* GetCompleteArrayStructEqualObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetArrayBadStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetArrayBadStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalArrayBadStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteArrayBadStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetArrayDimensionsStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetArrayDimensionsStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalArrayDimensionsStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteArrayDimensionsStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetArraySizeStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetArraySizeStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalArraySizeStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteArraySizeStructObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetSequenceStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSequenceStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSequenceStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSequenceStructObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetSequenceStructEqualIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSequenceStructEqualObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSequenceStructEqualObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSequenceStructEqualObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetSequenceBadStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSequenceBadStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSequenceBadStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSequenceBadStructObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetSequenceBoundsStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSequenceBoundsStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSequenceBoundsStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSequenceBoundsStructObject(); - - - - - - - -eProsima_user_DllExport const TypeIdentifier* GetSequenceSequenceStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSequenceSequenceStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSequenceSequenceStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSequenceSequenceStructObject(); - - - - - - - -eProsima_user_DllExport const TypeIdentifier* GetSequenceSequenceBoundsStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSequenceSequenceBoundsStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSequenceSequenceBoundsStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSequenceSequenceBoundsStructObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetMapStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMapStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMapStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMapStructObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetMapStructEqualIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMapStructEqualObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMapStructEqualObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMapStructEqualObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetMapBadKeyStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMapBadKeyStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMapBadKeyStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMapBadKeyStructObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetMapBadElemStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMapBadElemStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMapBadElemStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMapBadElemStructObject(); - - - - - -eProsima_user_DllExport const TypeIdentifier* GetMapBoundsStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMapBoundsStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMapBoundsStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMapBoundsStructObject(); - - - - - - - -eProsima_user_DllExport const TypeIdentifier* GetMapMapStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMapMapStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMapMapStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMapMapStructObject(); - - - - - - - -eProsima_user_DllExport const TypeIdentifier* GetMapMapBoundsStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMapMapBoundsStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalMapMapBoundsStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteMapMapBoundsStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleUnionObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionNamesIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleUnionNamesObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionNamesObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionNamesObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleTypeUnionIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleTypeUnionObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleTypeUnionObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleTypeUnionObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleBadUnionIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleBadUnionObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleBadUnionObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleBadUnionObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleBadDiscUnionIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleBadDiscUnionObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleBadDiscUnionObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleBadDiscUnionObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleUnionStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionStructEqualIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleUnionStructEqualObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionStructEqualObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionStructEqualObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleUnionNamesStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleUnionNamesStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleUnionNamesStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleUnionNamesStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleTypeUnionStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleTypeUnionStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleTypeUnionStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleTypeUnionStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimpleBadUnionStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimpleBadUnionStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimpleBadUnionStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimpleBadUnionStructObject(); - - - -eProsima_user_DllExport const TypeIdentifier* GetSimplBadDiscUnionStructIdentifier(bool complete = false); -eProsima_user_DllExport const TypeObject* GetSimplBadDiscUnionStructObject(bool complete = false); -eProsima_user_DllExport const TypeObject* GetMinimalSimplBadDiscUnionStructObject(); -eProsima_user_DllExport const TypeObject* GetCompleteSimplBadDiscUnionStructObject(); - - -#endif // _FAST_DDS_GENERATED_TYPES_TYPE_OBJECT_H_ \ No newline at end of file diff --git a/test/xtypes/idl/Typesv1.cxx b/test/xtypes/idl/Typesv1.cxx deleted file mode 100644 index 098cc1b3b0a..00000000000 --- a/test/xtypes/idl/Typesv1.cxx +++ /dev/null @@ -1,8202 +0,0 @@ -// 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 Types.cpp - * This source file contains the implementation of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#ifdef _WIN32 -// Remove linker warning LNK4221 on Visual Studio -namespace { -char dummy; -} // namespace -#endif // _WIN32 - -#include "Types.h" - -#if FASTCDR_VERSION_MAJOR == 1 - -#include "TypesTypeObject.h" - -#include - - -#include -using namespace eprosima::fastcdr::exception; - -#include - -namespace helper { namespace internal { - -enum class Size { - UInt8, - UInt16, - UInt32, - UInt64, -}; - -constexpr Size get_size(int s) { - return (s <= 8 ) ? Size::UInt8: - (s <= 16) ? Size::UInt16: - (s <= 32) ? Size::UInt32: Size::UInt64; -} - -template -struct FindTypeH; - -template<> -struct FindTypeH { - using type = std::uint8_t; -}; - -template<> -struct FindTypeH { - using type = std::uint16_t; -}; - -template<> -struct FindTypeH { - using type = std::uint32_t; -}; - -template<> -struct FindTypeH { - using type = std::uint64_t; -}; -} - -template -struct FindType { - using type = typename internal::FindTypeH::type; -}; -} - -#define SimpleUnionStruct_max_cdr_typesize 24ULL; -#define SequenceSequenceBoundsStruct_max_cdr_typesize 132ULL; - -#define MyAliasEnumStruct_max_cdr_typesize 8ULL; -#define ArrayBadStruct_max_cdr_typesize 6ULL; -#define MapBadKeyStruct_max_cdr_typesize 24ULL; -#define SimpleBadUnionStruct_max_cdr_typesize 24ULL; -#define MyEnumStruct_max_cdr_typesize 8ULL; - -#define ArrayStructEqual_max_cdr_typesize 12ULL; -#define LargeWStringStruct_max_cdr_typesize 167708ULL; - -#define WStringStruct_max_cdr_typesize 1028ULL; -#define SequenceStruct_max_cdr_typesize 16ULL; -#define SimpleTypeUnionStruct_max_cdr_typesize 24ULL; - -#define ArrayDimensionsStruct_max_cdr_typesize 20ULL; -#define SequenceSequenceStruct_max_cdr_typesize 48ULL; -#define MapBoundsStruct_max_cdr_typesize 40ULL; -#define SequenceStructEqual_max_cdr_typesize 16ULL; -#define MapStructEqual_max_cdr_typesize 24ULL; -#define BasicStruct_max_cdr_typesize 272ULL; -#define SequenceBoundsStruct_max_cdr_typesize 24ULL; -#define MapMapStruct_max_cdr_typesize 60ULL; -#define BasicWideStruct_max_cdr_typesize 536ULL; - -#define SimplBadDiscUnionStruct_max_cdr_typesize 24ULL; -#define MapStruct_max_cdr_typesize 24ULL; - -#define MyBadEnumStruct_max_cdr_typesize 8ULL; -#define SequenceBadStruct_max_cdr_typesize 10ULL; -#define SimpleUnionNamesStruct_max_cdr_typesize 24ULL; -#define LargeStringStruct_max_cdr_typesize 41934ULL; -#define ArrayStruct_max_cdr_typesize 12ULL; -#define BadBasicWideStruct_max_cdr_typesize 536ULL; -#define ArraySizeStruct_max_cdr_typesize 24ULL; - -#define MapBadElemStruct_max_cdr_typesize 40ULL; -#define SimpleUnionStructEqual_max_cdr_typesize 24ULL; -#define BasicBadStruct_max_cdr_typesize 272ULL; -#define BasicNamesStruct_max_cdr_typesize 272ULL; -#define StringStruct_max_cdr_typesize 264ULL; - -#define MapMapBoundsStruct_max_cdr_typesize 108ULL; - - - - -MyEnumStruct::MyEnumStruct() -{ - // MyEnum m_my_enum - m_my_enum = ::A; - - // Just to register all known types - registerTypesTypes(); -} - -MyEnumStruct::~MyEnumStruct() -{ -} - -MyEnumStruct::MyEnumStruct( - const MyEnumStruct& x) -{ - m_my_enum = x.m_my_enum; - -} - -MyEnumStruct::MyEnumStruct( - MyEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; - -} - -MyEnumStruct& MyEnumStruct::operator =( - const MyEnumStruct& x) -{ - m_my_enum = x.m_my_enum; - - return *this; -} - -MyEnumStruct& MyEnumStruct::operator =( - MyEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; - - return *this; -} - -bool MyEnumStruct::operator ==( - const MyEnumStruct& x) const -{ - return (m_my_enum == x.m_my_enum); -} - -bool MyEnumStruct::operator !=( - const MyEnumStruct& x) const -{ - return !(*this == x); -} - -size_t MyEnumStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MyEnumStruct_max_cdr_typesize; -} - -size_t MyEnumStruct::getCdrSerializedSize( - const MyEnumStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void MyEnumStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << (uint32_t)m_my_enum; - -} - -void MyEnumStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_my_enum = (MyEnum)enum_value; - } - - -} - - -bool MyEnumStruct::isKeyDefined() -{ - return false; -} - -void MyEnumStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ -void MyEnumStruct::my_enum( - MyEnum _my_enum) -{ - m_my_enum = _my_enum; -} - -/*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ -MyEnum MyEnumStruct::my_enum() const -{ - return m_my_enum; -} - -/*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ -MyEnum& MyEnumStruct::my_enum() -{ - return m_my_enum; -} - - - - - -MyBadEnumStruct::MyBadEnumStruct() -{ - // MyBadEnum m_my_enum - m_my_enum = ::A1; - - // Just to register all known types - registerTypesTypes(); -} - -MyBadEnumStruct::~MyBadEnumStruct() -{ -} - -MyBadEnumStruct::MyBadEnumStruct( - const MyBadEnumStruct& x) -{ - m_my_enum = x.m_my_enum; - -} - -MyBadEnumStruct::MyBadEnumStruct( - MyBadEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; - -} - -MyBadEnumStruct& MyBadEnumStruct::operator =( - const MyBadEnumStruct& x) -{ - m_my_enum = x.m_my_enum; - - return *this; -} - -MyBadEnumStruct& MyBadEnumStruct::operator =( - MyBadEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; - - return *this; -} - -bool MyBadEnumStruct::operator ==( - const MyBadEnumStruct& x) const -{ - return (m_my_enum == x.m_my_enum); -} - -bool MyBadEnumStruct::operator !=( - const MyBadEnumStruct& x) const -{ - return !(*this == x); -} - -size_t MyBadEnumStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MyBadEnumStruct_max_cdr_typesize; -} - -size_t MyBadEnumStruct::getCdrSerializedSize( - const MyBadEnumStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void MyBadEnumStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << (uint32_t)m_my_enum; - -} - -void MyBadEnumStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_my_enum = (MyBadEnum)enum_value; - } - - -} - - -bool MyBadEnumStruct::isKeyDefined() -{ - return false; -} - -void MyBadEnumStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ -void MyBadEnumStruct::my_enum( - MyBadEnum _my_enum) -{ - m_my_enum = _my_enum; -} - -/*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ -MyBadEnum MyBadEnumStruct::my_enum() const -{ - return m_my_enum; -} - -/*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ -MyBadEnum& MyBadEnumStruct::my_enum() -{ - return m_my_enum; -} - - - - - - -MyAliasEnumStruct::MyAliasEnumStruct() -{ - // MyAliasEnum m_my_enum - m_my_enum = ::A; - - // Just to register all known types - registerTypesTypes(); -} - -MyAliasEnumStruct::~MyAliasEnumStruct() -{ -} - -MyAliasEnumStruct::MyAliasEnumStruct( - const MyAliasEnumStruct& x) -{ - m_my_enum = x.m_my_enum; - -} - -MyAliasEnumStruct::MyAliasEnumStruct( - MyAliasEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; - -} - -MyAliasEnumStruct& MyAliasEnumStruct::operator =( - const MyAliasEnumStruct& x) -{ - m_my_enum = x.m_my_enum; - - return *this; -} - -MyAliasEnumStruct& MyAliasEnumStruct::operator =( - MyAliasEnumStruct&& x) noexcept -{ - m_my_enum = x.m_my_enum; - - return *this; -} - -bool MyAliasEnumStruct::operator ==( - const MyAliasEnumStruct& x) const -{ - return (m_my_enum == x.m_my_enum); -} - -bool MyAliasEnumStruct::operator !=( - const MyAliasEnumStruct& x) const -{ - return !(*this == x); -} - -size_t MyAliasEnumStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MyAliasEnumStruct_max_cdr_typesize; -} - -size_t MyAliasEnumStruct::getCdrSerializedSize( - const MyAliasEnumStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - return current_alignment - initial_alignment; -} - - -void MyAliasEnumStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << (uint32_t)m_my_enum; - -} - -void MyAliasEnumStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - uint32_t enum_value = 0; - dcdr >> enum_value; - m_my_enum = (MyAliasEnum)enum_value; - } - - -} - - -bool MyAliasEnumStruct::isKeyDefined() -{ - return false; -} - -void MyAliasEnumStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ -void MyAliasEnumStruct::my_enum( - MyAliasEnum _my_enum) -{ - m_my_enum = _my_enum; -} - -/*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ -MyAliasEnum MyAliasEnumStruct::my_enum() const -{ - return m_my_enum; -} - -/*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ -MyAliasEnum& MyAliasEnumStruct::my_enum() -{ - return m_my_enum; -} - - - - - -BasicStruct::BasicStruct() -{ - // boolean m_my_bool - m_my_bool = false; - // long m_my_int32 - m_my_int32 = 0; - // /type_d() m_my_string - - - // Just to register all known types - registerTypesTypes(); -} - -BasicStruct::~BasicStruct() -{ -} - -BasicStruct::BasicStruct( - const BasicStruct& x) -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - -} - -BasicStruct::BasicStruct( - BasicStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - -} - -BasicStruct& BasicStruct::operator =( - const BasicStruct& x) -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - - return *this; -} - -BasicStruct& BasicStruct::operator =( - BasicStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - - return *this; -} - -bool BasicStruct::operator ==( - const BasicStruct& x) const -{ - return (m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string); -} - -bool BasicStruct::operator !=( - const BasicStruct& x) const -{ - return !(*this == x); -} - -size_t BasicStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return BasicStruct_max_cdr_typesize; -} - -size_t BasicStruct::getCdrSerializedSize( - const BasicStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void BasicStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_bool; - - scdr << m_my_int32; - - scdr << m_my_string.c_str(); - -} - -void BasicStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_bool; - - - - dcdr >> m_my_int32; - - - - dcdr >> m_my_string; - - -} - - -bool BasicStruct::isKeyDefined() -{ - return false; -} - -void BasicStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BasicStruct::my_bool( - bool _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -bool BasicStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -bool& BasicStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BasicStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BasicStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BasicStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BasicStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BasicStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BasicStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BasicStruct::my_string() -{ - return m_my_string; -} - - - - - -BasicNamesStruct::BasicNamesStruct() -{ - // boolean m_my_bool_name - m_my_bool_name = false; - // long m_my_int32_name - m_my_int32_name = 0; - // /type_d() m_my_string_name - - - // Just to register all known types - registerTypesTypes(); -} - -BasicNamesStruct::~BasicNamesStruct() -{ -} - -BasicNamesStruct::BasicNamesStruct( - const BasicNamesStruct& x) -{ - m_my_bool_name = x.m_my_bool_name; - - - m_my_int32_name = x.m_my_int32_name; - - - m_my_string_name = x.m_my_string_name; - -} - -BasicNamesStruct::BasicNamesStruct( - BasicNamesStruct&& x) noexcept -{ - m_my_bool_name = x.m_my_bool_name; - - - m_my_int32_name = x.m_my_int32_name; - - - m_my_string_name = std::move(x.m_my_string_name); - -} - -BasicNamesStruct& BasicNamesStruct::operator =( - const BasicNamesStruct& x) -{ - m_my_bool_name = x.m_my_bool_name; - - - m_my_int32_name = x.m_my_int32_name; - - - m_my_string_name = x.m_my_string_name; - - return *this; -} - -BasicNamesStruct& BasicNamesStruct::operator =( - BasicNamesStruct&& x) noexcept -{ - m_my_bool_name = x.m_my_bool_name; - - - m_my_int32_name = x.m_my_int32_name; - - - m_my_string_name = std::move(x.m_my_string_name); - - return *this; -} - -bool BasicNamesStruct::operator ==( - const BasicNamesStruct& x) const -{ - return (m_my_bool_name == x.m_my_bool_name && - m_my_int32_name == x.m_my_int32_name && - m_my_string_name == x.m_my_string_name); -} - -bool BasicNamesStruct::operator !=( - const BasicNamesStruct& x) const -{ - return !(*this == x); -} - -size_t BasicNamesStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return BasicNamesStruct_max_cdr_typesize; -} - -size_t BasicNamesStruct::getCdrSerializedSize( - const BasicNamesStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string_name().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void BasicNamesStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_bool_name; - - scdr << m_my_int32_name; - - scdr << m_my_string_name.c_str(); - -} - -void BasicNamesStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_bool_name; - - - - dcdr >> m_my_int32_name; - - - - dcdr >> m_my_string_name; - - -} - - -bool BasicNamesStruct::isKeyDefined() -{ - return false; -} - -void BasicNamesStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_bool_name - * @param _my_bool_name New value for member my_bool_name - */ -void BasicNamesStruct::my_bool_name( - bool _my_bool_name) -{ - m_my_bool_name = _my_bool_name; -} - -/*! - * @brief This function returns the value of member my_bool_name - * @return Value of member my_bool_name - */ -bool BasicNamesStruct::my_bool_name() const -{ - return m_my_bool_name; -} - -/*! - * @brief This function returns a reference to member my_bool_name - * @return Reference to member my_bool_name - */ -bool& BasicNamesStruct::my_bool_name() -{ - return m_my_bool_name; -} - - -/*! - * @brief This function sets a value in member my_int32_name - * @param _my_int32_name New value for member my_int32_name - */ -void BasicNamesStruct::my_int32_name( - int32_t _my_int32_name) -{ - m_my_int32_name = _my_int32_name; -} - -/*! - * @brief This function returns the value of member my_int32_name - * @return Value of member my_int32_name - */ -int32_t BasicNamesStruct::my_int32_name() const -{ - return m_my_int32_name; -} - -/*! - * @brief This function returns a reference to member my_int32_name - * @return Reference to member my_int32_name - */ -int32_t& BasicNamesStruct::my_int32_name() -{ - return m_my_int32_name; -} - - -/*! - * @brief This function copies the value in member my_string_name - * @param _my_string_name New value to be copied in member my_string_name - */ -void BasicNamesStruct::my_string_name( - const std::string& _my_string_name) -{ - m_my_string_name = _my_string_name; -} - -/*! - * @brief This function moves the value in member my_string_name - * @param _my_string_name New value to be moved in member my_string_name - */ -void BasicNamesStruct::my_string_name( - std::string&& _my_string_name) -{ - m_my_string_name = std::move(_my_string_name); -} - -/*! - * @brief This function returns a constant reference to member my_string_name - * @return Constant reference to member my_string_name - */ -const std::string& BasicNamesStruct::my_string_name() const -{ - return m_my_string_name; -} - -/*! - * @brief This function returns a reference to member my_string_name - * @return Reference to member my_string_name - */ -std::string& BasicNamesStruct::my_string_name() -{ - return m_my_string_name; -} - - - - - -BasicBadStruct::BasicBadStruct() -{ - // octet m_my_bool - m_my_bool = 0; - // long m_my_int32 - m_my_int32 = 0; - // /type_d() m_my_string - - - // Just to register all known types - registerTypesTypes(); -} - -BasicBadStruct::~BasicBadStruct() -{ -} - -BasicBadStruct::BasicBadStruct( - const BasicBadStruct& x) -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - -} - -BasicBadStruct::BasicBadStruct( - BasicBadStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - -} - -BasicBadStruct& BasicBadStruct::operator =( - const BasicBadStruct& x) -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - - return *this; -} - -BasicBadStruct& BasicBadStruct::operator =( - BasicBadStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - - return *this; -} - -bool BasicBadStruct::operator ==( - const BasicBadStruct& x) const -{ - return (m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string); -} - -bool BasicBadStruct::operator !=( - const BasicBadStruct& x) const -{ - return !(*this == x); -} - -size_t BasicBadStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return BasicBadStruct_max_cdr_typesize; -} - -size_t BasicBadStruct::getCdrSerializedSize( - const BasicBadStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void BasicBadStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_bool; - - scdr << m_my_int32; - - scdr << m_my_string.c_str(); - -} - -void BasicBadStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_bool; - - - - dcdr >> m_my_int32; - - - - dcdr >> m_my_string; - - -} - - -bool BasicBadStruct::isKeyDefined() -{ - return false; -} - -void BasicBadStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BasicBadStruct::my_bool( - uint8_t _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -uint8_t BasicBadStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -uint8_t& BasicBadStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BasicBadStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BasicBadStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BasicBadStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BasicBadStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BasicBadStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BasicBadStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BasicBadStruct::my_string() -{ - return m_my_string; -} - - - - - -BasicWideStruct::BasicWideStruct() -{ - // boolean m_my_bool - m_my_bool = false; - // long m_my_int32 - m_my_int32 = 0; - // /type_d() m_my_string - - // long m_new_int32 - m_new_int32 = 0; - // /type_d() m_new_string - - - // Just to register all known types - registerTypesTypes(); -} - -BasicWideStruct::~BasicWideStruct() -{ -} - -BasicWideStruct::BasicWideStruct( - const BasicWideStruct& x) -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - - - m_new_int32 = x.m_new_int32; - - - m_new_string = x.m_new_string; - -} - -BasicWideStruct::BasicWideStruct( - BasicWideStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - - - m_new_int32 = x.m_new_int32; - - - m_new_string = std::move(x.m_new_string); - -} - -BasicWideStruct& BasicWideStruct::operator =( - const BasicWideStruct& x) -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - - - m_new_int32 = x.m_new_int32; - - - m_new_string = x.m_new_string; - - return *this; -} - -BasicWideStruct& BasicWideStruct::operator =( - BasicWideStruct&& x) noexcept -{ - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - - - m_new_int32 = x.m_new_int32; - - - m_new_string = std::move(x.m_new_string); - - return *this; -} - -bool BasicWideStruct::operator ==( - const BasicWideStruct& x) const -{ - return (m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string && - m_new_int32 == x.m_new_int32 && - m_new_string == x.m_new_string); -} - -bool BasicWideStruct::operator !=( - const BasicWideStruct& x) const -{ - return !(*this == x); -} - -size_t BasicWideStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return BasicWideStruct_max_cdr_typesize; -} - -size_t BasicWideStruct::getCdrSerializedSize( - const BasicWideStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.new_string().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void BasicWideStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_bool; - - scdr << m_my_int32; - - scdr << m_my_string.c_str(); - - scdr << m_new_int32; - - scdr << m_new_string.c_str(); - -} - -void BasicWideStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_bool; - - - - dcdr >> m_my_int32; - - - - dcdr >> m_my_string; - - - - dcdr >> m_new_int32; - - - - dcdr >> m_new_string; - - -} - - -bool BasicWideStruct::isKeyDefined() -{ - return false; -} - -void BasicWideStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BasicWideStruct::my_bool( - bool _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -bool BasicWideStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -bool& BasicWideStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BasicWideStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BasicWideStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BasicWideStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BasicWideStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BasicWideStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BasicWideStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BasicWideStruct::my_string() -{ - return m_my_string; -} - - -/*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ -void BasicWideStruct::new_int32( - int32_t _new_int32) -{ - m_new_int32 = _new_int32; -} - -/*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ -int32_t BasicWideStruct::new_int32() const -{ - return m_new_int32; -} - -/*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ -int32_t& BasicWideStruct::new_int32() -{ - return m_new_int32; -} - - -/*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ -void BasicWideStruct::new_string( - const std::string& _new_string) -{ - m_new_string = _new_string; -} - -/*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ -void BasicWideStruct::new_string( - std::string&& _new_string) -{ - m_new_string = std::move(_new_string); -} - -/*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ -const std::string& BasicWideStruct::new_string() const -{ - return m_new_string; -} - -/*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ -std::string& BasicWideStruct::new_string() -{ - return m_new_string; -} - - - - - -BadBasicWideStruct::BadBasicWideStruct() -{ - // long m_new_int32 - m_new_int32 = 0; - // /type_d() m_new_string - - // boolean m_my_bool - m_my_bool = false; - // long m_my_int32 - m_my_int32 = 0; - // /type_d() m_my_string - - - // Just to register all known types - registerTypesTypes(); -} - -BadBasicWideStruct::~BadBasicWideStruct() -{ -} - -BadBasicWideStruct::BadBasicWideStruct( - const BadBasicWideStruct& x) -{ - m_new_int32 = x.m_new_int32; - - - m_new_string = x.m_new_string; - - - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - -} - -BadBasicWideStruct::BadBasicWideStruct( - BadBasicWideStruct&& x) noexcept -{ - m_new_int32 = x.m_new_int32; - - - m_new_string = std::move(x.m_new_string); - - - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - -} - -BadBasicWideStruct& BadBasicWideStruct::operator =( - const BadBasicWideStruct& x) -{ - m_new_int32 = x.m_new_int32; - - - m_new_string = x.m_new_string; - - - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = x.m_my_string; - - return *this; -} - -BadBasicWideStruct& BadBasicWideStruct::operator =( - BadBasicWideStruct&& x) noexcept -{ - m_new_int32 = x.m_new_int32; - - - m_new_string = std::move(x.m_new_string); - - - m_my_bool = x.m_my_bool; - - - m_my_int32 = x.m_my_int32; - - - m_my_string = std::move(x.m_my_string); - - return *this; -} - -bool BadBasicWideStruct::operator ==( - const BadBasicWideStruct& x) const -{ - return (m_new_int32 == x.m_new_int32 && - m_new_string == x.m_new_string && - m_my_bool == x.m_my_bool && - m_my_int32 == x.m_my_int32 && - m_my_string == x.m_my_string); -} - -bool BadBasicWideStruct::operator !=( - const BadBasicWideStruct& x) const -{ - return !(*this == x); -} - -size_t BadBasicWideStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return BadBasicWideStruct_max_cdr_typesize; -} - -size_t BadBasicWideStruct::getCdrSerializedSize( - const BadBasicWideStruct& 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.new_string().size() + 1; - - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void BadBasicWideStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_new_int32; - - scdr << m_new_string.c_str(); - - scdr << m_my_bool; - - scdr << m_my_int32; - - scdr << m_my_string.c_str(); - -} - -void BadBasicWideStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_new_int32; - - - - dcdr >> m_new_string; - - - - dcdr >> m_my_bool; - - - - dcdr >> m_my_int32; - - - - dcdr >> m_my_string; - - -} - - -bool BadBasicWideStruct::isKeyDefined() -{ - return false; -} - -void BadBasicWideStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ -void BadBasicWideStruct::new_int32( - int32_t _new_int32) -{ - m_new_int32 = _new_int32; -} - -/*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ -int32_t BadBasicWideStruct::new_int32() const -{ - return m_new_int32; -} - -/*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ -int32_t& BadBasicWideStruct::new_int32() -{ - return m_new_int32; -} - - -/*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ -void BadBasicWideStruct::new_string( - const std::string& _new_string) -{ - m_new_string = _new_string; -} - -/*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ -void BadBasicWideStruct::new_string( - std::string&& _new_string) -{ - m_new_string = std::move(_new_string); -} - -/*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ -const std::string& BadBasicWideStruct::new_string() const -{ - return m_new_string; -} - -/*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ -std::string& BadBasicWideStruct::new_string() -{ - return m_new_string; -} - - -/*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ -void BadBasicWideStruct::my_bool( - bool _my_bool) -{ - m_my_bool = _my_bool; -} - -/*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ -bool BadBasicWideStruct::my_bool() const -{ - return m_my_bool; -} - -/*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ -bool& BadBasicWideStruct::my_bool() -{ - return m_my_bool; -} - - -/*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ -void BadBasicWideStruct::my_int32( - int32_t _my_int32) -{ - m_my_int32 = _my_int32; -} - -/*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ -int32_t BadBasicWideStruct::my_int32() const -{ - return m_my_int32; -} - -/*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ -int32_t& BadBasicWideStruct::my_int32() -{ - return m_my_int32; -} - - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void BadBasicWideStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void BadBasicWideStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& BadBasicWideStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& BadBasicWideStruct::my_string() -{ - return m_my_string; -} - - - - - -StringStruct::StringStruct() -{ - // /type_d() m_my_string - - - // Just to register all known types - registerTypesTypes(); -} - -StringStruct::~StringStruct() -{ -} - -StringStruct::StringStruct( - const StringStruct& x) -{ - m_my_string = x.m_my_string; - -} - -StringStruct::StringStruct( - StringStruct&& x) noexcept -{ - m_my_string = std::move(x.m_my_string); - -} - -StringStruct& StringStruct::operator =( - const StringStruct& x) -{ - m_my_string = x.m_my_string; - - return *this; -} - -StringStruct& StringStruct::operator =( - StringStruct&& x) noexcept -{ - m_my_string = std::move(x.m_my_string); - - return *this; -} - -bool StringStruct::operator ==( - const StringStruct& x) const -{ - return (m_my_string == x.m_my_string); -} - -bool StringStruct::operator !=( - const StringStruct& x) const -{ - return !(*this == x); -} - -size_t StringStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return StringStruct_max_cdr_typesize; -} - -size_t StringStruct::getCdrSerializedSize( - const StringStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_string().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void StringStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_string.c_str(); - -} - -void StringStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_string; - - -} - - -bool StringStruct::isKeyDefined() -{ - return false; -} - -void StringStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ -void StringStruct::my_string( - const std::string& _my_string) -{ - m_my_string = _my_string; -} - -/*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ -void StringStruct::my_string( - std::string&& _my_string) -{ - m_my_string = std::move(_my_string); -} - -/*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ -const std::string& StringStruct::my_string() const -{ - return m_my_string; -} - -/*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ -std::string& StringStruct::my_string() -{ - return m_my_string; -} - - - - - -LargeStringStruct::LargeStringStruct() -{ - // /type_d() m_my_large_string - - - // Just to register all known types - registerTypesTypes(); -} - -LargeStringStruct::~LargeStringStruct() -{ -} - -LargeStringStruct::LargeStringStruct( - const LargeStringStruct& x) -{ - m_my_large_string = x.m_my_large_string; - -} - -LargeStringStruct::LargeStringStruct( - LargeStringStruct&& x) noexcept -{ - m_my_large_string = std::move(x.m_my_large_string); - -} - -LargeStringStruct& LargeStringStruct::operator =( - const LargeStringStruct& x) -{ - m_my_large_string = x.m_my_large_string; - - return *this; -} - -LargeStringStruct& LargeStringStruct::operator =( - LargeStringStruct&& x) noexcept -{ - m_my_large_string = std::move(x.m_my_large_string); - - return *this; -} - -bool LargeStringStruct::operator ==( - const LargeStringStruct& x) const -{ - return (m_my_large_string == x.m_my_large_string); -} - -bool LargeStringStruct::operator !=( - const LargeStringStruct& x) const -{ - return !(*this == x); -} - -size_t LargeStringStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return LargeStringStruct_max_cdr_typesize; -} - -size_t LargeStringStruct::getCdrSerializedSize( - const LargeStringStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.my_large_string().size() + 1; - - - return current_alignment - initial_alignment; -} - - -void LargeStringStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_large_string.c_str(); - -} - -void LargeStringStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - { - std::string aux; - dcdr >> aux; - m_my_large_string = aux.c_str(); - } - - -} - - -bool LargeStringStruct::isKeyDefined() -{ - return false; -} - -void LargeStringStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_large_string - * @param _my_large_string New value to be copied in member my_large_string - */ -void LargeStringStruct::my_large_string( - const eprosima::fastcdr::fixed_string<41925>& _my_large_string) -{ - m_my_large_string = _my_large_string; -} - -/*! - * @brief This function moves the value in member my_large_string - * @param _my_large_string New value to be moved in member my_large_string - */ -void LargeStringStruct::my_large_string( - eprosima::fastcdr::fixed_string<41925>&& _my_large_string) -{ - m_my_large_string = std::move(_my_large_string); -} - -/*! - * @brief This function returns a constant reference to member my_large_string - * @return Constant reference to member my_large_string - */ -const eprosima::fastcdr::fixed_string<41925>& LargeStringStruct::my_large_string() const -{ - return m_my_large_string; -} - -/*! - * @brief This function returns a reference to member my_large_string - * @return Reference to member my_large_string - */ -eprosima::fastcdr::fixed_string<41925>& LargeStringStruct::my_large_string() -{ - return m_my_large_string; -} - - - - - -WStringStruct::WStringStruct() -{ - // /type_15() m_my_wstring - - - // Just to register all known types - registerTypesTypes(); -} - -WStringStruct::~WStringStruct() -{ -} - -WStringStruct::WStringStruct( - const WStringStruct& x) -{ - m_my_wstring = x.m_my_wstring; - -} - -WStringStruct::WStringStruct( - WStringStruct&& x) noexcept -{ - m_my_wstring = std::move(x.m_my_wstring); - -} - -WStringStruct& WStringStruct::operator =( - const WStringStruct& x) -{ - m_my_wstring = x.m_my_wstring; - - return *this; -} - -WStringStruct& WStringStruct::operator =( - WStringStruct&& x) noexcept -{ - m_my_wstring = std::move(x.m_my_wstring); - - return *this; -} - -bool WStringStruct::operator ==( - const WStringStruct& x) const -{ - return (m_my_wstring == x.m_my_wstring); -} - -bool WStringStruct::operator !=( - const WStringStruct& x) const -{ - return !(*this == x); -} - -size_t WStringStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return WStringStruct_max_cdr_typesize; -} - -size_t WStringStruct::getCdrSerializedSize( - const WStringStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + (data.my_wstring().size()) * 4; // 32 bits - - - return current_alignment - initial_alignment; -} - - -void WStringStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_wstring; - -} - -void WStringStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_wstring; - - -} - - -bool WStringStruct::isKeyDefined() -{ - return false; -} - -void WStringStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_wstring - * @param _my_wstring New value to be copied in member my_wstring - */ -void WStringStruct::my_wstring( - const std::wstring& _my_wstring) -{ - m_my_wstring = _my_wstring; -} - -/*! - * @brief This function moves the value in member my_wstring - * @param _my_wstring New value to be moved in member my_wstring - */ -void WStringStruct::my_wstring( - std::wstring&& _my_wstring) -{ - m_my_wstring = std::move(_my_wstring); -} - -/*! - * @brief This function returns a constant reference to member my_wstring - * @return Constant reference to member my_wstring - */ -const std::wstring& WStringStruct::my_wstring() const -{ - return m_my_wstring; -} - -/*! - * @brief This function returns a reference to member my_wstring - * @return Reference to member my_wstring - */ -std::wstring& WStringStruct::my_wstring() -{ - return m_my_wstring; -} - - - - - -LargeWStringStruct::LargeWStringStruct() -{ - // /type_15() m_my_large_wstring - - - // Just to register all known types - registerTypesTypes(); -} - -LargeWStringStruct::~LargeWStringStruct() -{ -} - -LargeWStringStruct::LargeWStringStruct( - const LargeWStringStruct& x) -{ - m_my_large_wstring = x.m_my_large_wstring; - -} - -LargeWStringStruct::LargeWStringStruct( - LargeWStringStruct&& x) noexcept -{ - m_my_large_wstring = std::move(x.m_my_large_wstring); - -} - -LargeWStringStruct& LargeWStringStruct::operator =( - const LargeWStringStruct& x) -{ - m_my_large_wstring = x.m_my_large_wstring; - - return *this; -} - -LargeWStringStruct& LargeWStringStruct::operator =( - LargeWStringStruct&& x) noexcept -{ - m_my_large_wstring = std::move(x.m_my_large_wstring); - - return *this; -} - -bool LargeWStringStruct::operator ==( - const LargeWStringStruct& x) const -{ - return (m_my_large_wstring == x.m_my_large_wstring); -} - -bool LargeWStringStruct::operator !=( - const LargeWStringStruct& x) const -{ - return !(*this == x); -} - -size_t LargeWStringStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return LargeWStringStruct_max_cdr_typesize; -} - -size_t LargeWStringStruct::getCdrSerializedSize( - const LargeWStringStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + (data.my_large_wstring().size()) * 4; // 32 bits - - - return current_alignment - initial_alignment; -} - - -void LargeWStringStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_large_wstring; - -} - -void LargeWStringStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_large_wstring; - - -} - - -bool LargeWStringStruct::isKeyDefined() -{ - return false; -} - -void LargeWStringStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_large_wstring - * @param _my_large_wstring New value to be copied in member my_large_wstring - */ -void LargeWStringStruct::my_large_wstring( - const std::wstring& _my_large_wstring) -{ - m_my_large_wstring = _my_large_wstring; -} - -/*! - * @brief This function moves the value in member my_large_wstring - * @param _my_large_wstring New value to be moved in member my_large_wstring - */ -void LargeWStringStruct::my_large_wstring( - std::wstring&& _my_large_wstring) -{ - m_my_large_wstring = std::move(_my_large_wstring); -} - -/*! - * @brief This function returns a constant reference to member my_large_wstring - * @return Constant reference to member my_large_wstring - */ -const std::wstring& LargeWStringStruct::my_large_wstring() const -{ - return m_my_large_wstring; -} - -/*! - * @brief This function returns a reference to member my_large_wstring - * @return Reference to member my_large_wstring - */ -std::wstring& LargeWStringStruct::my_large_wstring() -{ - return m_my_large_wstring; -} - - - - - -ArrayStruct::ArrayStruct() -{ - // long m_my_array - memset(&m_my_array, 0, ((2)) * 4); - - // Just to register all known types - registerTypesTypes(); -} - -ArrayStruct::~ArrayStruct() -{ -} - -ArrayStruct::ArrayStruct( - const ArrayStruct& x) -{ - m_my_array = x.m_my_array; - -} - -ArrayStruct::ArrayStruct( - ArrayStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - -} - -ArrayStruct& ArrayStruct::operator =( - const ArrayStruct& x) -{ - m_my_array = x.m_my_array; - - return *this; -} - -ArrayStruct& ArrayStruct::operator =( - ArrayStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - - return *this; -} - -bool ArrayStruct::operator ==( - const ArrayStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArrayStruct::operator !=( - const ArrayStruct& x) const -{ - return !(*this == x); -} - -size_t ArrayStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ArrayStruct_max_cdr_typesize; -} - -size_t ArrayStruct::getCdrSerializedSize( - const ArrayStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += (((2)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - - -void ArrayStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_array; - - -} - -void ArrayStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_array; - - -} - - -bool ArrayStruct::isKeyDefined() -{ - return false; -} - -void ArrayStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArrayStruct::my_array( - const std::array& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArrayStruct::my_array( - std::array&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array& ArrayStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array& ArrayStruct::my_array() -{ - return m_my_array; -} - - - - - -ArrayStructEqual::ArrayStructEqual() -{ - // long m_my_array_equal - memset(&m_my_array_equal, 0, ((2)) * 4); - - // Just to register all known types - registerTypesTypes(); -} - -ArrayStructEqual::~ArrayStructEqual() -{ -} - -ArrayStructEqual::ArrayStructEqual( - const ArrayStructEqual& x) -{ - m_my_array_equal = x.m_my_array_equal; - -} - -ArrayStructEqual::ArrayStructEqual( - ArrayStructEqual&& x) noexcept -{ - m_my_array_equal = std::move(x.m_my_array_equal); - -} - -ArrayStructEqual& ArrayStructEqual::operator =( - const ArrayStructEqual& x) -{ - m_my_array_equal = x.m_my_array_equal; - - return *this; -} - -ArrayStructEqual& ArrayStructEqual::operator =( - ArrayStructEqual&& x) noexcept -{ - m_my_array_equal = std::move(x.m_my_array_equal); - - return *this; -} - -bool ArrayStructEqual::operator ==( - const ArrayStructEqual& x) const -{ - return (m_my_array_equal == x.m_my_array_equal); -} - -bool ArrayStructEqual::operator !=( - const ArrayStructEqual& x) const -{ - return !(*this == x); -} - -size_t ArrayStructEqual::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ArrayStructEqual_max_cdr_typesize; -} - -size_t ArrayStructEqual::getCdrSerializedSize( - const ArrayStructEqual& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += (((2)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - - -void ArrayStructEqual::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_array_equal; - - -} - -void ArrayStructEqual::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_array_equal; - - -} - - -bool ArrayStructEqual::isKeyDefined() -{ - return false; -} - -void ArrayStructEqual::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_array_equal - * @param _my_array_equal New value to be copied in member my_array_equal - */ -void ArrayStructEqual::my_array_equal( - const std::array& _my_array_equal) -{ - m_my_array_equal = _my_array_equal; -} - -/*! - * @brief This function moves the value in member my_array_equal - * @param _my_array_equal New value to be moved in member my_array_equal - */ -void ArrayStructEqual::my_array_equal( - std::array&& _my_array_equal) -{ - m_my_array_equal = std::move(_my_array_equal); -} - -/*! - * @brief This function returns a constant reference to member my_array_equal - * @return Constant reference to member my_array_equal - */ -const std::array& ArrayStructEqual::my_array_equal() const -{ - return m_my_array_equal; -} - -/*! - * @brief This function returns a reference to member my_array_equal - * @return Reference to member my_array_equal - */ -std::array& ArrayStructEqual::my_array_equal() -{ - return m_my_array_equal; -} - - - - - -ArrayBadStruct::ArrayBadStruct() -{ - // octet m_my_array - memset(&m_my_array, 0, ((2)) * 1); - - // Just to register all known types - registerTypesTypes(); -} - -ArrayBadStruct::~ArrayBadStruct() -{ -} - -ArrayBadStruct::ArrayBadStruct( - const ArrayBadStruct& x) -{ - m_my_array = x.m_my_array; - -} - -ArrayBadStruct::ArrayBadStruct( - ArrayBadStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - -} - -ArrayBadStruct& ArrayBadStruct::operator =( - const ArrayBadStruct& x) -{ - m_my_array = x.m_my_array; - - return *this; -} - -ArrayBadStruct& ArrayBadStruct::operator =( - ArrayBadStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - - return *this; -} - -bool ArrayBadStruct::operator ==( - const ArrayBadStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArrayBadStruct::operator !=( - const ArrayBadStruct& x) const -{ - return !(*this == x); -} - -size_t ArrayBadStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ArrayBadStruct_max_cdr_typesize; -} - -size_t ArrayBadStruct::getCdrSerializedSize( - const ArrayBadStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += (((2)) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - return current_alignment - initial_alignment; -} - - -void ArrayBadStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_array; - - -} - -void ArrayBadStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_array; - - -} - - -bool ArrayBadStruct::isKeyDefined() -{ - return false; -} - -void ArrayBadStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArrayBadStruct::my_array( - const std::array& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArrayBadStruct::my_array( - std::array&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array& ArrayBadStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array& ArrayBadStruct::my_array() -{ - return m_my_array; -} - - - - - -ArrayDimensionsStruct::ArrayDimensionsStruct() -{ - // long m_my_array - memset(&m_my_array, 0, ((2) * (2)) * 4); - - // Just to register all known types - registerTypesTypes(); -} - -ArrayDimensionsStruct::~ArrayDimensionsStruct() -{ -} - -ArrayDimensionsStruct::ArrayDimensionsStruct( - const ArrayDimensionsStruct& x) -{ - m_my_array = x.m_my_array; - -} - -ArrayDimensionsStruct::ArrayDimensionsStruct( - ArrayDimensionsStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - -} - -ArrayDimensionsStruct& ArrayDimensionsStruct::operator =( - const ArrayDimensionsStruct& x) -{ - m_my_array = x.m_my_array; - - return *this; -} - -ArrayDimensionsStruct& ArrayDimensionsStruct::operator =( - ArrayDimensionsStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - - return *this; -} - -bool ArrayDimensionsStruct::operator ==( - const ArrayDimensionsStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArrayDimensionsStruct::operator !=( - const ArrayDimensionsStruct& x) const -{ - return !(*this == x); -} - -size_t ArrayDimensionsStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ArrayDimensionsStruct_max_cdr_typesize; -} - -size_t ArrayDimensionsStruct::getCdrSerializedSize( - const ArrayDimensionsStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += (((2) * (2)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - - -void ArrayDimensionsStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - for (uint32_t b = 0; b < m_my_array.size(); ++b) - { - scdr << m_my_array[b]; - - } - - - -} - -void ArrayDimensionsStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - for (uint32_t d = 0; d < m_my_array.size(); ++d) - { - dcdr >> m_my_array[d]; - - } - - - -} - - -bool ArrayDimensionsStruct::isKeyDefined() -{ - return false; -} - -void ArrayDimensionsStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArrayDimensionsStruct::my_array( - const std::array, 2>& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArrayDimensionsStruct::my_array( - std::array, 2>&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array, 2>& ArrayDimensionsStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array, 2>& ArrayDimensionsStruct::my_array() -{ - return m_my_array; -} - - - - - -ArraySizeStruct::ArraySizeStruct() -{ - // long m_my_array - memset(&m_my_array, 0, ((5)) * 4); - - // Just to register all known types - registerTypesTypes(); -} - -ArraySizeStruct::~ArraySizeStruct() -{ -} - -ArraySizeStruct::ArraySizeStruct( - const ArraySizeStruct& x) -{ - m_my_array = x.m_my_array; - -} - -ArraySizeStruct::ArraySizeStruct( - ArraySizeStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - -} - -ArraySizeStruct& ArraySizeStruct::operator =( - const ArraySizeStruct& x) -{ - m_my_array = x.m_my_array; - - return *this; -} - -ArraySizeStruct& ArraySizeStruct::operator =( - ArraySizeStruct&& x) noexcept -{ - m_my_array = std::move(x.m_my_array); - - return *this; -} - -bool ArraySizeStruct::operator ==( - const ArraySizeStruct& x) const -{ - return (m_my_array == x.m_my_array); -} - -bool ArraySizeStruct::operator !=( - const ArraySizeStruct& x) const -{ - return !(*this == x); -} - -size_t ArraySizeStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return ArraySizeStruct_max_cdr_typesize; -} - -size_t ArraySizeStruct::getCdrSerializedSize( - const ArraySizeStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += (((5)) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - return current_alignment - initial_alignment; -} - - -void ArraySizeStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_array; - - -} - -void ArraySizeStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_array; - - -} - - -bool ArraySizeStruct::isKeyDefined() -{ - return false; -} - -void ArraySizeStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ -void ArraySizeStruct::my_array( - const std::array& _my_array) -{ - m_my_array = _my_array; -} - -/*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ -void ArraySizeStruct::my_array( - std::array&& _my_array) -{ - m_my_array = std::move(_my_array); -} - -/*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ -const std::array& ArraySizeStruct::my_array() const -{ - return m_my_array; -} - -/*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ -std::array& ArraySizeStruct::my_array() -{ - return m_my_array; -} - - - - - - - -SequenceStruct::SequenceStruct() -{ - // sequence m_my_sequence - - - // Just to register all known types - registerTypesTypes(); -} - -SequenceStruct::~SequenceStruct() -{ -} - -SequenceStruct::SequenceStruct( - const SequenceStruct& x) -{ - m_my_sequence = x.m_my_sequence; - -} - -SequenceStruct::SequenceStruct( - SequenceStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); - -} - -SequenceStruct& SequenceStruct::operator =( - const SequenceStruct& x) -{ - m_my_sequence = x.m_my_sequence; - - return *this; -} - -SequenceStruct& SequenceStruct::operator =( - SequenceStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); - - return *this; -} - -bool SequenceStruct::operator ==( - const SequenceStruct& x) const -{ - return (m_my_sequence == x.m_my_sequence); -} - -bool SequenceStruct::operator !=( - const SequenceStruct& x) const -{ - return !(*this == x); -} - -size_t SequenceStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SequenceStruct_max_cdr_typesize; -} - -size_t SequenceStruct::getCdrSerializedSize( - const SequenceStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.my_sequence().size() > 0) - { - current_alignment += (data.my_sequence().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - - return current_alignment - initial_alignment; -} - - -void SequenceStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_sequence; - - -} - -void SequenceStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_sequence; - - -} - - -bool SequenceStruct::isKeyDefined() -{ - return false; -} - -void SequenceStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ -void SequenceStruct::my_sequence( - const std::vector& _my_sequence) -{ - m_my_sequence = _my_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ -void SequenceStruct::my_sequence( - std::vector&& _my_sequence) -{ - m_my_sequence = std::move(_my_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ -const std::vector& SequenceStruct::my_sequence() const -{ - return m_my_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ -std::vector& SequenceStruct::my_sequence() -{ - return m_my_sequence; -} - - - - - - - -SequenceStructEqual::SequenceStructEqual() -{ - // sequence m_my_sequence_equal - - - // Just to register all known types - registerTypesTypes(); -} - -SequenceStructEqual::~SequenceStructEqual() -{ -} - -SequenceStructEqual::SequenceStructEqual( - const SequenceStructEqual& x) -{ - m_my_sequence_equal = x.m_my_sequence_equal; - -} - -SequenceStructEqual::SequenceStructEqual( - SequenceStructEqual&& x) noexcept -{ - m_my_sequence_equal = std::move(x.m_my_sequence_equal); - -} - -SequenceStructEqual& SequenceStructEqual::operator =( - const SequenceStructEqual& x) -{ - m_my_sequence_equal = x.m_my_sequence_equal; - - return *this; -} - -SequenceStructEqual& SequenceStructEqual::operator =( - SequenceStructEqual&& x) noexcept -{ - m_my_sequence_equal = std::move(x.m_my_sequence_equal); - - return *this; -} - -bool SequenceStructEqual::operator ==( - const SequenceStructEqual& x) const -{ - return (m_my_sequence_equal == x.m_my_sequence_equal); -} - -bool SequenceStructEqual::operator !=( - const SequenceStructEqual& x) const -{ - return !(*this == x); -} - -size_t SequenceStructEqual::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SequenceStructEqual_max_cdr_typesize; -} - -size_t SequenceStructEqual::getCdrSerializedSize( - const SequenceStructEqual& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.my_sequence_equal().size() > 0) - { - current_alignment += (data.my_sequence_equal().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - - return current_alignment - initial_alignment; -} - - -void SequenceStructEqual::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_sequence_equal; - - -} - -void SequenceStructEqual::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_sequence_equal; - - -} - - -bool SequenceStructEqual::isKeyDefined() -{ - return false; -} - -void SequenceStructEqual::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_sequence_equal - * @param _my_sequence_equal New value to be copied in member my_sequence_equal - */ -void SequenceStructEqual::my_sequence_equal( - const std::vector& _my_sequence_equal) -{ - m_my_sequence_equal = _my_sequence_equal; -} - -/*! - * @brief This function moves the value in member my_sequence_equal - * @param _my_sequence_equal New value to be moved in member my_sequence_equal - */ -void SequenceStructEqual::my_sequence_equal( - std::vector&& _my_sequence_equal) -{ - m_my_sequence_equal = std::move(_my_sequence_equal); -} - -/*! - * @brief This function returns a constant reference to member my_sequence_equal - * @return Constant reference to member my_sequence_equal - */ -const std::vector& SequenceStructEqual::my_sequence_equal() const -{ - return m_my_sequence_equal; -} - -/*! - * @brief This function returns a reference to member my_sequence_equal - * @return Reference to member my_sequence_equal - */ -std::vector& SequenceStructEqual::my_sequence_equal() -{ - return m_my_sequence_equal; -} - - - - - - - -SequenceBadStruct::SequenceBadStruct() -{ - // sequence m_my_sequence - - - // Just to register all known types - registerTypesTypes(); -} - -SequenceBadStruct::~SequenceBadStruct() -{ -} - -SequenceBadStruct::SequenceBadStruct( - const SequenceBadStruct& x) -{ - m_my_sequence = x.m_my_sequence; - -} - -SequenceBadStruct::SequenceBadStruct( - SequenceBadStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); - -} - -SequenceBadStruct& SequenceBadStruct::operator =( - const SequenceBadStruct& x) -{ - m_my_sequence = x.m_my_sequence; - - return *this; -} - -SequenceBadStruct& SequenceBadStruct::operator =( - SequenceBadStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); - - return *this; -} - -bool SequenceBadStruct::operator ==( - const SequenceBadStruct& x) const -{ - return (m_my_sequence == x.m_my_sequence); -} - -bool SequenceBadStruct::operator !=( - const SequenceBadStruct& x) const -{ - return !(*this == x); -} - -size_t SequenceBadStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SequenceBadStruct_max_cdr_typesize; -} - -size_t SequenceBadStruct::getCdrSerializedSize( - const SequenceBadStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.my_sequence().size() > 0) - { - current_alignment += (data.my_sequence().size() * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - } - - - - - return current_alignment - initial_alignment; -} - - -void SequenceBadStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_sequence; - - -} - -void SequenceBadStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_sequence; - - -} - - -bool SequenceBadStruct::isKeyDefined() -{ - return false; -} - -void SequenceBadStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ -void SequenceBadStruct::my_sequence( - const std::vector& _my_sequence) -{ - m_my_sequence = _my_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ -void SequenceBadStruct::my_sequence( - std::vector&& _my_sequence) -{ - m_my_sequence = std::move(_my_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ -const std::vector& SequenceBadStruct::my_sequence() const -{ - return m_my_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ -std::vector& SequenceBadStruct::my_sequence() -{ - return m_my_sequence; -} - - - - - - - -SequenceBoundsStruct::SequenceBoundsStruct() -{ - // sequence m_my_sequence - - - // Just to register all known types - registerTypesTypes(); -} - -SequenceBoundsStruct::~SequenceBoundsStruct() -{ -} - -SequenceBoundsStruct::SequenceBoundsStruct( - const SequenceBoundsStruct& x) -{ - m_my_sequence = x.m_my_sequence; - -} - -SequenceBoundsStruct::SequenceBoundsStruct( - SequenceBoundsStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); - -} - -SequenceBoundsStruct& SequenceBoundsStruct::operator =( - const SequenceBoundsStruct& x) -{ - m_my_sequence = x.m_my_sequence; - - return *this; -} - -SequenceBoundsStruct& SequenceBoundsStruct::operator =( - SequenceBoundsStruct&& x) noexcept -{ - m_my_sequence = std::move(x.m_my_sequence); - - return *this; -} - -bool SequenceBoundsStruct::operator ==( - const SequenceBoundsStruct& x) const -{ - return (m_my_sequence == x.m_my_sequence); -} - -bool SequenceBoundsStruct::operator !=( - const SequenceBoundsStruct& x) const -{ - return !(*this == x); -} - -size_t SequenceBoundsStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SequenceBoundsStruct_max_cdr_typesize; -} - -size_t SequenceBoundsStruct::getCdrSerializedSize( - const SequenceBoundsStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.my_sequence().size() > 0) - { - current_alignment += (data.my_sequence().size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - - - return current_alignment - initial_alignment; -} - - -void SequenceBoundsStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_sequence; - - -} - -void SequenceBoundsStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_sequence; - - -} - - -bool SequenceBoundsStruct::isKeyDefined() -{ - return false; -} - -void SequenceBoundsStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ -void SequenceBoundsStruct::my_sequence( - const std::vector& _my_sequence) -{ - m_my_sequence = _my_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ -void SequenceBoundsStruct::my_sequence( - std::vector&& _my_sequence) -{ - m_my_sequence = std::move(_my_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ -const std::vector& SequenceBoundsStruct::my_sequence() const -{ - return m_my_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ -std::vector& SequenceBoundsStruct::my_sequence() -{ - return m_my_sequence; -} - - - - - - - - - -SequenceSequenceStruct::SequenceSequenceStruct() -{ - // sequence, 3> m_my_sequence_sequence - - - // Just to register all known types - registerTypesTypes(); -} - -SequenceSequenceStruct::~SequenceSequenceStruct() -{ -} - -SequenceSequenceStruct::SequenceSequenceStruct( - const SequenceSequenceStruct& x) -{ - m_my_sequence_sequence = x.m_my_sequence_sequence; - -} - -SequenceSequenceStruct::SequenceSequenceStruct( - SequenceSequenceStruct&& x) noexcept -{ - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - -} - -SequenceSequenceStruct& SequenceSequenceStruct::operator =( - const SequenceSequenceStruct& x) -{ - m_my_sequence_sequence = x.m_my_sequence_sequence; - - return *this; -} - -SequenceSequenceStruct& SequenceSequenceStruct::operator =( - SequenceSequenceStruct&& x) noexcept -{ - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - - return *this; -} - -bool SequenceSequenceStruct::operator ==( - const SequenceSequenceStruct& x) const -{ - return (m_my_sequence_sequence == x.m_my_sequence_sequence); -} - -bool SequenceSequenceStruct::operator !=( - const SequenceSequenceStruct& x) const -{ - return !(*this == x); -} - -size_t SequenceSequenceStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SequenceSequenceStruct_max_cdr_typesize; -} - -size_t SequenceSequenceStruct::getCdrSerializedSize( - const SequenceSequenceStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.my_sequence_sequence().size(); ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.my_sequence_sequence().at(a).size() > 0) - { - current_alignment += (data.my_sequence_sequence().at(a).size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - } - - - - return current_alignment - initial_alignment; -} - - -void SequenceSequenceStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_sequence_sequence; - - -} - -void SequenceSequenceStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_sequence_sequence; - - -} - - -bool SequenceSequenceStruct::isKeyDefined() -{ - return false; -} - -void SequenceSequenceStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ -void SequenceSequenceStruct::my_sequence_sequence( - const std::vector>& _my_sequence_sequence) -{ - m_my_sequence_sequence = _my_sequence_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ -void SequenceSequenceStruct::my_sequence_sequence( - std::vector>&& _my_sequence_sequence) -{ - m_my_sequence_sequence = std::move(_my_sequence_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ -const std::vector>& SequenceSequenceStruct::my_sequence_sequence() const -{ - return m_my_sequence_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ -std::vector>& SequenceSequenceStruct::my_sequence_sequence() -{ - return m_my_sequence_sequence; -} - - - - - - - - - -SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct() -{ - // sequence, 5> m_my_sequence_sequence - - - // Just to register all known types - registerTypesTypes(); -} - -SequenceSequenceBoundsStruct::~SequenceSequenceBoundsStruct() -{ -} - -SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct( - const SequenceSequenceBoundsStruct& x) -{ - m_my_sequence_sequence = x.m_my_sequence_sequence; - -} - -SequenceSequenceBoundsStruct::SequenceSequenceBoundsStruct( - SequenceSequenceBoundsStruct&& x) noexcept -{ - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - -} - -SequenceSequenceBoundsStruct& SequenceSequenceBoundsStruct::operator =( - const SequenceSequenceBoundsStruct& x) -{ - m_my_sequence_sequence = x.m_my_sequence_sequence; - - return *this; -} - -SequenceSequenceBoundsStruct& SequenceSequenceBoundsStruct::operator =( - SequenceSequenceBoundsStruct&& x) noexcept -{ - m_my_sequence_sequence = std::move(x.m_my_sequence_sequence); - - return *this; -} - -bool SequenceSequenceBoundsStruct::operator ==( - const SequenceSequenceBoundsStruct& x) const -{ - return (m_my_sequence_sequence == x.m_my_sequence_sequence); -} - -bool SequenceSequenceBoundsStruct::operator !=( - const SequenceSequenceBoundsStruct& x) const -{ - return !(*this == x); -} - -size_t SequenceSequenceBoundsStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SequenceSequenceBoundsStruct_max_cdr_typesize; -} - -size_t SequenceSequenceBoundsStruct::getCdrSerializedSize( - const SequenceSequenceBoundsStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - for(size_t a = 0; a < data.my_sequence_sequence().size(); ++a) - { - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - if (data.my_sequence_sequence().at(a).size() > 0) - { - current_alignment += (data.my_sequence_sequence().at(a).size() * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - } - - - } - - - - return current_alignment - initial_alignment; -} - - -void SequenceSequenceBoundsStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_sequence_sequence; - - -} - -void SequenceSequenceBoundsStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_sequence_sequence; - - -} - - -bool SequenceSequenceBoundsStruct::isKeyDefined() -{ - return false; -} - -void SequenceSequenceBoundsStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ -void SequenceSequenceBoundsStruct::my_sequence_sequence( - const std::vector>& _my_sequence_sequence) -{ - m_my_sequence_sequence = _my_sequence_sequence; -} - -/*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ -void SequenceSequenceBoundsStruct::my_sequence_sequence( - std::vector>&& _my_sequence_sequence) -{ - m_my_sequence_sequence = std::move(_my_sequence_sequence); -} - -/*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ -const std::vector>& SequenceSequenceBoundsStruct::my_sequence_sequence() const -{ - return m_my_sequence_sequence; -} - -/*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ -std::vector>& SequenceSequenceBoundsStruct::my_sequence_sequence() -{ - return m_my_sequence_sequence; -} - - - - - - - -MapStruct::MapStruct() -{ - // map m_my_map - - - // Just to register all known types - registerTypesTypes(); -} - -MapStruct::~MapStruct() -{ -} - -MapStruct::MapStruct( - const MapStruct& x) -{ - m_my_map = x.m_my_map; - -} - -MapStruct::MapStruct( - MapStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - -} - -MapStruct& MapStruct::operator =( - const MapStruct& x) -{ - m_my_map = x.m_my_map; - - return *this; -} - -MapStruct& MapStruct::operator =( - MapStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - - return *this; -} - -bool MapStruct::operator ==( - const MapStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapStruct::operator !=( - const MapStruct& x) const -{ - return !(*this == x); -} - -size_t MapStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MapStruct_max_cdr_typesize; -} - -size_t MapStruct::getCdrSerializedSize( - const MapStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map()) - { - (void)a; - - 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 MapStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << static_cast(m_my_map.size()); - for (const auto& pair : m_my_map) - { - scdr << pair.first; - scdr << pair.second; - } - -} - -void MapStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_my_map; - - -} - - -bool MapStruct::isKeyDefined() -{ - return false; -} - -void MapStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapStruct::my_map() -{ - return m_my_map; -} - - - - - - - -MapStructEqual::MapStructEqual() -{ - // map m_my_map_equal - - - // Just to register all known types - registerTypesTypes(); -} - -MapStructEqual::~MapStructEqual() -{ -} - -MapStructEqual::MapStructEqual( - const MapStructEqual& x) -{ - m_my_map_equal = x.m_my_map_equal; - -} - -MapStructEqual::MapStructEqual( - MapStructEqual&& x) noexcept -{ - m_my_map_equal = std::move(x.m_my_map_equal); - -} - -MapStructEqual& MapStructEqual::operator =( - const MapStructEqual& x) -{ - m_my_map_equal = x.m_my_map_equal; - - return *this; -} - -MapStructEqual& MapStructEqual::operator =( - MapStructEqual&& x) noexcept -{ - m_my_map_equal = std::move(x.m_my_map_equal); - - return *this; -} - -bool MapStructEqual::operator ==( - const MapStructEqual& x) const -{ - return (m_my_map_equal == x.m_my_map_equal); -} - -bool MapStructEqual::operator !=( - const MapStructEqual& x) const -{ - return !(*this == x); -} - -size_t MapStructEqual::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MapStructEqual_max_cdr_typesize; -} - -size_t MapStructEqual::getCdrSerializedSize( - const MapStructEqual& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map_equal()) - { - (void)a; - - 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 MapStructEqual::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << static_cast(m_my_map_equal.size()); - for (const auto& pair : m_my_map_equal) - { - scdr << pair.first; - scdr << pair.second; - } - -} - -void MapStructEqual::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_my_map_equal; - - -} - - -bool MapStructEqual::isKeyDefined() -{ - return false; -} - -void MapStructEqual::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_map_equal - * @param _my_map_equal New value to be copied in member my_map_equal - */ -void MapStructEqual::my_map_equal( - const std::map& _my_map_equal) -{ - m_my_map_equal = _my_map_equal; -} - -/*! - * @brief This function moves the value in member my_map_equal - * @param _my_map_equal New value to be moved in member my_map_equal - */ -void MapStructEqual::my_map_equal( - std::map&& _my_map_equal) -{ - m_my_map_equal = std::move(_my_map_equal); -} - -/*! - * @brief This function returns a constant reference to member my_map_equal - * @return Constant reference to member my_map_equal - */ -const std::map& MapStructEqual::my_map_equal() const -{ - return m_my_map_equal; -} - -/*! - * @brief This function returns a reference to member my_map_equal - * @return Reference to member my_map_equal - */ -std::map& MapStructEqual::my_map_equal() -{ - return m_my_map_equal; -} - - - - - - - -MapBadKeyStruct::MapBadKeyStruct() -{ - // map m_my_map - - - // Just to register all known types - registerTypesTypes(); -} - -MapBadKeyStruct::~MapBadKeyStruct() -{ -} - -MapBadKeyStruct::MapBadKeyStruct( - const MapBadKeyStruct& x) -{ - m_my_map = x.m_my_map; - -} - -MapBadKeyStruct::MapBadKeyStruct( - MapBadKeyStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - -} - -MapBadKeyStruct& MapBadKeyStruct::operator =( - const MapBadKeyStruct& x) -{ - m_my_map = x.m_my_map; - - return *this; -} - -MapBadKeyStruct& MapBadKeyStruct::operator =( - MapBadKeyStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - - return *this; -} - -bool MapBadKeyStruct::operator ==( - const MapBadKeyStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapBadKeyStruct::operator !=( - const MapBadKeyStruct& x) const -{ - return !(*this == x); -} - -size_t MapBadKeyStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MapBadKeyStruct_max_cdr_typesize; -} - -size_t MapBadKeyStruct::getCdrSerializedSize( - const MapBadKeyStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map()) - { - (void)a; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - } - - - return current_alignment - initial_alignment; -} - - -void MapBadKeyStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << static_cast(m_my_map.size()); - for (const auto& pair : m_my_map) - { - scdr << pair.first; - scdr << pair.second; - } - -} - -void MapBadKeyStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_my_map; - - -} - - -bool MapBadKeyStruct::isKeyDefined() -{ - return false; -} - -void MapBadKeyStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapBadKeyStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapBadKeyStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapBadKeyStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapBadKeyStruct::my_map() -{ - return m_my_map; -} - - - - - - - -MapBadElemStruct::MapBadElemStruct() -{ - // map m_my_map - - - // Just to register all known types - registerTypesTypes(); -} - -MapBadElemStruct::~MapBadElemStruct() -{ -} - -MapBadElemStruct::MapBadElemStruct( - const MapBadElemStruct& x) -{ - m_my_map = x.m_my_map; - -} - -MapBadElemStruct::MapBadElemStruct( - MapBadElemStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - -} - -MapBadElemStruct& MapBadElemStruct::operator =( - const MapBadElemStruct& x) -{ - m_my_map = x.m_my_map; - - return *this; -} - -MapBadElemStruct& MapBadElemStruct::operator =( - MapBadElemStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - - return *this; -} - -bool MapBadElemStruct::operator ==( - const MapBadElemStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapBadElemStruct::operator !=( - const MapBadElemStruct& x) const -{ - return !(*this == x); -} - -size_t MapBadElemStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MapBadElemStruct_max_cdr_typesize; -} - -size_t MapBadElemStruct::getCdrSerializedSize( - const MapBadElemStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map()) - { - (void)a; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - } - - - return current_alignment - initial_alignment; -} - - -void MapBadElemStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << static_cast(m_my_map.size()); - for (const auto& pair : m_my_map) - { - scdr << pair.first; - scdr << pair.second; - } - -} - -void MapBadElemStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_my_map; - - -} - - -bool MapBadElemStruct::isKeyDefined() -{ - return false; -} - -void MapBadElemStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapBadElemStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapBadElemStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapBadElemStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapBadElemStruct::my_map() -{ - return m_my_map; -} - - - - - - - -MapBoundsStruct::MapBoundsStruct() -{ - // map m_my_map - - - // Just to register all known types - registerTypesTypes(); -} - -MapBoundsStruct::~MapBoundsStruct() -{ -} - -MapBoundsStruct::MapBoundsStruct( - const MapBoundsStruct& x) -{ - m_my_map = x.m_my_map; - -} - -MapBoundsStruct::MapBoundsStruct( - MapBoundsStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - -} - -MapBoundsStruct& MapBoundsStruct::operator =( - const MapBoundsStruct& x) -{ - m_my_map = x.m_my_map; - - return *this; -} - -MapBoundsStruct& MapBoundsStruct::operator =( - MapBoundsStruct&& x) noexcept -{ - m_my_map = std::move(x.m_my_map); - - return *this; -} - -bool MapBoundsStruct::operator ==( - const MapBoundsStruct& x) const -{ - return (m_my_map == x.m_my_map); -} - -bool MapBoundsStruct::operator !=( - const MapBoundsStruct& x) const -{ - return !(*this == x); -} - -size_t MapBoundsStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MapBoundsStruct_max_cdr_typesize; -} - -size_t MapBoundsStruct::getCdrSerializedSize( - const MapBoundsStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map()) - { - (void)a; - - 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 MapBoundsStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << static_cast(m_my_map.size()); - for (const auto& pair : m_my_map) - { - scdr << pair.first; - scdr << pair.second; - } - -} - -void MapBoundsStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_my_map; - - -} - - -bool MapBoundsStruct::isKeyDefined() -{ - return false; -} - -void MapBoundsStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ -void MapBoundsStruct::my_map( - const std::map& _my_map) -{ - m_my_map = _my_map; -} - -/*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ -void MapBoundsStruct::my_map( - std::map&& _my_map) -{ - m_my_map = std::move(_my_map); -} - -/*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ -const std::map& MapBoundsStruct::my_map() const -{ - return m_my_map; -} - -/*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ -std::map& MapBoundsStruct::my_map() -{ - return m_my_map; -} - - - - - - - - - -MapMapStruct::MapMapStruct() -{ - // map> m_my_map_map - - - // Just to register all known types - registerTypesTypes(); -} - -MapMapStruct::~MapMapStruct() -{ -} - -MapMapStruct::MapMapStruct( - const MapMapStruct& x) -{ - m_my_map_map = x.m_my_map_map; - -} - -MapMapStruct::MapMapStruct( - MapMapStruct&& x) noexcept -{ - m_my_map_map = std::move(x.m_my_map_map); - -} - -MapMapStruct& MapMapStruct::operator =( - const MapMapStruct& x) -{ - m_my_map_map = x.m_my_map_map; - - return *this; -} - -MapMapStruct& MapMapStruct::operator =( - MapMapStruct&& x) noexcept -{ - m_my_map_map = std::move(x.m_my_map_map); - - return *this; -} - -bool MapMapStruct::operator ==( - const MapMapStruct& x) const -{ - return (m_my_map_map == x.m_my_map_map); -} - -bool MapMapStruct::operator !=( - const MapMapStruct& x) const -{ - return !(*this == x); -} - -size_t MapMapStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MapMapStruct_max_cdr_typesize; -} - -size_t MapMapStruct::getCdrSerializedSize( - const MapMapStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map_map()) - { - (void)a; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto b : a.second) - { - (void)b; - - 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 MapMapStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << static_cast(m_my_map_map.size()); - for (const auto& pair : m_my_map_map) - { - scdr << pair.first; - scdr << pair.second; - } - -} - -void MapMapStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_my_map_map; - - -} - - -bool MapMapStruct::isKeyDefined() -{ - return false; -} - -void MapMapStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ -void MapMapStruct::my_map_map( - const std::map>& _my_map_map) -{ - m_my_map_map = _my_map_map; -} - -/*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ -void MapMapStruct::my_map_map( - std::map>&& _my_map_map) -{ - m_my_map_map = std::move(_my_map_map); -} - -/*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ -const std::map>& MapMapStruct::my_map_map() const -{ - return m_my_map_map; -} - -/*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ -std::map>& MapMapStruct::my_map_map() -{ - return m_my_map_map; -} - - - - - - - - - -MapMapBoundsStruct::MapMapBoundsStruct() -{ - // map> m_my_map_map - - - // Just to register all known types - registerTypesTypes(); -} - -MapMapBoundsStruct::~MapMapBoundsStruct() -{ -} - -MapMapBoundsStruct::MapMapBoundsStruct( - const MapMapBoundsStruct& x) -{ - m_my_map_map = x.m_my_map_map; - -} - -MapMapBoundsStruct::MapMapBoundsStruct( - MapMapBoundsStruct&& x) noexcept -{ - m_my_map_map = std::move(x.m_my_map_map); - -} - -MapMapBoundsStruct& MapMapBoundsStruct::operator =( - const MapMapBoundsStruct& x) -{ - m_my_map_map = x.m_my_map_map; - - return *this; -} - -MapMapBoundsStruct& MapMapBoundsStruct::operator =( - MapMapBoundsStruct&& x) noexcept -{ - m_my_map_map = std::move(x.m_my_map_map); - - return *this; -} - -bool MapMapBoundsStruct::operator ==( - const MapMapBoundsStruct& x) const -{ - return (m_my_map_map == x.m_my_map_map); -} - -bool MapMapBoundsStruct::operator !=( - const MapMapBoundsStruct& x) const -{ - return !(*this == x); -} - -size_t MapMapBoundsStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return MapMapBoundsStruct_max_cdr_typesize; -} - -size_t MapMapBoundsStruct::getCdrSerializedSize( - const MapMapBoundsStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto a : data.my_map_map()) - { - (void)a; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - for(auto b : a.second) - { - (void)b; - - 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 MapMapBoundsStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << static_cast(m_my_map_map.size()); - for (const auto& pair : m_my_map_map) - { - scdr << pair.first; - scdr << pair.second; - } - -} - -void MapMapBoundsStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - - dcdr >> m_my_map_map; - - -} - - -bool MapMapBoundsStruct::isKeyDefined() -{ - return false; -} - -void MapMapBoundsStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ -void MapMapBoundsStruct::my_map_map( - const std::map>& _my_map_map) -{ - m_my_map_map = _my_map_map; -} - -/*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ -void MapMapBoundsStruct::my_map_map( - std::map>&& _my_map_map) -{ - m_my_map_map = std::move(_my_map_map); -} - -/*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ -const std::map>& MapMapBoundsStruct::my_map_map() const -{ - return m_my_map_map; -} - -/*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ -std::map>& MapMapBoundsStruct::my_map_map() -{ - return m_my_map_map; -} - - - - - -SimpleUnion::SimpleUnion() -{ - m__d = A; - // long m_first - m_first = 0; - // long long m_second - m_second = 0; -} - -SimpleUnion::~SimpleUnion() -{ -} - -SimpleUnion::SimpleUnion( - const SimpleUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleUnion::SimpleUnion( - SimpleUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleUnion& SimpleUnion::operator =( - const SimpleUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleUnion& SimpleUnion::operator =( - SimpleUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleUnion::operator ==( - const SimpleUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case B: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleUnion::operator !=( - const SimpleUnion& x) const -{ - return !(*this == x); -} - -void SimpleUnion::_d( - int32_t __d) -{ - bool b = false; - - switch(m__d) - { - case A: - switch(__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch(__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleUnion::_d() const -{ - return m__d; -} - -int32_t& SimpleUnion::_d() -{ - return m__d; -} - -void SimpleUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = A; - -} - -int32_t SimpleUnion::first() const -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& SimpleUnion::first() -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = B; - -} - -int64_t SimpleUnion::second() const -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleUnion::second() -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - -// TODO(Ricardo) Review -size_t SimpleUnion::getCdrSerializedSize( - const SimpleUnion& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - switch(data.m__d) - { - case A: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - - - case B: - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void SimpleUnion::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m__d; - - switch(m__d) - { - case A: - scdr << m_first; - - break; - - - case B: - scdr << m_second; - - break; - - default: - break; - } -} - -void SimpleUnion::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m__d; - - - switch(m__d) - { - case A: - dcdr >> m_first; - - - break; - - - case B: - dcdr >> m_second; - - - break; - - default: - break; - } -} - - - - - -SimpleUnionNames::SimpleUnionNames() -{ - m__d = A; - // long m_first_case - m_first_case = 0; - // long long m_second_case - m_second_case = 0; -} - -SimpleUnionNames::~SimpleUnionNames() -{ -} - -SimpleUnionNames::SimpleUnionNames( - const SimpleUnionNames& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } -} - -SimpleUnionNames::SimpleUnionNames( - SimpleUnionNames&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } -} - -SimpleUnionNames& SimpleUnionNames::operator =( - const SimpleUnionNames& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } - - return *this; -} - -SimpleUnionNames& SimpleUnionNames::operator =( - SimpleUnionNames&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first_case = x.m_first_case; - break; - - - case B: - m_second_case = x.m_second_case; - break; - - default: - break; - } - - return *this; -} - -bool SimpleUnionNames::operator ==( - const SimpleUnionNames& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case A: - return (m_first_case == x.m_first_case); - break; - - - case B: - return (m_second_case == x.m_second_case); - break; - - default: - break; - } - return false; -} - -bool SimpleUnionNames::operator !=( - const SimpleUnionNames& x) const -{ - return !(*this == x); -} - -void SimpleUnionNames::_d( - int32_t __d) -{ - bool b = false; - - switch(m__d) - { - case A: - switch(__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch(__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleUnionNames::_d() const -{ - return m__d; -} - -int32_t& SimpleUnionNames::_d() -{ - return m__d; -} - -void SimpleUnionNames::first_case( - int32_t _first_case) -{ - m_first_case = _first_case; - m__d = A; - -} - -int32_t SimpleUnionNames::first_case() const -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first_case; -} - -int32_t& SimpleUnionNames::first_case() -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first_case; -} - - -void SimpleUnionNames::second_case( - int64_t _second_case) -{ - m_second_case = _second_case; - m__d = B; - -} - -int64_t SimpleUnionNames::second_case() const -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second_case; -} - -int64_t& SimpleUnionNames::second_case() -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second_case; -} - - -// TODO(Ricardo) Review -size_t SimpleUnionNames::getCdrSerializedSize( - const SimpleUnionNames& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - switch(data.m__d) - { - case A: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - - - case B: - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void SimpleUnionNames::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m__d; - - switch(m__d) - { - case A: - scdr << m_first_case; - - break; - - - case B: - scdr << m_second_case; - - break; - - default: - break; - } -} - -void SimpleUnionNames::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m__d; - - - switch(m__d) - { - case A: - dcdr >> m_first_case; - - - break; - - - case B: - dcdr >> m_second_case; - - - break; - - default: - break; - } -} - - - - - -SimpleTypeUnion::SimpleTypeUnion() -{ - m__d = A; - // octet m_first - m_first = 0; - // long long m_second - m_second = 0; -} - -SimpleTypeUnion::~SimpleTypeUnion() -{ -} - -SimpleTypeUnion::SimpleTypeUnion( - const SimpleTypeUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleTypeUnion::SimpleTypeUnion( - SimpleTypeUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleTypeUnion& SimpleTypeUnion::operator =( - const SimpleTypeUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleTypeUnion& SimpleTypeUnion::operator =( - SimpleTypeUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case B: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleTypeUnion::operator ==( - const SimpleTypeUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case B: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleTypeUnion::operator !=( - const SimpleTypeUnion& x) const -{ - return !(*this == x); -} - -void SimpleTypeUnion::_d( - int32_t __d) -{ - bool b = false; - - switch(m__d) - { - case A: - switch(__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case B: - switch(__d) - { - case B: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleTypeUnion::_d() const -{ - return m__d; -} - -int32_t& SimpleTypeUnion::_d() -{ - return m__d; -} - -void SimpleTypeUnion::first( - uint8_t _first) -{ - m_first = _first; - m__d = A; - -} - -uint8_t SimpleTypeUnion::first() const -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -uint8_t& SimpleTypeUnion::first() -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleTypeUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = B; - -} - -int64_t SimpleTypeUnion::second() const -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleTypeUnion::second() -{ - bool b = false; - - switch(m__d) - { - case B: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - -// TODO(Ricardo) Review -size_t SimpleTypeUnion::getCdrSerializedSize( - const SimpleTypeUnion& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - switch(data.m__d) - { - case A: - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - break; - - - case B: - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void SimpleTypeUnion::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m__d; - - switch(m__d) - { - case A: - scdr << m_first; - - break; - - - case B: - scdr << m_second; - - break; - - default: - break; - } -} - -void SimpleTypeUnion::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m__d; - - - switch(m__d) - { - case A: - dcdr >> m_first; - - - break; - - - case B: - dcdr >> m_second; - - - break; - - default: - break; - } -} - - - - - -SimpleBadUnion::SimpleBadUnion() -{ - m__d = A; - // long m_first - m_first = 0; - // long long m_second - m_second = 0; -} - -SimpleBadUnion::~SimpleBadUnion() -{ -} - -SimpleBadUnion::SimpleBadUnion( - const SimpleBadUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadUnion::SimpleBadUnion( - SimpleBadUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadUnion& SimpleBadUnion::operator =( - const SimpleBadUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleBadUnion& SimpleBadUnion::operator =( - SimpleBadUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case A: - m_first = x.m_first; - break; - - - case C: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleBadUnion::operator ==( - const SimpleBadUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case A: - return (m_first == x.m_first); - break; - - - case C: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleBadUnion::operator !=( - const SimpleBadUnion& x) const -{ - return !(*this == x); -} - -void SimpleBadUnion::_d( - int32_t __d) -{ - bool b = false; - - switch(m__d) - { - case A: - switch(__d) - { - case A: - b = true; - break; - default: - break; - } - break; - - - case C: - switch(__d) - { - case C: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -int32_t SimpleBadUnion::_d() const -{ - return m__d; -} - -int32_t& SimpleBadUnion::_d() -{ - return m__d; -} - -void SimpleBadUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = A; - -} - -int32_t SimpleBadUnion::first() const -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& SimpleBadUnion::first() -{ - bool b = false; - - switch(m__d) - { - case A: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleBadUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = C; - -} - -int64_t SimpleBadUnion::second() const -{ - bool b = false; - - switch(m__d) - { - case C: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleBadUnion::second() -{ - bool b = false; - - switch(m__d) - { - case C: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - -// TODO(Ricardo) Review -size_t SimpleBadUnion::getCdrSerializedSize( - const SimpleBadUnion& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - - - switch(data.m__d) - { - case A: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - - - case C: - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void SimpleBadUnion::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m__d; - - switch(m__d) - { - case A: - scdr << m_first; - - break; - - - case C: - scdr << m_second; - - break; - - default: - break; - } -} - -void SimpleBadUnion::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m__d; - - - switch(m__d) - { - case A: - dcdr >> m_first; - - - break; - - - case C: - dcdr >> m_second; - - - break; - - default: - break; - } -} - - - - - -SimpleBadDiscUnion::SimpleBadDiscUnion() -{ - m__d = 0; - // long m_first - m_first = 0; - // long long m_second - m_second = 0; -} - -SimpleBadDiscUnion::~SimpleBadDiscUnion() -{ -} - -SimpleBadDiscUnion::SimpleBadDiscUnion( - const SimpleBadDiscUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadDiscUnion::SimpleBadDiscUnion( - SimpleBadDiscUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } -} - -SimpleBadDiscUnion& SimpleBadDiscUnion::operator =( - const SimpleBadDiscUnion& x) -{ - m__d = x.m__d; - - switch(m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -SimpleBadDiscUnion& SimpleBadDiscUnion::operator =( - SimpleBadDiscUnion&& x) noexcept -{ - m__d = x.m__d; - - switch(m__d) - { - case 0: - m_first = x.m_first; - break; - - - case 1: - m_second = x.m_second; - break; - - default: - break; - } - - return *this; -} - -bool SimpleBadDiscUnion::operator ==( - const SimpleBadDiscUnion& x) const -{ - if (m__d != x.m__d) - { - return false; - } - - switch(m__d) - { - case 0: - return (m_first == x.m_first); - break; - - - case 1: - return (m_second == x.m_second); - break; - - default: - break; - } - return false; -} - -bool SimpleBadDiscUnion::operator !=( - const SimpleBadDiscUnion& x) const -{ - return !(*this == x); -} - -void SimpleBadDiscUnion::_d( - uint8_t __d) -{ - bool b = false; - - switch(m__d) - { - case 0: - switch(__d) - { - case 0: - b = true; - break; - default: - break; - } - break; - - - case 1: - switch(__d) - { - case 1: - b = true; - break; - default: - break; - } - break; - - } - - if(!b) - { - throw BadParamException("Discriminator doesn't correspond with the selected union member"); - } - - m__d = __d; -} - -uint8_t SimpleBadDiscUnion::_d() const -{ - return m__d; -} - -uint8_t& SimpleBadDiscUnion::_d() -{ - return m__d; -} - -void SimpleBadDiscUnion::first( - int32_t _first) -{ - m_first = _first; - m__d = 0; - -} - -int32_t SimpleBadDiscUnion::first() const -{ - bool b = false; - - switch(m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - -int32_t& SimpleBadDiscUnion::first() -{ - bool b = false; - - switch(m__d) - { - case 0: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_first; -} - - -void SimpleBadDiscUnion::second( - int64_t _second) -{ - m_second = _second; - m__d = 1; - -} - -int64_t SimpleBadDiscUnion::second() const -{ - bool b = false; - - switch(m__d) - { - case 1: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - -int64_t& SimpleBadDiscUnion::second() -{ - bool b = false; - - switch(m__d) - { - case 1: - b = true; - break; - default: - break; - } - - if(!b) - { - throw BadParamException("This member has not been selected"); - } - - return m_second; -} - - -// TODO(Ricardo) Review -size_t SimpleBadDiscUnion::getCdrSerializedSize( - const SimpleBadDiscUnion& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1); - - - - switch(data.m__d) - { - case 0: - current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4); - - break; - - - case 1: - current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8); - - break; - - default: - break; - } - - return current_alignment - initial_alignment; -} - - -void SimpleBadDiscUnion::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m__d; - - switch(m__d) - { - case 0: - scdr << m_first; - - break; - - - case 1: - scdr << m_second; - - break; - - default: - break; - } -} - -void SimpleBadDiscUnion::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m__d; - - - switch(m__d) - { - case 0: - dcdr >> m_first; - - - break; - - - case 1: - dcdr >> m_second; - - - break; - - default: - break; - } -} - - - - - -SimpleUnionStruct::SimpleUnionStruct() -{ - // SimpleUnion m_my_union - - - // Just to register all known types - registerTypesTypes(); -} - -SimpleUnionStruct::~SimpleUnionStruct() -{ -} - -SimpleUnionStruct::SimpleUnionStruct( - const SimpleUnionStruct& x) -{ - m_my_union = x.m_my_union; - -} - -SimpleUnionStruct::SimpleUnionStruct( - SimpleUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - -} - -SimpleUnionStruct& SimpleUnionStruct::operator =( - const SimpleUnionStruct& x) -{ - m_my_union = x.m_my_union; - - return *this; -} - -SimpleUnionStruct& SimpleUnionStruct::operator =( - SimpleUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - - return *this; -} - -bool SimpleUnionStruct::operator ==( - const SimpleUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleUnionStruct::operator !=( - const SimpleUnionStruct& x) const -{ - return !(*this == x); -} - -size_t SimpleUnionStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SimpleUnionStruct_max_cdr_typesize; -} - -size_t SimpleUnionStruct::getCdrSerializedSize( - const SimpleUnionStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += SimpleUnion::getCdrSerializedSize(data.my_union(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void SimpleUnionStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_union; - -} - -void SimpleUnionStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_union; - - -} - - -bool SimpleUnionStruct::isKeyDefined() -{ - return false; -} - -void SimpleUnionStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleUnionStruct::my_union( - const SimpleUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleUnionStruct::my_union( - SimpleUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleUnion& SimpleUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleUnion& SimpleUnionStruct::my_union() -{ - return m_my_union; -} - - - - - -SimpleUnionStructEqual::SimpleUnionStructEqual() -{ - // SimpleUnion m_my_union_equal - - - // Just to register all known types - registerTypesTypes(); -} - -SimpleUnionStructEqual::~SimpleUnionStructEqual() -{ -} - -SimpleUnionStructEqual::SimpleUnionStructEqual( - const SimpleUnionStructEqual& x) -{ - m_my_union_equal = x.m_my_union_equal; - -} - -SimpleUnionStructEqual::SimpleUnionStructEqual( - SimpleUnionStructEqual&& x) noexcept -{ - m_my_union_equal = std::move(x.m_my_union_equal); - -} - -SimpleUnionStructEqual& SimpleUnionStructEqual::operator =( - const SimpleUnionStructEqual& x) -{ - m_my_union_equal = x.m_my_union_equal; - - return *this; -} - -SimpleUnionStructEqual& SimpleUnionStructEqual::operator =( - SimpleUnionStructEqual&& x) noexcept -{ - m_my_union_equal = std::move(x.m_my_union_equal); - - return *this; -} - -bool SimpleUnionStructEqual::operator ==( - const SimpleUnionStructEqual& x) const -{ - return (m_my_union_equal == x.m_my_union_equal); -} - -bool SimpleUnionStructEqual::operator !=( - const SimpleUnionStructEqual& x) const -{ - return !(*this == x); -} - -size_t SimpleUnionStructEqual::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SimpleUnionStructEqual_max_cdr_typesize; -} - -size_t SimpleUnionStructEqual::getCdrSerializedSize( - const SimpleUnionStructEqual& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += SimpleUnion::getCdrSerializedSize(data.my_union_equal(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void SimpleUnionStructEqual::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_union_equal; - -} - -void SimpleUnionStructEqual::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_union_equal; - - -} - - -bool SimpleUnionStructEqual::isKeyDefined() -{ - return false; -} - -void SimpleUnionStructEqual::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_union_equal - * @param _my_union_equal New value to be copied in member my_union_equal - */ -void SimpleUnionStructEqual::my_union_equal( - const SimpleUnion& _my_union_equal) -{ - m_my_union_equal = _my_union_equal; -} - -/*! - * @brief This function moves the value in member my_union_equal - * @param _my_union_equal New value to be moved in member my_union_equal - */ -void SimpleUnionStructEqual::my_union_equal( - SimpleUnion&& _my_union_equal) -{ - m_my_union_equal = std::move(_my_union_equal); -} - -/*! - * @brief This function returns a constant reference to member my_union_equal - * @return Constant reference to member my_union_equal - */ -const SimpleUnion& SimpleUnionStructEqual::my_union_equal() const -{ - return m_my_union_equal; -} - -/*! - * @brief This function returns a reference to member my_union_equal - * @return Reference to member my_union_equal - */ -SimpleUnion& SimpleUnionStructEqual::my_union_equal() -{ - return m_my_union_equal; -} - - - - - -SimpleUnionNamesStruct::SimpleUnionNamesStruct() -{ - // SimpleUnionNames m_my_union - - - // Just to register all known types - registerTypesTypes(); -} - -SimpleUnionNamesStruct::~SimpleUnionNamesStruct() -{ -} - -SimpleUnionNamesStruct::SimpleUnionNamesStruct( - const SimpleUnionNamesStruct& x) -{ - m_my_union = x.m_my_union; - -} - -SimpleUnionNamesStruct::SimpleUnionNamesStruct( - SimpleUnionNamesStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - -} - -SimpleUnionNamesStruct& SimpleUnionNamesStruct::operator =( - const SimpleUnionNamesStruct& x) -{ - m_my_union = x.m_my_union; - - return *this; -} - -SimpleUnionNamesStruct& SimpleUnionNamesStruct::operator =( - SimpleUnionNamesStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - - return *this; -} - -bool SimpleUnionNamesStruct::operator ==( - const SimpleUnionNamesStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleUnionNamesStruct::operator !=( - const SimpleUnionNamesStruct& x) const -{ - return !(*this == x); -} - -size_t SimpleUnionNamesStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SimpleUnionNamesStruct_max_cdr_typesize; -} - -size_t SimpleUnionNamesStruct::getCdrSerializedSize( - const SimpleUnionNamesStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += SimpleUnionNames::getCdrSerializedSize(data.my_union(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void SimpleUnionNamesStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_union; - -} - -void SimpleUnionNamesStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_union; - - -} - - -bool SimpleUnionNamesStruct::isKeyDefined() -{ - return false; -} - -void SimpleUnionNamesStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleUnionNamesStruct::my_union( - const SimpleUnionNames& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleUnionNamesStruct::my_union( - SimpleUnionNames&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleUnionNames& SimpleUnionNamesStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleUnionNames& SimpleUnionNamesStruct::my_union() -{ - return m_my_union; -} - - - - - -SimpleTypeUnionStruct::SimpleTypeUnionStruct() -{ - // SimpleTypeUnion m_my_union - - - // Just to register all known types - registerTypesTypes(); -} - -SimpleTypeUnionStruct::~SimpleTypeUnionStruct() -{ -} - -SimpleTypeUnionStruct::SimpleTypeUnionStruct( - const SimpleTypeUnionStruct& x) -{ - m_my_union = x.m_my_union; - -} - -SimpleTypeUnionStruct::SimpleTypeUnionStruct( - SimpleTypeUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - -} - -SimpleTypeUnionStruct& SimpleTypeUnionStruct::operator =( - const SimpleTypeUnionStruct& x) -{ - m_my_union = x.m_my_union; - - return *this; -} - -SimpleTypeUnionStruct& SimpleTypeUnionStruct::operator =( - SimpleTypeUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - - return *this; -} - -bool SimpleTypeUnionStruct::operator ==( - const SimpleTypeUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleTypeUnionStruct::operator !=( - const SimpleTypeUnionStruct& x) const -{ - return !(*this == x); -} - -size_t SimpleTypeUnionStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SimpleTypeUnionStruct_max_cdr_typesize; -} - -size_t SimpleTypeUnionStruct::getCdrSerializedSize( - const SimpleTypeUnionStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += SimpleTypeUnion::getCdrSerializedSize(data.my_union(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void SimpleTypeUnionStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_union; - -} - -void SimpleTypeUnionStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_union; - - -} - - -bool SimpleTypeUnionStruct::isKeyDefined() -{ - return false; -} - -void SimpleTypeUnionStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleTypeUnionStruct::my_union( - const SimpleTypeUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleTypeUnionStruct::my_union( - SimpleTypeUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleTypeUnion& SimpleTypeUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleTypeUnion& SimpleTypeUnionStruct::my_union() -{ - return m_my_union; -} - - - - - -SimpleBadUnionStruct::SimpleBadUnionStruct() -{ - // SimpleBadUnion m_my_union - - - // Just to register all known types - registerTypesTypes(); -} - -SimpleBadUnionStruct::~SimpleBadUnionStruct() -{ -} - -SimpleBadUnionStruct::SimpleBadUnionStruct( - const SimpleBadUnionStruct& x) -{ - m_my_union = x.m_my_union; - -} - -SimpleBadUnionStruct::SimpleBadUnionStruct( - SimpleBadUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - -} - -SimpleBadUnionStruct& SimpleBadUnionStruct::operator =( - const SimpleBadUnionStruct& x) -{ - m_my_union = x.m_my_union; - - return *this; -} - -SimpleBadUnionStruct& SimpleBadUnionStruct::operator =( - SimpleBadUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - - return *this; -} - -bool SimpleBadUnionStruct::operator ==( - const SimpleBadUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimpleBadUnionStruct::operator !=( - const SimpleBadUnionStruct& x) const -{ - return !(*this == x); -} - -size_t SimpleBadUnionStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SimpleBadUnionStruct_max_cdr_typesize; -} - -size_t SimpleBadUnionStruct::getCdrSerializedSize( - const SimpleBadUnionStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += SimpleBadUnion::getCdrSerializedSize(data.my_union(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void SimpleBadUnionStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_union; - -} - -void SimpleBadUnionStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_union; - - -} - - -bool SimpleBadUnionStruct::isKeyDefined() -{ - return false; -} - -void SimpleBadUnionStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimpleBadUnionStruct::my_union( - const SimpleBadUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimpleBadUnionStruct::my_union( - SimpleBadUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleBadUnion& SimpleBadUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleBadUnion& SimpleBadUnionStruct::my_union() -{ - return m_my_union; -} - - - - - -SimplBadDiscUnionStruct::SimplBadDiscUnionStruct() -{ - // SimpleBadDiscUnion m_my_union - - - // Just to register all known types - registerTypesTypes(); -} - -SimplBadDiscUnionStruct::~SimplBadDiscUnionStruct() -{ -} - -SimplBadDiscUnionStruct::SimplBadDiscUnionStruct( - const SimplBadDiscUnionStruct& x) -{ - m_my_union = x.m_my_union; - -} - -SimplBadDiscUnionStruct::SimplBadDiscUnionStruct( - SimplBadDiscUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - -} - -SimplBadDiscUnionStruct& SimplBadDiscUnionStruct::operator =( - const SimplBadDiscUnionStruct& x) -{ - m_my_union = x.m_my_union; - - return *this; -} - -SimplBadDiscUnionStruct& SimplBadDiscUnionStruct::operator =( - SimplBadDiscUnionStruct&& x) noexcept -{ - m_my_union = std::move(x.m_my_union); - - return *this; -} - -bool SimplBadDiscUnionStruct::operator ==( - const SimplBadDiscUnionStruct& x) const -{ - return (m_my_union == x.m_my_union); -} - -bool SimplBadDiscUnionStruct::operator !=( - const SimplBadDiscUnionStruct& x) const -{ - return !(*this == x); -} - -size_t SimplBadDiscUnionStruct::getMaxCdrSerializedSize( - size_t current_alignment) -{ - static_cast(current_alignment); - return SimplBadDiscUnionStruct_max_cdr_typesize; -} - -size_t SimplBadDiscUnionStruct::getCdrSerializedSize( - const SimplBadDiscUnionStruct& data, - size_t current_alignment) -{ - (void)data; - size_t initial_alignment = current_alignment; - - current_alignment += SimpleBadDiscUnion::getCdrSerializedSize(data.my_union(), current_alignment); - - - return current_alignment - initial_alignment; -} - - -void SimplBadDiscUnionStruct::serialize( - eprosima::fastcdr::Cdr& scdr) const -{ - scdr << m_my_union; - -} - -void SimplBadDiscUnionStruct::deserialize( - eprosima::fastcdr::Cdr& dcdr) -{ - dcdr >> m_my_union; - - -} - - -bool SimplBadDiscUnionStruct::isKeyDefined() -{ - return false; -} - -void SimplBadDiscUnionStruct::serializeKey( - eprosima::fastcdr::Cdr& scdr) const -{ - (void) scdr; -} - -/*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ -void SimplBadDiscUnionStruct::my_union( - const SimpleBadDiscUnion& _my_union) -{ - m_my_union = _my_union; -} - -/*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ -void SimplBadDiscUnionStruct::my_union( - SimpleBadDiscUnion&& _my_union) -{ - m_my_union = std::move(_my_union); -} - -/*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ -const SimpleBadDiscUnion& SimplBadDiscUnionStruct::my_union() const -{ - return m_my_union; -} - -/*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ -SimpleBadDiscUnion& SimplBadDiscUnionStruct::my_union() -{ - return m_my_union; -} - - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/test/xtypes/idl/Typesv1.h b/test/xtypes/idl/Typesv1.h deleted file mode 100644 index 9b6aae6ee62..00000000000 --- a/test/xtypes/idl/Typesv1.h +++ /dev/null @@ -1,6496 +0,0 @@ -// 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 Types.h - * This header file contains the declaration of the described types in the IDL file. - * - * This file was generated by the tool fastddsgen. - */ - -#include - -#if FASTCDR_VERSION_MAJOR == 1 - -#ifndef _FAST_DDS_GENERATED_TYPES_H_ -#define _FAST_DDS_GENERATED_TYPES_H_ - - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#define eProsima_user_DllExport __declspec( dllexport ) -#else -#define eProsima_user_DllExport -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define eProsima_user_DllExport -#endif // _WIN32 - -#if defined(_WIN32) -#if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(TYPES_SOURCE) -#define TYPES_DllAPI __declspec( dllexport ) -#else -#define TYPES_DllAPI __declspec( dllimport ) -#endif // TYPES_SOURCE -#else -#define TYPES_DllAPI -#endif // EPROSIMA_USER_DLL_EXPORT -#else -#define TYPES_DllAPI -#endif // _WIN32 - -namespace eprosima { -namespace fastcdr { -class Cdr; -} // namespace fastcdr -} // namespace eprosima - - - -/*! - * @brief This class represents the enumeration MyEnum defined by the user in the IDL file. - * @ingroup Types - */ -enum MyEnum : uint32_t -{ - A, - B, - C -}; -/*! - * @brief This class represents the enumeration MyBadEnum defined by the user in the IDL file. - * @ingroup Types - */ -enum MyBadEnum : uint32_t -{ - A1, - B1, - C1 -}; - - -/*! - * @brief This class represents the structure MyEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyEnumStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyEnumStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyEnumStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct( - const MyEnumStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct( - MyEnumStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct& operator =( - const MyEnumStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyEnumStruct that will be copied. - */ - eProsima_user_DllExport MyEnumStruct& operator =( - MyEnumStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyEnumStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MyEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyEnumStruct& x) const; - - /*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ - eProsima_user_DllExport void my_enum( - MyEnum _my_enum); - - /*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ - eProsima_user_DllExport MyEnum my_enum() const; - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyEnum& my_enum(); - - - /*! - * @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 MyEnumStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - MyEnum m_my_enum; - -}; - - - -/*! - * @brief This class represents the structure MyBadEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyBadEnumStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyBadEnumStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyBadEnumStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct( - const MyBadEnumStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct( - MyBadEnumStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct& operator =( - const MyBadEnumStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyBadEnumStruct that will be copied. - */ - eProsima_user_DllExport MyBadEnumStruct& operator =( - MyBadEnumStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyBadEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyBadEnumStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MyBadEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyBadEnumStruct& x) const; - - /*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ - eProsima_user_DllExport void my_enum( - MyBadEnum _my_enum); - - /*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ - eProsima_user_DllExport MyBadEnum my_enum() const; - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyBadEnum& my_enum(); - - - /*! - * @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 MyBadEnumStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - MyBadEnum m_my_enum; - -}; - -typedef MyEnum MyAliasEnum; - - - -/*! - * @brief This class represents the structure MyAliasEnumStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MyAliasEnumStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MyAliasEnumStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MyAliasEnumStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct( - const MyAliasEnumStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct( - MyAliasEnumStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct& operator =( - const MyAliasEnumStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MyAliasEnumStruct that will be copied. - */ - eProsima_user_DllExport MyAliasEnumStruct& operator =( - MyAliasEnumStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MyAliasEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MyAliasEnumStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MyAliasEnumStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MyAliasEnumStruct& x) const; - - /*! - * @brief This function sets a value in member my_enum - * @param _my_enum New value for member my_enum - */ - eProsima_user_DllExport void my_enum( - MyAliasEnum _my_enum); - - /*! - * @brief This function returns the value of member my_enum - * @return Value of member my_enum - */ - eProsima_user_DllExport MyAliasEnum my_enum() const; - - /*! - * @brief This function returns a reference to member my_enum - * @return Reference to member my_enum - */ - eProsima_user_DllExport MyAliasEnum& my_enum(); - - - /*! - * @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 MyAliasEnumStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - MyAliasEnum m_my_enum; - -}; - - - -/*! - * @brief This class represents the structure BasicStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct( - const BasicStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct( - BasicStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct& operator =( - const BasicStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicStruct that will be copied. - */ - eProsima_user_DllExport BasicStruct& operator =( - BasicStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - bool _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport bool my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - - - /*! - * @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 BasicStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - bool m_my_bool; - int32_t m_my_int32; - std::string m_my_string; - -}; - - - -/*! - * @brief This class represents the structure BasicNamesStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicNamesStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicNamesStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicNamesStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct( - const BasicNamesStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct( - BasicNamesStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct& operator =( - const BasicNamesStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicNamesStruct that will be copied. - */ - eProsima_user_DllExport BasicNamesStruct& operator =( - BasicNamesStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicNamesStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicNamesStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool_name - * @param _my_bool_name New value for member my_bool_name - */ - eProsima_user_DllExport void my_bool_name( - bool _my_bool_name); - - /*! - * @brief This function returns the value of member my_bool_name - * @return Value of member my_bool_name - */ - eProsima_user_DllExport bool my_bool_name() const; - - /*! - * @brief This function returns a reference to member my_bool_name - * @return Reference to member my_bool_name - */ - eProsima_user_DllExport bool& my_bool_name(); - - - /*! - * @brief This function sets a value in member my_int32_name - * @param _my_int32_name New value for member my_int32_name - */ - eProsima_user_DllExport void my_int32_name( - int32_t _my_int32_name); - - /*! - * @brief This function returns the value of member my_int32_name - * @return Value of member my_int32_name - */ - eProsima_user_DllExport int32_t my_int32_name() const; - - /*! - * @brief This function returns a reference to member my_int32_name - * @return Reference to member my_int32_name - */ - eProsima_user_DllExport int32_t& my_int32_name(); - - - /*! - * @brief This function copies the value in member my_string_name - * @param _my_string_name New value to be copied in member my_string_name - */ - eProsima_user_DllExport void my_string_name( - const std::string& _my_string_name); - - /*! - * @brief This function moves the value in member my_string_name - * @param _my_string_name New value to be moved in member my_string_name - */ - eProsima_user_DllExport void my_string_name( - std::string&& _my_string_name); - - /*! - * @brief This function returns a constant reference to member my_string_name - * @return Constant reference to member my_string_name - */ - eProsima_user_DllExport const std::string& my_string_name() const; - - /*! - * @brief This function returns a reference to member my_string_name - * @return Reference to member my_string_name - */ - eProsima_user_DllExport std::string& my_string_name(); - - - /*! - * @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 BasicNamesStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - bool m_my_bool_name; - int32_t m_my_int32_name; - std::string m_my_string_name; - -}; - - - -/*! - * @brief This class represents the structure BasicBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicBadStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicBadStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicBadStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct( - const BasicBadStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct( - BasicBadStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct& operator =( - const BasicBadStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicBadStruct that will be copied. - */ - eProsima_user_DllExport BasicBadStruct& operator =( - BasicBadStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicBadStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicBadStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicBadStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicBadStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - uint8_t _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport uint8_t my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport uint8_t& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - - - /*! - * @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 BasicBadStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - uint8_t m_my_bool; - int32_t m_my_int32; - std::string m_my_string; - -}; - - - -/*! - * @brief This class represents the structure BasicWideStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BasicWideStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BasicWideStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BasicWideStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct( - const BasicWideStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct( - BasicWideStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct& operator =( - const BasicWideStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BasicWideStruct that will be copied. - */ - eProsima_user_DllExport BasicWideStruct& operator =( - BasicWideStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BasicWideStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BasicWideStruct& x) const; - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - bool _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport bool my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - - - /*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ - eProsima_user_DllExport void new_int32( - int32_t _new_int32); - - /*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ - eProsima_user_DllExport int32_t new_int32() const; - - /*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ - eProsima_user_DllExport int32_t& new_int32(); - - - /*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ - eProsima_user_DllExport void new_string( - const std::string& _new_string); - - /*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ - eProsima_user_DllExport void new_string( - std::string&& _new_string); - - /*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ - eProsima_user_DllExport const std::string& new_string() const; - - /*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ - eProsima_user_DllExport std::string& new_string(); - - - /*! - * @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 BasicWideStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - bool m_my_bool; - int32_t m_my_int32; - std::string m_my_string; - int32_t m_new_int32; - std::string m_new_string; - -}; - - - -/*! - * @brief This class represents the structure BadBasicWideStruct defined by the user in the IDL file. - * @ingroup Types - */ -class BadBasicWideStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport BadBasicWideStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~BadBasicWideStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct( - const BadBasicWideStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct( - BadBasicWideStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct& operator =( - const BadBasicWideStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object BadBasicWideStruct that will be copied. - */ - eProsima_user_DllExport BadBasicWideStruct& operator =( - BadBasicWideStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x BadBasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const BadBasicWideStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x BadBasicWideStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const BadBasicWideStruct& x) const; - - /*! - * @brief This function sets a value in member new_int32 - * @param _new_int32 New value for member new_int32 - */ - eProsima_user_DllExport void new_int32( - int32_t _new_int32); - - /*! - * @brief This function returns the value of member new_int32 - * @return Value of member new_int32 - */ - eProsima_user_DllExport int32_t new_int32() const; - - /*! - * @brief This function returns a reference to member new_int32 - * @return Reference to member new_int32 - */ - eProsima_user_DllExport int32_t& new_int32(); - - - /*! - * @brief This function copies the value in member new_string - * @param _new_string New value to be copied in member new_string - */ - eProsima_user_DllExport void new_string( - const std::string& _new_string); - - /*! - * @brief This function moves the value in member new_string - * @param _new_string New value to be moved in member new_string - */ - eProsima_user_DllExport void new_string( - std::string&& _new_string); - - /*! - * @brief This function returns a constant reference to member new_string - * @return Constant reference to member new_string - */ - eProsima_user_DllExport const std::string& new_string() const; - - /*! - * @brief This function returns a reference to member new_string - * @return Reference to member new_string - */ - eProsima_user_DllExport std::string& new_string(); - - - /*! - * @brief This function sets a value in member my_bool - * @param _my_bool New value for member my_bool - */ - eProsima_user_DllExport void my_bool( - bool _my_bool); - - /*! - * @brief This function returns the value of member my_bool - * @return Value of member my_bool - */ - eProsima_user_DllExport bool my_bool() const; - - /*! - * @brief This function returns a reference to member my_bool - * @return Reference to member my_bool - */ - eProsima_user_DllExport bool& my_bool(); - - - /*! - * @brief This function sets a value in member my_int32 - * @param _my_int32 New value for member my_int32 - */ - eProsima_user_DllExport void my_int32( - int32_t _my_int32); - - /*! - * @brief This function returns the value of member my_int32 - * @return Value of member my_int32 - */ - eProsima_user_DllExport int32_t my_int32() const; - - /*! - * @brief This function returns a reference to member my_int32 - * @return Reference to member my_int32 - */ - eProsima_user_DllExport int32_t& my_int32(); - - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - - - /*! - * @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 BadBasicWideStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - int32_t m_new_int32; - std::string m_new_string; - bool m_my_bool; - int32_t m_my_int32; - std::string m_my_string; - -}; - - - -/*! - * @brief This class represents the structure StringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class StringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport StringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~StringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct( - const StringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct( - StringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct& operator =( - const StringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object StringStruct that will be copied. - */ - eProsima_user_DllExport StringStruct& operator =( - StringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x StringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const StringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x StringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const StringStruct& x) const; - - /*! - * @brief This function copies the value in member my_string - * @param _my_string New value to be copied in member my_string - */ - eProsima_user_DllExport void my_string( - const std::string& _my_string); - - /*! - * @brief This function moves the value in member my_string - * @param _my_string New value to be moved in member my_string - */ - eProsima_user_DllExport void my_string( - std::string&& _my_string); - - /*! - * @brief This function returns a constant reference to member my_string - * @return Constant reference to member my_string - */ - eProsima_user_DllExport const std::string& my_string() const; - - /*! - * @brief This function returns a reference to member my_string - * @return Reference to member my_string - */ - eProsima_user_DllExport std::string& my_string(); - - - /*! - * @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 StringStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::string m_my_string; - -}; - - - -/*! - * @brief This class represents the structure LargeStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class LargeStringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LargeStringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LargeStringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct( - const LargeStringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct( - LargeStringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct& operator =( - const LargeStringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LargeStringStruct that will be copied. - */ - eProsima_user_DllExport LargeStringStruct& operator =( - LargeStringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LargeStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LargeStringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x LargeStringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LargeStringStruct& x) const; - - /*! - * @brief This function copies the value in member my_large_string - * @param _my_large_string New value to be copied in member my_large_string - */ - eProsima_user_DllExport void my_large_string( - const eprosima::fastcdr::fixed_string<41925>& _my_large_string); - - /*! - * @brief This function moves the value in member my_large_string - * @param _my_large_string New value to be moved in member my_large_string - */ - eProsima_user_DllExport void my_large_string( - eprosima::fastcdr::fixed_string<41925>&& _my_large_string); - - /*! - * @brief This function returns a constant reference to member my_large_string - * @return Constant reference to member my_large_string - */ - eProsima_user_DllExport const eprosima::fastcdr::fixed_string<41925>& my_large_string() const; - - /*! - * @brief This function returns a reference to member my_large_string - * @return Reference to member my_large_string - */ - eProsima_user_DllExport eprosima::fastcdr::fixed_string<41925>& my_large_string(); - - - /*! - * @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 LargeStringStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - eprosima::fastcdr::fixed_string<41925> m_my_large_string; - -}; - - - -/*! - * @brief This class represents the structure WStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class WStringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport WStringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~WStringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct( - const WStringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct( - WStringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct& operator =( - const WStringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object WStringStruct that will be copied. - */ - eProsima_user_DllExport WStringStruct& operator =( - WStringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x WStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const WStringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x WStringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const WStringStruct& x) const; - - /*! - * @brief This function copies the value in member my_wstring - * @param _my_wstring New value to be copied in member my_wstring - */ - eProsima_user_DllExport void my_wstring( - const std::wstring& _my_wstring); - - /*! - * @brief This function moves the value in member my_wstring - * @param _my_wstring New value to be moved in member my_wstring - */ - eProsima_user_DllExport void my_wstring( - std::wstring&& _my_wstring); - - /*! - * @brief This function returns a constant reference to member my_wstring - * @return Constant reference to member my_wstring - */ - eProsima_user_DllExport const std::wstring& my_wstring() const; - - /*! - * @brief This function returns a reference to member my_wstring - * @return Reference to member my_wstring - */ - eProsima_user_DllExport std::wstring& my_wstring(); - - - /*! - * @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 WStringStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::wstring m_my_wstring; - -}; - - - -/*! - * @brief This class represents the structure LargeWStringStruct defined by the user in the IDL file. - * @ingroup Types - */ -class LargeWStringStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport LargeWStringStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~LargeWStringStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct( - const LargeWStringStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct( - LargeWStringStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct& operator =( - const LargeWStringStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object LargeWStringStruct that will be copied. - */ - eProsima_user_DllExport LargeWStringStruct& operator =( - LargeWStringStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x LargeWStringStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const LargeWStringStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x LargeWStringStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const LargeWStringStruct& x) const; - - /*! - * @brief This function copies the value in member my_large_wstring - * @param _my_large_wstring New value to be copied in member my_large_wstring - */ - eProsima_user_DllExport void my_large_wstring( - const std::wstring& _my_large_wstring); - - /*! - * @brief This function moves the value in member my_large_wstring - * @param _my_large_wstring New value to be moved in member my_large_wstring - */ - eProsima_user_DllExport void my_large_wstring( - std::wstring&& _my_large_wstring); - - /*! - * @brief This function returns a constant reference to member my_large_wstring - * @return Constant reference to member my_large_wstring - */ - eProsima_user_DllExport const std::wstring& my_large_wstring() const; - - /*! - * @brief This function returns a reference to member my_large_wstring - * @return Reference to member my_large_wstring - */ - eProsima_user_DllExport std::wstring& my_large_wstring(); - - - /*! - * @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 LargeWStringStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::wstring m_my_large_wstring; - -}; - - - -/*! - * @brief This class represents the structure ArrayStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct( - const ArrayStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct( - ArrayStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct& operator =( - const ArrayStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayStruct that will be copied. - */ - eProsima_user_DllExport ArrayStruct& operator =( - ArrayStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array& my_array(); - - - /*! - * @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 ArrayStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::array m_my_array; - -}; - - - -/*! - * @brief This class represents the structure ArrayStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual( - const ArrayStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual( - ArrayStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual& operator =( - const ArrayStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayStructEqual that will be copied. - */ - eProsima_user_DllExport ArrayStructEqual& operator =( - ArrayStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_array_equal - * @param _my_array_equal New value to be copied in member my_array_equal - */ - eProsima_user_DllExport void my_array_equal( - const std::array& _my_array_equal); - - /*! - * @brief This function moves the value in member my_array_equal - * @param _my_array_equal New value to be moved in member my_array_equal - */ - eProsima_user_DllExport void my_array_equal( - std::array&& _my_array_equal); - - /*! - * @brief This function returns a constant reference to member my_array_equal - * @return Constant reference to member my_array_equal - */ - eProsima_user_DllExport const std::array& my_array_equal() const; - - /*! - * @brief This function returns a reference to member my_array_equal - * @return Reference to member my_array_equal - */ - eProsima_user_DllExport std::array& my_array_equal(); - - - /*! - * @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 ArrayStructEqual& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::array m_my_array_equal; - -}; - - - -/*! - * @brief This class represents the structure ArrayBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayBadStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayBadStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayBadStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct( - const ArrayBadStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct( - ArrayBadStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct& operator =( - const ArrayBadStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayBadStruct that will be copied. - */ - eProsima_user_DllExport ArrayBadStruct& operator =( - ArrayBadStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayBadStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayBadStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayBadStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayBadStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array& my_array(); - - - /*! - * @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 ArrayBadStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::array m_my_array; - -}; - - - -/*! - * @brief This class represents the structure ArrayDimensionsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArrayDimensionsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArrayDimensionsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArrayDimensionsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct( - const ArrayDimensionsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct( - ArrayDimensionsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct& operator =( - const ArrayDimensionsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArrayDimensionsStruct that will be copied. - */ - eProsima_user_DllExport ArrayDimensionsStruct& operator =( - ArrayDimensionsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArrayDimensionsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArrayDimensionsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArrayDimensionsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArrayDimensionsStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array, 2>& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array, 2>&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array, 2>& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array, 2>& my_array(); - - - /*! - * @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 ArrayDimensionsStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::array, 2> m_my_array; - -}; - - - -/*! - * @brief This class represents the structure ArraySizeStruct defined by the user in the IDL file. - * @ingroup Types - */ -class ArraySizeStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport ArraySizeStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~ArraySizeStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct( - const ArraySizeStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct( - ArraySizeStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct& operator =( - const ArraySizeStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object ArraySizeStruct that will be copied. - */ - eProsima_user_DllExport ArraySizeStruct& operator =( - ArraySizeStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x ArraySizeStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const ArraySizeStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x ArraySizeStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const ArraySizeStruct& x) const; - - /*! - * @brief This function copies the value in member my_array - * @param _my_array New value to be copied in member my_array - */ - eProsima_user_DllExport void my_array( - const std::array& _my_array); - - /*! - * @brief This function moves the value in member my_array - * @param _my_array New value to be moved in member my_array - */ - eProsima_user_DllExport void my_array( - std::array&& _my_array); - - /*! - * @brief This function returns a constant reference to member my_array - * @return Constant reference to member my_array - */ - eProsima_user_DllExport const std::array& my_array() const; - - /*! - * @brief This function returns a reference to member my_array - * @return Reference to member my_array - */ - eProsima_user_DllExport std::array& my_array(); - - - /*! - * @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 ArraySizeStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::array m_my_array; - -}; - - - - - -/*! - * @brief This class represents the structure SequenceStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct( - const SequenceStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct( - SequenceStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct& operator =( - const SequenceStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceStruct& operator =( - SequenceStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - const std::vector& _my_sequence); - - /*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - std::vector&& _my_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ - eProsima_user_DllExport const std::vector& my_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ - eProsima_user_DllExport std::vector& my_sequence(); - - - /*! - * @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 SequenceStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::vector m_my_sequence; - -}; - - - - - -/*! - * @brief This class represents the structure SequenceStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual( - const SequenceStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual( - SequenceStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual& operator =( - const SequenceStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceStructEqual that will be copied. - */ - eProsima_user_DllExport SequenceStructEqual& operator =( - SequenceStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_sequence_equal - * @param _my_sequence_equal New value to be copied in member my_sequence_equal - */ - eProsima_user_DllExport void my_sequence_equal( - const std::vector& _my_sequence_equal); - - /*! - * @brief This function moves the value in member my_sequence_equal - * @param _my_sequence_equal New value to be moved in member my_sequence_equal - */ - eProsima_user_DllExport void my_sequence_equal( - std::vector&& _my_sequence_equal); - - /*! - * @brief This function returns a constant reference to member my_sequence_equal - * @return Constant reference to member my_sequence_equal - */ - eProsima_user_DllExport const std::vector& my_sequence_equal() const; - - /*! - * @brief This function returns a reference to member my_sequence_equal - * @return Reference to member my_sequence_equal - */ - eProsima_user_DllExport std::vector& my_sequence_equal(); - - - /*! - * @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 SequenceStructEqual& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::vector m_my_sequence_equal; - -}; - - - - - -/*! - * @brief This class represents the structure SequenceBadStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceBadStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceBadStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceBadStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct( - const SequenceBadStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct( - SequenceBadStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct& operator =( - const SequenceBadStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceBadStruct that will be copied. - */ - eProsima_user_DllExport SequenceBadStruct& operator =( - SequenceBadStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceBadStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceBadStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceBadStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceBadStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - const std::vector& _my_sequence); - - /*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - std::vector&& _my_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ - eProsima_user_DllExport const std::vector& my_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ - eProsima_user_DllExport std::vector& my_sequence(); - - - /*! - * @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 SequenceBadStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::vector m_my_sequence; - -}; - - - - - -/*! - * @brief This class represents the structure SequenceBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct( - const SequenceBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct( - SequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct& operator =( - const SequenceBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceBoundsStruct& operator =( - SequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence - * @param _my_sequence New value to be copied in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - const std::vector& _my_sequence); - - /*! - * @brief This function moves the value in member my_sequence - * @param _my_sequence New value to be moved in member my_sequence - */ - eProsima_user_DllExport void my_sequence( - std::vector&& _my_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence - * @return Constant reference to member my_sequence - */ - eProsima_user_DllExport const std::vector& my_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence - * @return Reference to member my_sequence - */ - eProsima_user_DllExport std::vector& my_sequence(); - - - /*! - * @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 SequenceBoundsStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::vector m_my_sequence; - -}; - - - - - - - -/*! - * @brief This class represents the structure SequenceSequenceStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceSequenceStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceSequenceStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceSequenceStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct( - const SequenceSequenceStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct( - SequenceSequenceStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct& operator =( - const SequenceSequenceStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceSequenceStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceStruct& operator =( - SequenceSequenceStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceSequenceStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceSequenceStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - const std::vector>& _my_sequence_sequence); - - /*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - std::vector>&& _my_sequence_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ - eProsima_user_DllExport const std::vector>& my_sequence_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ - eProsima_user_DllExport std::vector>& my_sequence_sequence(); - - - /*! - * @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 SequenceSequenceStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::vector> m_my_sequence_sequence; - -}; - - - - - - - -/*! - * @brief This class represents the structure SequenceSequenceBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SequenceSequenceBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SequenceSequenceBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct( - const SequenceSequenceBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct( - SequenceSequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct& operator =( - const SequenceSequenceBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SequenceSequenceBoundsStruct that will be copied. - */ - eProsima_user_DllExport SequenceSequenceBoundsStruct& operator =( - SequenceSequenceBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SequenceSequenceBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SequenceSequenceBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SequenceSequenceBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be copied in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - const std::vector>& _my_sequence_sequence); - - /*! - * @brief This function moves the value in member my_sequence_sequence - * @param _my_sequence_sequence New value to be moved in member my_sequence_sequence - */ - eProsima_user_DllExport void my_sequence_sequence( - std::vector>&& _my_sequence_sequence); - - /*! - * @brief This function returns a constant reference to member my_sequence_sequence - * @return Constant reference to member my_sequence_sequence - */ - eProsima_user_DllExport const std::vector>& my_sequence_sequence() const; - - /*! - * @brief This function returns a reference to member my_sequence_sequence - * @return Reference to member my_sequence_sequence - */ - eProsima_user_DllExport std::vector>& my_sequence_sequence(); - - - /*! - * @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 SequenceSequenceBoundsStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::vector> m_my_sequence_sequence; - -}; - - - - - -/*! - * @brief This class represents the structure MapStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct( - const MapStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct( - MapStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct& operator =( - const MapStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapStruct that will be copied. - */ - eProsima_user_DllExport MapStruct& operator =( - MapStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - - - /*! - * @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 MapStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::map m_my_map; - -}; - - - - - -/*! - * @brief This class represents the structure MapStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class MapStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual( - const MapStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual( - MapStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual& operator =( - const MapStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapStructEqual that will be copied. - */ - eProsima_user_DllExport MapStructEqual& operator =( - MapStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x MapStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_map_equal - * @param _my_map_equal New value to be copied in member my_map_equal - */ - eProsima_user_DllExport void my_map_equal( - const std::map& _my_map_equal); - - /*! - * @brief This function moves the value in member my_map_equal - * @param _my_map_equal New value to be moved in member my_map_equal - */ - eProsima_user_DllExport void my_map_equal( - std::map&& _my_map_equal); - - /*! - * @brief This function returns a constant reference to member my_map_equal - * @return Constant reference to member my_map_equal - */ - eProsima_user_DllExport const std::map& my_map_equal() const; - - /*! - * @brief This function returns a reference to member my_map_equal - * @return Reference to member my_map_equal - */ - eProsima_user_DllExport std::map& my_map_equal(); - - - /*! - * @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 MapStructEqual& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::map m_my_map_equal; - -}; - - - - - -/*! - * @brief This class represents the structure MapBadKeyStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBadKeyStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapBadKeyStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapBadKeyStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct( - const MapBadKeyStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct( - MapBadKeyStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct& operator =( - const MapBadKeyStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapBadKeyStruct that will be copied. - */ - eProsima_user_DllExport MapBadKeyStruct& operator =( - MapBadKeyStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapBadKeyStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapBadKeyStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapBadKeyStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapBadKeyStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - - - /*! - * @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 MapBadKeyStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::map m_my_map; - -}; - - - - - -/*! - * @brief This class represents the structure MapBadElemStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBadElemStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapBadElemStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapBadElemStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct( - const MapBadElemStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct( - MapBadElemStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct& operator =( - const MapBadElemStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapBadElemStruct that will be copied. - */ - eProsima_user_DllExport MapBadElemStruct& operator =( - MapBadElemStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapBadElemStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapBadElemStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapBadElemStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapBadElemStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - - - /*! - * @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 MapBadElemStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::map m_my_map; - -}; - - - - - -/*! - * @brief This class represents the structure MapBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct( - const MapBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct( - MapBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct& operator =( - const MapBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapBoundsStruct& operator =( - MapBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_map - * @param _my_map New value to be copied in member my_map - */ - eProsima_user_DllExport void my_map( - const std::map& _my_map); - - /*! - * @brief This function moves the value in member my_map - * @param _my_map New value to be moved in member my_map - */ - eProsima_user_DllExport void my_map( - std::map&& _my_map); - - /*! - * @brief This function returns a constant reference to member my_map - * @return Constant reference to member my_map - */ - eProsima_user_DllExport const std::map& my_map() const; - - /*! - * @brief This function returns a reference to member my_map - * @return Reference to member my_map - */ - eProsima_user_DllExport std::map& my_map(); - - - /*! - * @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 MapBoundsStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::map m_my_map; - -}; - - - - - - - -/*! - * @brief This class represents the structure MapMapStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapMapStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapMapStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapMapStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct( - const MapMapStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct( - MapMapStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct& operator =( - const MapMapStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapMapStruct that will be copied. - */ - eProsima_user_DllExport MapMapStruct& operator =( - MapMapStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapMapStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapMapStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapMapStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapMapStruct& x) const; - - /*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - const std::map>& _my_map_map); - - /*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - std::map>&& _my_map_map); - - /*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ - eProsima_user_DllExport const std::map>& my_map_map() const; - - /*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ - eProsima_user_DllExport std::map>& my_map_map(); - - - /*! - * @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 MapMapStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::map> m_my_map_map; - -}; - - - - - - - -/*! - * @brief This class represents the structure MapMapBoundsStruct defined by the user in the IDL file. - * @ingroup Types - */ -class MapMapBoundsStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport MapMapBoundsStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~MapMapBoundsStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct( - const MapMapBoundsStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct( - MapMapBoundsStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct& operator =( - const MapMapBoundsStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object MapMapBoundsStruct that will be copied. - */ - eProsima_user_DllExport MapMapBoundsStruct& operator =( - MapMapBoundsStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x MapMapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const MapMapBoundsStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x MapMapBoundsStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const MapMapBoundsStruct& x) const; - - /*! - * @brief This function copies the value in member my_map_map - * @param _my_map_map New value to be copied in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - const std::map>& _my_map_map); - - /*! - * @brief This function moves the value in member my_map_map - * @param _my_map_map New value to be moved in member my_map_map - */ - eProsima_user_DllExport void my_map_map( - std::map>&& _my_map_map); - - /*! - * @brief This function returns a constant reference to member my_map_map - * @return Constant reference to member my_map_map - */ - eProsima_user_DllExport const std::map>& my_map_map() const; - - /*! - * @brief This function returns a reference to member my_map_map - * @return Reference to member my_map_map - */ - eProsima_user_DllExport std::map>& my_map_map(); - - - /*! - * @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 MapMapBoundsStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - std::map> m_my_map_map; - -}; - - - -/*! - * @brief This class represents the union SimpleUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion( - const SimpleUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion( - SimpleUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion& operator =( - const SimpleUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnion that will be copied. - */ - eProsima_user_DllExport SimpleUnion& operator =( - SimpleUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - - - /*! - * @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 SimpleUnion& 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: - - int32_t m__d; - - int32_t m_first; - int64_t m_second; -}; - - - -/*! - * @brief This class represents the union SimpleUnionNames defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionNames -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionNames(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionNames(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames( - const SimpleUnionNames& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames( - SimpleUnionNames&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames& operator =( - const SimpleUnionNames& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionNames that will be copied. - */ - eProsima_user_DllExport SimpleUnionNames& operator =( - SimpleUnionNames&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNames object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionNames& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNames object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionNames& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first_case - * @param _first_case New value for member first_case - */ - eProsima_user_DllExport void first_case( - int32_t _first_case); - - /*! - * @brief This function returns the value of member first_case - * @return Value of member first_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first_case() const; - - /*! - * @brief This function returns a reference to member first_case - * @return Reference to member first_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first_case(); - - - /*! - * @brief This function sets a value in member second_case - * @param _second_case New value for member second_case - */ - eProsima_user_DllExport void second_case( - int64_t _second_case); - - /*! - * @brief This function returns the value of member second_case - * @return Value of member second_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second_case() const; - - /*! - * @brief This function returns a reference to member second_case - * @return Reference to member second_case - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second_case(); - - - /*! - * @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 SimpleUnionNames& 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: - - int32_t m__d; - - int32_t m_first_case; - int64_t m_second_case; -}; - - - -/*! - * @brief This class represents the union SimpleTypeUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleTypeUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleTypeUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleTypeUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion( - const SimpleTypeUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion( - SimpleTypeUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion& operator =( - const SimpleTypeUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleTypeUnion that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnion& operator =( - SimpleTypeUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleTypeUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleTypeUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - uint8_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport uint8_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - - - /*! - * @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 SimpleTypeUnion& 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: - - int32_t m__d; - - uint8_t m_first; - int64_t m_second; -}; - - - -/*! - * @brief This class represents the union SimpleBadUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleBadUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleBadUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleBadUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion( - const SimpleBadUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion( - SimpleBadUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion& operator =( - const SimpleBadUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleBadUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadUnion& operator =( - SimpleBadUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleBadUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleBadUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - int32_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport int32_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport int32_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - - - /*! - * @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 SimpleBadUnion& 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: - - int32_t m__d; - - int32_t m_first; - int64_t m_second; -}; - - - -/*! - * @brief This class represents the union SimpleBadDiscUnion defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleBadDiscUnion -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleBadDiscUnion(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleBadDiscUnion(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion( - const SimpleBadDiscUnion& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion( - SimpleBadDiscUnion&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion& operator =( - const SimpleBadDiscUnion& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleBadDiscUnion that will be copied. - */ - eProsima_user_DllExport SimpleBadDiscUnion& operator =( - SimpleBadDiscUnion&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleBadDiscUnion object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleBadDiscUnion& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleBadDiscUnion object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleBadDiscUnion& x) const; - - /*! - * @brief This function sets the discriminator value. - * @param __d New value for the discriminator. - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the new value doesn't correspond to the selected union member. - */ - eProsima_user_DllExport void _d( - uint8_t __d); - - /*! - * @brief This function returns the value of the discriminator. - * @return Value of the discriminator - */ - eProsima_user_DllExport uint8_t _d() const; - - /*! - * @brief This function returns a reference to the discriminator. - * @return Reference to the discriminator. - */ - eProsima_user_DllExport uint8_t& _d(); - - /*! - * @brief This function sets a value in member first - * @param _first New value for member first - */ - eProsima_user_DllExport void first( - int32_t _first); - - /*! - * @brief This function returns the value of member first - * @return Value of member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t first() const; - - /*! - * @brief This function returns a reference to member first - * @return Reference to member first - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int32_t& first(); - - - /*! - * @brief This function sets a value in member second - * @param _second New value for member second - */ - eProsima_user_DllExport void second( - int64_t _second); - - /*! - * @brief This function returns the value of member second - * @return Value of member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t second() const; - - /*! - * @brief This function returns a reference to member second - * @return Reference to member second - * @exception eprosima::fastcdr::BadParamException This exception is thrown if the requested union member is not the current selection. - */ - eProsima_user_DllExport int64_t& second(); - - - /*! - * @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 SimpleBadDiscUnion& 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: - - uint8_t m__d; - - int32_t m_first; - int64_t m_second; -}; - - - -/*! - * @brief This class represents the structure SimpleUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct( - const SimpleUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct( - SimpleUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct& operator =( - const SimpleUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionStruct& operator =( - SimpleUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleUnion& my_union(); - - - /*! - * @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 SimpleUnionStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - SimpleUnion m_my_union; - -}; - - - -/*! - * @brief This class represents the structure SimpleUnionStructEqual defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionStructEqual -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionStructEqual(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionStructEqual(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual( - const SimpleUnionStructEqual& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual( - SimpleUnionStructEqual&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual& operator =( - const SimpleUnionStructEqual& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionStructEqual that will be copied. - */ - eProsima_user_DllExport SimpleUnionStructEqual& operator =( - SimpleUnionStructEqual&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStructEqual object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionStructEqual& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionStructEqual object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionStructEqual& x) const; - - /*! - * @brief This function copies the value in member my_union_equal - * @param _my_union_equal New value to be copied in member my_union_equal - */ - eProsima_user_DllExport void my_union_equal( - const SimpleUnion& _my_union_equal); - - /*! - * @brief This function moves the value in member my_union_equal - * @param _my_union_equal New value to be moved in member my_union_equal - */ - eProsima_user_DllExport void my_union_equal( - SimpleUnion&& _my_union_equal); - - /*! - * @brief This function returns a constant reference to member my_union_equal - * @return Constant reference to member my_union_equal - */ - eProsima_user_DllExport const SimpleUnion& my_union_equal() const; - - /*! - * @brief This function returns a reference to member my_union_equal - * @return Reference to member my_union_equal - */ - eProsima_user_DllExport SimpleUnion& my_union_equal(); - - - /*! - * @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 SimpleUnionStructEqual& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - SimpleUnion m_my_union_equal; - -}; - - - -/*! - * @brief This class represents the structure SimpleUnionNamesStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleUnionNamesStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleUnionNamesStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleUnionNamesStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct( - const SimpleUnionNamesStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct( - SimpleUnionNamesStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct& operator =( - const SimpleUnionNamesStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleUnionNamesStruct that will be copied. - */ - eProsima_user_DllExport SimpleUnionNamesStruct& operator =( - SimpleUnionNamesStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleUnionNamesStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleUnionNamesStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleUnionNamesStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleUnionNames& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleUnionNames&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleUnionNames& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleUnionNames& my_union(); - - - /*! - * @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 SimpleUnionNamesStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - SimpleUnionNames m_my_union; - -}; - - - -/*! - * @brief This class represents the structure SimpleTypeUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleTypeUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleTypeUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleTypeUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct( - const SimpleTypeUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct( - SimpleTypeUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct& operator =( - const SimpleTypeUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleTypeUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleTypeUnionStruct& operator =( - SimpleTypeUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleTypeUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleTypeUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleTypeUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleTypeUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleTypeUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleTypeUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleTypeUnion& my_union(); - - - /*! - * @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 SimpleTypeUnionStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - SimpleTypeUnion m_my_union; - -}; - - - -/*! - * @brief This class represents the structure SimpleBadUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimpleBadUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimpleBadUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimpleBadUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct( - const SimpleBadUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct( - SimpleBadUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct& operator =( - const SimpleBadUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimpleBadUnionStruct that will be copied. - */ - eProsima_user_DllExport SimpleBadUnionStruct& operator =( - SimpleBadUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimpleBadUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimpleBadUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimpleBadUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleBadUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleBadUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleBadUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleBadUnion& my_union(); - - - /*! - * @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 SimpleBadUnionStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - SimpleBadUnion m_my_union; - -}; - - - -/*! - * @brief This class represents the structure SimplBadDiscUnionStruct defined by the user in the IDL file. - * @ingroup Types - */ -class SimplBadDiscUnionStruct -{ -public: - - /*! - * @brief Default constructor. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct(); - - /*! - * @brief Default destructor. - */ - eProsima_user_DllExport ~SimplBadDiscUnionStruct(); - - /*! - * @brief Copy constructor. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct( - const SimplBadDiscUnionStruct& x); - - /*! - * @brief Move constructor. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct( - SimplBadDiscUnionStruct&& x) noexcept; - - /*! - * @brief Copy assignment. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct& operator =( - const SimplBadDiscUnionStruct& x); - - /*! - * @brief Move assignment. - * @param x Reference to the object SimplBadDiscUnionStruct that will be copied. - */ - eProsima_user_DllExport SimplBadDiscUnionStruct& operator =( - SimplBadDiscUnionStruct&& x) noexcept; - - /*! - * @brief Comparison operator. - * @param x SimplBadDiscUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator ==( - const SimplBadDiscUnionStruct& x) const; - - /*! - * @brief Comparison operator. - * @param x SimplBadDiscUnionStruct object to compare. - */ - eProsima_user_DllExport bool operator !=( - const SimplBadDiscUnionStruct& x) const; - - /*! - * @brief This function copies the value in member my_union - * @param _my_union New value to be copied in member my_union - */ - eProsima_user_DllExport void my_union( - const SimpleBadDiscUnion& _my_union); - - /*! - * @brief This function moves the value in member my_union - * @param _my_union New value to be moved in member my_union - */ - eProsima_user_DllExport void my_union( - SimpleBadDiscUnion&& _my_union); - - /*! - * @brief This function returns a constant reference to member my_union - * @return Constant reference to member my_union - */ - eProsima_user_DllExport const SimpleBadDiscUnion& my_union() const; - - /*! - * @brief This function returns a reference to member my_union - * @return Reference to member my_union - */ - eProsima_user_DllExport SimpleBadDiscUnion& my_union(); - - - /*! - * @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 SimplBadDiscUnionStruct& data, - size_t current_alignment = 0); - - - - /*! - * @brief This function serializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serialize( - eprosima::fastcdr::Cdr& cdr) const; - - /*! - * @brief This function deserializes an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void deserialize( - eprosima::fastcdr::Cdr& cdr); - - - - - /*! - * @brief This function tells you if the Key has been defined for this type - */ - eProsima_user_DllExport static bool isKeyDefined(); - - /*! - * @brief This function serializes the key members of an object using CDR serialization. - * @param cdr CDR serialization object. - */ - eProsima_user_DllExport void serializeKey( - eprosima::fastcdr::Cdr& cdr) const; - - -private: - - SimpleBadDiscUnion m_my_union; - -}; - - -#endif // _FAST_DDS_GENERATED_TYPES_H_ - - - -#endif // FASTCDR_VERSION_MAJOR == 1 diff --git a/tools/fds/server.cpp b/tools/fds/server.cpp index a877f0e3b03..251aab948f5 100644 --- a/tools/fds/server.cpp +++ b/tools/fds/server.cpp @@ -116,7 +116,7 @@ int fastdds_discovery_server( sXMLConfigFile = sXMLConfigFile.substr(delimiter_pos + 1, sXMLConfigFile.length()); } - if (ReturnCode_t::RETCODE_OK != DomainParticipantFactory::get_instance()->load_XML_profiles_file( + if (RETCODE_OK != DomainParticipantFactory::get_instance()->load_XML_profiles_file( sXMLConfigFile)) { std::cout << "Cannot open XML file " << sXMLConfigFile << ". Please, check the path of this " @@ -144,7 +144,7 @@ int fastdds_discovery_server( } #endif // ifdef _WIN32 // Set default participant QoS from XML file - if (ReturnCode_t::RETCODE_OK != DomainParticipantFactory::get_instance()->load_profiles()) + if (RETCODE_OK != DomainParticipantFactory::get_instance()->load_profiles()) { std::cout << "Error setting default DomainParticipantQos from XML default profile." << std::endl; return 1; @@ -153,7 +153,7 @@ int fastdds_discovery_server( } else { - if (ReturnCode_t::RETCODE_OK != + if (RETCODE_OK != DomainParticipantFactory::get_instance()->get_participant_qos_from_profile( profile, participantQos)) { diff --git a/utils/scripts/update_generated_code_from_idl.sh b/utils/scripts/update_generated_code_from_idl.sh index f2d5f4c9974..68c836ce41c 100755 --- a/utils/scripts/update_generated_code_from_idl.sh +++ b/utils/scripts/update_generated_code_from_idl.sh @@ -1,30 +1,27 @@ #!/usr/bin/env bash files_to_exclude=( - './include/fastrtps/types/*' ) -files_needing_typeobject=( - './examples/cpp/dds/ContentFilteredTopicExample/HelloWorld.idl' - './test/blackbox/types/HelloWorld.idl' - './test/blackbox/types/TestIncludeRegression3361.idl' - './test/blackbox/types/TestRegression3361.idl' - './test/unittest/dds/topic/DDSSQLFilter/data_types/ContentFilterTestType.idl' - './test/unittest/dynamic_types/idl/Basic.idl' - './test/unittest/dynamic_types/idl/new_features_4_2.idl' - './test/unittest/dynamic_types/idl/Test.idl' - './test/unittest/xtypes/idl/Types.idl' - './test/unittest/xtypes/idl/WideEnum.idl' - './test/xtypes/idl/Types.idl' +files_not_needing_typeobject=( + './include/fastdds/dds/xtypes/type_representation/detail/dds-xtypes_typeobject.idl' + './src/cpp/fastdds/builtin/type_lookup_service/detail/TypeLookupTypes.idl' + './src/cpp/fastdds/builtin/type_lookup_service/detail/rpc_types.idl' ) files_needing_case_sensitive=( - './test/unittest/dynamic_types/idl/new_features_4_2.idl' ) files_needing_output_dir=( './include/fastdds/statistics/types.idl|../../../src/cpp/statistics/types|../../../test/blackbox/types/statistics' './include/fastdds/statistics/monitorservice_types.idl|../../../src/cpp/statistics/types|../../../test/blackbox/types/statistics' + './include/fastdds/dds/xtypes/type_representation/dds-xtypes_typeobject.idl|./detail' + ) + +files_needing_no_typesupport=( + './include/fastdds/dds/core/detail/DDSReturnCode.idl' + './include/fastdds/dds/core/detail/DDSSecurityReturnCode.idl' + './include/fastdds/dds/xtypes/dynamic_types/detail/dynamic_language_binding.idl' ) red='\E[1;31m' @@ -63,11 +60,13 @@ for idl_file in "${idl_files[@]}"; do cd "${idl_dir}" # Detect if needs type_object. - [[ ${files_needing_typeobject[*]} =~ $idl_file ]] && to_arg='-typeobject' || to_arg='' + [[ ${files_not_needing_typeobject[*]} =~ $idl_file ]] && to_arg='-no-typeobjectsupport' || to_arg='' # Detect if needs case sensitive. [[ ${files_needing_case_sensitive[*]} =~ $idl_file ]] && cs_arg='-cs' || cs_arg='' + [[ ${files_needing_no_typesupport[*]} =~ $idl_file ]] && nosupport_arg='-no-typesupport' || nosupport_arg='' + # Detect if needs output directories. not_processed=true for od_entry in ${files_needing_output_dir[@]}; do @@ -76,14 +75,14 @@ for idl_file in "${idl_files[@]}"; do od_entry_split=(${od_entry//\|/ }) for od_entry_split_element in ${od_entry_split[@]:1}; do od_arg="-d ${od_entry_split_element}" - fastddsgen -cdr both -replace $to_arg $cs_arg $od_arg "$file_from_gen" + fastddsgen -replace -genapi $to_arg $cs_arg $od_arg "$file_from_gen" -no-dependencies done break fi done if $not_processed ; then - fastddsgen -cdr both -replace $to_arg $cs_arg "$file_from_gen" + fastddsgen -replace -genapi $to_arg $cs_arg $nosupport_arg "$file_from_gen" -no-dependencies fi if [[ $? != 0 ]]; then @@ -93,4 +92,18 @@ for idl_file in "${idl_files[@]}"; do cd - done +# Move source files to src/cpp +mv ./include/fastdds/dds/xtypes/type_representation/detail/dds_xtypes_typeobjectCdrAux.ipp ./src/cpp/fastdds/xtypes/type_representation/dds_xtypes_typeobjectCdrAux.ipp +mv ./include/fastdds/dds/xtypes/type_representation/detail/dds_xtypes_typeobjectPubSubTypes.cxx ./src/cpp/fastdds/xtypes/type_representation/dds_xtypes_typeobjectPubSubTypes.cxx + +sed -i 's+"dds_xtypes_typeobjectCdrAux.hpp"++' ./src/cpp/fastdds/xtypes/type_representation/dds_xtypes_typeobjectCdrAux.ipp +sed -i 's+"dds_xtypes_typeobjectCdrAux.hpp"++' ./src/cpp/fastdds/xtypes/type_representation/dds_xtypes_typeobjectPubSubTypes.cxx +sed -i 's+"dds_xtypes_typeobjectPubSubTypes.h"++' ./src/cpp/fastdds/xtypes/type_representation/dds_xtypes_typeobjectPubSubTypes.cxx + +sed -i 's+"../../../../../../include/fastdds/dds/xtypes/type_representation/detail/dds-xtypes_typeobject.hpp"++' ./src/cpp/fastdds/builtin/type_lookup_service/detail/TypeLookupTypes.hpp +sed -i 's+"../../../../../../include/fastdds/dds/core/detail/DDSReturnCode.hpp"++' ./src/cpp/fastdds/builtin/type_lookup_service/detail/TypeLookupTypes.hpp + +sed -i 's+"../../../../../../include/fastdds/dds/xtypes/type_representation/detail/dds-xtypes_typeobjectPubSubTypes.h"++' ./src/cpp/fastdds/builtin/type_lookup_service/detail/TypeLookupTypesPubSubTypes.h +sed -i 's+"../../../../../../include/fastdds/dds/core/detail/DDSReturnCodePubSubTypes.h"++' ./src/cpp/fastdds/builtin/type_lookup_service/detail/TypeLookupTypesPubSubTypes.h + exit $ret_value diff --git a/versions.md b/versions.md index 9a2ba577c5f..c5f578a40ee 100644 --- a/versions.md +++ b/versions.md @@ -24,6 +24,10 @@ Forthcoming * TimeConversion * DBQueue * Added create participant methods that use environment XML profile for participant configuration. +* XML Parser API no longer public. +* New TypeObjectRegistry class to register/query TypeObjects/TypeIdentifiers. +* New TypeObjectUtils class providing API to build and register TypeObjects/TypeIdentifiers. +* Added `non_blocking_send` to TCP Transport. Version 2.14.0 --------------